debugging optimized programs (Was: Re: Bootstrap failure of gcc-ss-20010409 in ia64)

Daniel Berlin dan@cgsoftware.com
Wed Apr 18 15:12:00 GMT 2001


Joern Rennecke <amylaar@cambridge.redhat.com> writes:

> > I've used debuggers and compilers that support optimized debugging,
> > using dwarf2, to a point that except for variables that were optimized
> > out, i couldn't tell the difference between the optimized version, and
> > the non-optimized one, for debugging.
> 
> So what does the debugger do when you ask it to step one source level line
> forward (gdb 'n' command) when code from different lines is heavily
> intermingled by scheduling?
The line number information will tell it when it's actually advanced
one source line.

is_stmt will tell you when you hit the first thing that actually
belongs to that particularl line.

In the case of heavily intermingled code, the line number info may
look like (i've omitted is_stmt, basic_block, and other registers, for
simplicity):

Line advance            Address advance
0                       1
-1                      1
2                       1
-1                      1
etc



-- 
"I'm writing a book.  I've got the page numbers done, so now I
just have to fill in the rest.
"-Steven Wright



More information about the Gcc mailing list