How to skip function prologues with stabs debug infomation?

Jan Kratochvil jan.kratochvil@redhat.com
Fri Aug 19 18:04:00 GMT 2011


On Fri, 19 Aug 2011 19:56:44 +0200, Triple Yang wrote:
> It seems not that easy for a rescheduled prologue, because prologues
> generated with compiler optimization on make things complicated.

With gcc -O2 -g gdb already no longer skips prologues, see
symtab->locations_valid (a recent change by me).  If DW_AT_location is valid
for every PC of a function you do not need to skip prologues.  I would find
best to comply with it in your compiler and do not depend on the fragile
prologue skipping.


> It's well-known that people can take advantage of SAL info when to
> skip prologue with dwarf info. I wonder whether we can do the same
> thing with stabs.

I am not proficient with STABS but when gcc can produce the line number info
for both STABS and DWARF you should be also able to do so.


> As for your examples, we sometimes need to skip prologue first before
> we can insert breakpoints. Skipping prologue is a lower-level
> function.

I have not checked what skip_prologue_sal returns but I have checked using
readelf -wl the breakpoint address is aligned with the line number info.


You may have reasons for STABS but I do not see why not to produce only DWARF.


Thanks,
Jan



More information about the Gdb mailing list