From: Triple Yang <triple.yang@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: How to skip function prologues with stabs debug infomation?
Date: Sat, 20 Aug 2011 03:45:00 -0000 [thread overview]
Message-ID: <CAGxstLR0arhbnRt8M5QgBaQxddfq1Fz3pQh06PhkGPR4YyvX8A@mail.gmail.com> (raw)
In-Reply-To: <20110819180431.GA6279@host1.jankratochvil.net>
2011/8/20 Jan Kratochvil <jan.kratochvil@redhat.com>:
> 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.
>
I agree with that. Since we can get line number from binary file's
section offset, and vice versa, we can skip prologue using line
number. The practical problem is that, I don't know how to implement
it, i.e. what functions should be called. Any suggestions?
>
>> 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
>
--
Yang Yong-Yong
next prev parent reply other threads:[~2011-08-20 3:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 16:09 Triple Yang
2011-08-19 16:28 ` Jan Kratochvil
2011-08-19 17:57 ` Triple Yang
2011-08-19 18:04 ` Jan Kratochvil
2011-08-20 3:45 ` Triple Yang [this message]
2011-08-20 11:40 ` Jan Kratochvil
2011-08-20 13:07 ` Triple Yang
2011-08-20 13:33 ` Jan Kratochvil
2011-08-20 14:49 ` Triple Yang
2011-08-19 18:15 ` Joel Brobecker
[not found] ` <CAEG7qUwkM32O1MEoKFNrb5Hk7+npizsWE7hXCeXJvEmGbL-HQA@mail.gmail.com>
2011-08-20 3:18 ` Triple Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGxstLR0arhbnRt8M5QgBaQxddfq1Fz3pQh06PhkGPR4YyvX8A@mail.gmail.com \
--to=triple.yang@gmail.com \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox