-----BEGIN PGP SIGNED MESSAGE-----
> I wonder how many of us there are left, using gdb? I believe X has a
> better (or at least flashier) de*.
Most other de*s are merely front-ends to gdb. One of the most
powerful ones is "ddd"; but even with all its nice GUI features, you
can still use plain old gdb commands in one of the windows :-) I would
strongly recommend that you try out "ddd" if you have not done so
before.
Quote:> Anyway, as long as I have you on
> the line :) I'll pose a question: do you ever find that gdb gives you the
> wrong answer when you try to print ('p') a variable that was an argument
> to the function you're in? This is my own beef with gdb...or maybe I'm
> doing something wrong?
There are two situations when this can happen:
1) You compiled your code with optimization enabled and the optimizer
detected that the variable is no longer used in this function. It
might then reuse the register that stored this variable for a
different variable. This can sometimes be quite confusing as it
is not always obvious when the optimizer decided to load and
unload registers. In general, optimization does not do much harm
and you will usually want it to be enabled, but every once in a
while it might be helpful to turn it off, in order to ease
debugging.
2) You compiled with "-fomit-frame-pointer". While this is arguably
a good idea for the final version of your program (as it results
in slightly better code), it will most certainly result in your
de* being seriously confused, because it cannot properly
locate variables (and parameters) that are accessible from the
stack. If you intend on debugging the excutable never use this
option.
So long,
Markus
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAgUBMXqrthqJqDLErwMxAQFPdAQAvVt8XRKqd8ZsYrFTNATHAKkeCILqad3f
/05P/jmf7yeaf2qWxFCuTPsXsG8O2vfp7i0S0Xh0sdoggeyf/SH2MQF9dvWwGbaJ
oH5WttIFr7FHFzRNfwhtqnK1J0ece6rIWmMX4vCi0dwYs3ODPR4BwCE4zsYPfp8k
6kZ6o3RJ0wk=
=Abpm
-----END PGP SIGNATURE-----
--
Schlage 5a
D-48268 Greven-Gimbte
Germany