[Dwarf-Discuss] Why "DW_LNS_advance_pc" is needed and when it be generated ?

Yu Zhenyang yuzhenyang at gmail.com
Wed Aug 6 19:25:59 PDT 2008


Hi, all,

I am working a compiler bug that relative to DW_LNS_advance_pc. In the piece
of C language code of "switch/case", when I send "next" to gdb for the
compiled binaray (with -g option) on statement "switch (n)", the PC move to
next function that defined next to the "switch/case" function.

When I compare the line number information with the gcc output. I found
there are extra "Advance PC by 36 to 214170" statement in Line Number
Statements at the end of the "switch/case" function.

I wonder when and why the statement is generated.  As far as I know, the
compiler only generate ".loc " in ".s" file. Then how and when the "as"
translates it. Also, why "DW_LNS_advance_pc" is needed and when it be
generated.

Can somebody give some advice? Thanks !


Best regards,

Zhenyang
-- 
Output is principal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20080807/fd4bb716/attachment-0001.htm>


More information about the Dwarf-Discuss mailing list