From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: Joern Rennecke Cc: dan@cgsoftware.com (Daniel Berlin), mark@codesourcery.com (Mark Mitchell), wilson@cygnus.com, gcc@gcc.gnu.org Subject: Re: debugging optimized programs (Was: Re: Bootstrap failure of gcc-ss-20010409 in ia64) Date: Wed, 18 Apr 2001 15:12:00 -0000 Message-id: References: <200104182134.f3ILYxs07012@phal.cambridge.redhat.com> X-SW-Source: 2001-04/msg00896.html Joern Rennecke 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