How to skip function prologues with stabs debug infomation?
Triple Yang
triple.yang@gmail.com
Fri Aug 19 17:57:00 GMT 2011
Thank you. Of course GDB supports SATBS debug info.
well, my question is mostly on HOW to support SATBS debug info
(specifically, to skip prologue) when I have to write a new gdb
backend, i.e. to port gdb to a new architecture whose function
prologue instructions are not that orderly.
I have checked several backend implementations such as or32 and i386,
but their prologues are tidy and clean to make the analysis much
easier. So we don't even need debug info to skip the prologue. It
seems not that easy for a rescheduled prologue, because prologues
generated with compiler optimization on make things complicated.
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.
As for your examples, we sometimes need to skip prologue first before
we can insert breakpoints. Skipping prologue is a lower-level
function.
Best regards.
2011/8/20 Jan Kratochvil <jan.kratochvil@redhat.com>:
> On Fri, 19 Aug 2011 18:08:54 +0200, Triple Yang wrote:
>> is there any chance that we use symbol and line (sal) to skip function
>> prologues with stabs debug infomation?
>> And if not, why?
>
> GDB does, why not? The prologue skipping processes already decoded debug
> info, no matter if it is DWARF or STABS.
>
> gcc -Wall
> Breakpoint 1 at 0x400478
> gcc -gstabs
> Temporary breakpoint 1 at 0x40047c: file 24.c, line 3.
> (gdb) p/x $pc
> $1 = 0x40047c
> gcc -gdwarf-3
> Temporary breakpoint 1 at 0x40047c: file 24.c, line 3.
>
> Sure STABS is discouraged.
>
>
> Regards,
> Jan
>
--
Yang Yong-Yong
More information about the Gdb
mailing list