further help on dwarf2 debug

Richard Henderson rth@redhat.com
Thu Sep 24 16:42:00 GMT 2009


On 09/24/2009 12:35 AM, IainS wrote:
> The main difference (and the area causing the tool to barf) is that the
> FDE on 4.5 has some extra information not present in 4.4
>
> .byte 0x4 # DW_CFA_advance_loc4
> .set L$set$6,LCFI3-LCFI1
> .long L$set$6
> .byte 0xc5 # DW_CFA_restore, column 0x5
> .byte 0xc # DW_CFA_def_cfa
> .byte 0x4 # uleb128 0x4
> .byte 0x4 # uleb128 0x4
...
> What is the purpose of the addition?

It describes the operation of the "leave" instruction.

If you set a breakpoint on the "ret" instruction, you now have correct 
unwind information at that spot.  The debugger does not have to resort 
to code inspection to figure out the backtrace.

While gdb and most likely other more robust user-level debuggers *will* 
resort to code inspection (because historically it was necessary), newer 
tools like SystemTap do not; SystemTap is written to work only with the 
debug information.


r~



More information about the Gcc mailing list