Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Triple Yang <triple.yang@gmail.com>
To: Sterling Augustine <saugustine@google.com>
Cc: gdb@sourceware.org
Subject: Re: How to skip function prologues with stabs debug infomation?
Date: Sat, 20 Aug 2011 03:18:00 -0000	[thread overview]
Message-ID: <CAGxstLSck5gN+69xo+5ZMC3KxX3t5HuoPk5S_x29c7Ef1T9tmw@mail.gmail.com> (raw)
In-Reply-To: <CAEG7qUwkM32O1MEoKFNrb5Hk7+npizsWE7hXCeXJvEmGbL-HQA@mail.gmail.com>

2011/8/20 Sterling Augustine <saugustine@google.com>:
> The Xtensa port uses prologue analysis (and some heuristics) to
> determine its end without debug info. It's prologues are somewhat more
> complex than others. Take a look at xtensa-tdep.c starting around line
> 1151.
>
> It's only a heuristic, but for unoptimized code it works pretty well.
> For optimized code, the prologue can be sufficiently mixed with real
> code and that makes it hard to declare a single point "the end of the
> prologue" anyway.
>

OK, I'll take it as an example. Actually I've written a skip prologue
subroutine using heuristics, which works sometimes. I am thinking to
make use of SAL to do better.

> Sterling
>
> On Fri, Aug 19, 2011 at 10:56 AM, Triple Yang <triple.yang@gmail.com> wrote:
>> 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
>>
>



-- 
Yang Yong-Yong


      parent reply	other threads:[~2011-08-20  3:18 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
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 [this message]

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=CAGxstLSck5gN+69xo+5ZMC3KxX3t5HuoPk5S_x29c7Ef1T9tmw@mail.gmail.com \
    --to=triple.yang@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=saugustine@google.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