You are not logged in.
Pages: 1
Anyone is using vim with gdb?
I tried few scripts from vim.sf.net, but they don't work.
I was able to use vdb with simple example program but it doesn't work with my huge project.
I wonder why this feature is not implemented just in vim and why each script is old or broken?
Offline
vim is not a debugger. It is also not an IDE. It is made to write text. I do not need gdb when writing emails, nor do I need gdb when editing a config file. For this very reason this is not "implemented just in vim". Vim is a text editor.
Furthermore, I have tried all the gdb+vim scripts in the past. While they are good, I later learned to actually use gdb properly and will _never_ go back to the crippled scripts that integrate the two. Try learning gdb on it's own. It's worth it.
Offline
dude. i use a debugger on my email all the time.
/me sets a breakpoint and runs while viewing his stack
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
phrakture I use gdb since 1998, the problem is that I am constantly switching between vim and gdb when I am debugging something, "list" is not enough for me.
How do you tell gdb where to put breakpoint, for instance, when you want to stop after loop? Don't you need a line number from vim? So while I am in gdb, I need to switch to vim terminal and find the line number, then I go back and put a breakpoint, also code in gdb is not highlighted.
I remember I was reading one day in the documentation of vim, that it's not going to be full IDE, just simple editor, but I like the Project plugin, it makes editing of my source tree much more user friendly.
The thing I was never able to make work is code completion feature. But I can live without it. Cscope is more important.
Offline
I can't help you with the vim plugin / gdb switching problem per se as I don't use a debugger that often and if, then it's mostly ddd or insight (just because I never had to intensively use a debugger I suppose).
But you could perhaps give cgdb http://cgdb.sourceforge.net/ a try, as it supposedly is very vim-like but I never used it so I can't say anything good or bad about it.
Offline
I want vim+gdb, not gdb frontend.
Offline
use split windows perhaps - screen, vim and xmonad can all do the trick.
Last edited by tch (2008-01-30 17:25:58)
Offline
How do you tell gdb where to put breakpoint, for instance, when you want to stop after loop? Don't you need a line number from vim? So while I am in gdb, I need to switch to vim terminal and find the line number, then I go back and put a breakpoint, also code in gdb is not highlighted.
Aha! I knew where this question was leading. Take a look here:
http://img.phraktured.net/screenshots/irc_and_gdb.png
The middle there with the code? That's 100% gdb. It's called the TUI.
Offline
OK, you are right, I didn't know it, will try to learn this feature. Big thanks!
Offline
Check out cgdb as well, a curses front end for gdb/tgdb. http://cgdb.sourceforge.net/
Added with the vsplit patch for screen, it's money money, yeah yeah. I think a little more integration sometimes would be nice sometimes, but that thought only occurs to me about once every 3 months.
Offline
The thread is old but seems is not answered yet, I have developed a vim plugin that might work for you http://www.vim.org/scripts/script.php?script_id=4103
With this plugin you can:
add breakpoints
delete breakpoints
print variable values
etc
There is still some pending features like remote debugging and attach to a process but I am constantly adding code in github and I am working hard to create the plugin that becomes in the perfect gdb-vim solution.
Moreover I am willing to hear any suggestion you have.
Offline
Very timely, I'll check it out, thanks!
Offline
Okay, the plugin depended on a gdblib, which was not only not in the standard repositories, but not in the AUR either. I put it there now, under python2-gdblib-git.
I think rather than just erroring when it realises you haven't set g:gdb_from_vim_{run,args}, your plugin should prompt for them. At first I thought there was a bug. Okay, I should have rtfmed, but I prefer to rtfm after I've seen a little basic functionality.
Is it possible to set a flag that will tell gdb what tty to use? You see, I would be interested in using your plugin in ncurses applications, which require setting, say, tty=/dev/pts/1, so that gdb and curses don't fight for terminal real estate.
Last edited by /dev/zero (2012-06-18 00:36:22)
Offline
Those are good recomendations I already opened two enhancements in gdbfromvim
and in gdblib (I developed both)
https://github.com/skibyte/gdb-from-vim/issues
https://github.com/skibyte/gdblib/issues
They should be ready on the following days.
Thanks a lot for try the plugin and give me your feedback.
Offline
Those are good recomendations I already opened two enhancements in gdbfromvim
and in gdblib (I developed both)
https://github.com/skibyte/gdb-from-vim/issues
https://github.com/skibyte/gdblib/issuesThey should be ready on the following days.
Thanks a lot for try the plugin and give me your feedback.
Cool, thanks!
I came across this old thread a few days ago when trying to figure out how to integrate vim and gdb. I couldn't believe they have such poor integration. The TUI mode in gdb just doesn't cut it. It's not clear to me how to configure key mappings and macros for gdb, TUI doesn't highlight syntax, and neither is it clear how to seamlessly edit the source while debugging. I wasn't able to start fixing it myself because I'm still just learning both vimscript and gdb. Maybe after I learn both a bit better, I'll realise integration isn't necessary - for now, however, it would be nice.
So, it was quite a nice coincidence to see the same thread necrobumped with a chance at a new solution :-). Thanks for your efforts.
Offline
* I added a new version of gdbfromvim in http://www.vim.org/scripts/script.php?script_id=4103 and https://github.com/skibyte/gdb-from-vim
* I also updated gdblib https://github.com/skibyte/gdblib .
The changes I added are :
* GdbFromVimContinue which is the equivalent to gdb continue command.
* GdbFromVimTty where somebody can specify a tty for IO redirection.
* If g:gdb_from_vim_app is not defined vim it will prompt for the value when a GdbFromVim command is invoked.
Since I think it is not the best idea provide status of version releases or bugs in this forum, I would appreciate if anybody reading this opens a bug or a feature you desire in the respective github site mentioned above.
Thanks.
Offline
Looks like it works well, thanks :-).
Offline
Pages: 1