Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Terry Guo <terry.guo@arm.com>
Cc: gdb-patches@sourceware.org, pedro@codesourcery.com
Subject: Re: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703)
Date: Wed, 29 Jun 2011 05:36:00 -0000	[thread overview]
Message-ID: <4E0AB9B3.8060104@codesourcery.com> (raw)
In-Reply-To: <000101cc35fb$8d45ff60$a7d1fe20$@guo@arm.com>

On 06/29/2011 09:26 AM, Terry Guo wrote:
> Hi,
> 
> I slightly modified the test case and got the below code:
> 
> 00008142 <test>:
>     8142:       250a            movs    r5, #10
> 

Could you show the source code of function "test"?  I can't figure out
how gcc generates such code.  Is it optimized by tail-call optimization?

> 
> Without Yao's patch, the "b bar" sets the break point at 0x8158. With Yao's
> patch, the "b test" still sets the break point at 0x814e that is outside the
> function test body. But the "b bar" sets the break point at 0x814e which is
> better than 0x8158. IMHO, theoretically function test could have many other
> different kinds of instruction patterns. So I think it is better to have two

There are many patterns of prologue, and that is why arm/thumb prologue
analyzer has long if/else statements to handle different cases.  My
understanding is, if GCC emit some prologue that GDB's prologue analyzer
doesn't understand, we have to improve prologue analyzer.

> enhancements one is Yao's patch which enhances the function
> thumb_analyze_prologue and make it more accurate, and another one is my
> patch which ensures the function break point to be always set inside the
> function body in a more general way. Does this solution sound good?

I am not against your approach, but prologue analyzer is still unable to
analyze some corner-case functions, so I am afraid stack backtrace on
these corner-case functions doesn't work, because stack bactrace need
the information provided from prologue analyzer.

In short, we should improve prologue analyzer to understand such
prologue as much as we can.  If it is difficult to understand some
strange prologue, such as your case, we have to resort to your patch.

-- 
Yao (齐尧)


  reply	other threads:[~2011-06-29  5:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 11:26 Terry Guo
2011-06-29  1:26 ` Terry Guo
2011-06-29  5:36   ` Yao Qi [this message]
2011-06-29  7:00     ` Terry Guo
2011-06-29  8:00       ` Yao Qi
2011-06-29  8:49         ` Terry Guo
     [not found]         ` <45520D6299C11E4588128526465332BB0D0C8B1246@SAROVARA.Asiapac.Arm.com>
2011-06-29 10:00           ` Yao Qi
2011-06-29 10:17             ` Terry Guo
2011-07-01  8:59             ` Richard Earnshaw
2011-07-01  9:47               ` Pedro Alves
2011-07-13 13:21                 ` Terry Guo
  -- strict thread matches above, loose matches on Subject: below --
2011-06-24  2:31 Terry Guo
2011-06-24  3:55 ` Yao Qi
2011-06-24  8:59   ` Pedro Alves
2011-06-24 10:39     ` Yao Qi

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=4E0AB9B3.8060104@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=terry.guo@arm.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