silly debugging question
user42 at zip.com.au
Wed Apr 14 01:40:44 CEST 2004
Nathan Moore <nmoore at physics.umn.edu> writes:
> I was trying to use gdb to find the line where the program failed
> earlier this evening, but the syntax seems more cryptic that dbx.
> Realize its unrelated, but would none-the-less appreciate (if its easy
> to explain) a description of the easiest way to give the line at which
> the code fails from the gnu debugger, gdb.
"where" for a backtrace, "list" to show surrounding lines, "up" and
"down" to move up the stack frame so you can list source or print
variables in those frames.
You need to compile with CFLAGS=-g, since gcc -O rearranges so much as
to make it indecipherable, and gmp by default on various systems uses
-fomit-frame-pointer for efficiency, which makes backtraces
More information about the gmp-discuss