stdcall
stdcall

Reputation: 28860

working effectively with gdb

Whenever possible, I usually tend to learn keyboard shortcuts. It's really amazing to see an experienced coder works with VI effectively. I've been trying for sometime switching to debugging with gdb, instead of eclipse debugger (based on gdb) And I still find it hard to actually navigate through the code, inspecting variables, etc. Actually, I have never seen an experienced gdb user, so I'm wondering... does it worth it? Is it possible to work effectively with gdb ?

Note: I also tried cgdb, which is a curses extension of gdb. It's better, but I still feel that its still not effective enough...

Upvotes: 4

Views: 773

Answers (3)

stdcall
stdcall

Reputation: 28860

This question didn't get much attention, although a bounty was offered. So I decided to investigate further the issue for myself. Finally I stumbled upon a solution which I think can be quite effective.

It's called tmux, and it's basically similar to gnu screen. This tool allows splitting the console to several panes, each containing different process. Therefore it's possible to have a single window with gdb and emacs. switching between the windows is very easy using a dedicated hot key.

Upvotes: 0

Lefteris E
Lefteris E

Reputation: 2814

You could also try the ddd debuger:

http://www.gnu.org/software/ddd/

Upvotes: 0

Martin
Martin

Reputation: 1381

GDB has a curses interface, which can be activated via the command line option -tui. This interface has a single key mode, which makes the most common operation available with a single keystroke. If additionally you make use of automatic command execution e.g. to display variable values, when a breakpoint is reached, then this is as comfortable and quick as it gets. But if you use Eclipse anyway, I see no point in avoiding the Eclipse UI for gdb.

I used GDB inside emacs for some time, but found the time to transfer information between GDB and emacs unacceptable, so I switched to this TUI mode mentioned above. I don't know, if the transfer of information between GDB and Eclipse is faster, but at least startup time of complex programs might be much better in GDB directly than in Eclipse.

Upvotes: 3

Related Questions