jacob navia said:
James Kanze a écrit :
Sure
(1) It will show in the "autos" windows, the inetersting variables
automatically. You are now UNABLE to type at EACH step
gdb> print foo_variable
It does it for you without any typing. HORRIBLE.
Can't you use "display foo_variable" on the gdb prompt? It should
always display the value of foo_variable at every step.
(2) It shows you in a window the program text. How HORRIBLE.
Now you are unable to type at each step
gdb> list
And you see in good colours the whole module's text without starting
vi in another xterm. HOW HORRIBLE!
Do you know that gdb ships with a text user interface that uses
windows?
Start gdb with the flag "-tui" or use the command "gdbtui" on the
shell (You can also use Ctrl-x a to toggle this mode on/off while
running gdb).
Unfortunately it doesn't do syntax highlight, although you can use
"cgdb" to get that (I've found out that the lack of syntax highlight
doesn't really bother me that much, but then again, I'm still a
student).
(3) And a long list of thousands of features that gdb provides only with
arcane commands that you have to memorize and regurgitate each time
you use it. Not to speak of "go to definition" that gdb does very
well isn't it?
Yeah, I got nothing there. I guess you can use the "help" command to
see the commands that gdb uses, or you can define your own commands
using a .gdbinit, but I can understand that its usually not an
option. I usually just use a .gdbinit file that I've found on the
Internet that defines a few commands to pretty-print a couple of
data structures (for example, std::vector) instead of the usual dump
of information that gdb does (I've heard that the newer versions of
gdb work better at displaying the data structures, but I haven't
tried them yet).
You can find that .gdbinit here:
http://www.cs.tau.ac.il/telux/lecture-notes/gdbinit_stl_views-1.03.txt
Regarding the "go to definition" I think that's part of the IDE? For
example, if I recall correctly the C++ plugin for Eclipse uses gdb as
the debugger and it has no problem using the "go to definition"
command of Eclipse.
Hmm... While I was writing this, I learned that gdb does allow one to
say for example "list <class-name>" and it shows the definition of the
class (on the window if you use the tui mode or on the prompt if you
don't use it).
It seemed to work pretty well on a small code base I have here, but
I'm not sure if it would work as you want on a large code base.
(By the way, do you know you can just type "l" as a shortcut to
"look"?)
For those who want to compare, here the output of my "gdb -v":
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
linux people are just blind.
Meh, just like windows, there are people from several walks of life
using linux, so I guess you get a bit of everything when interacting
with them
.