Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Terry Guo" <terry.guo@arm.com>
To: "'Yao Qi'" <yao@codesourcery.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 10:17:00 -0000	[thread overview]
Message-ID: <000701cc3645$b5004980$1f00dc80$@guo@arm.com> (raw)
In-Reply-To: <4E0AF7A6.1040800@codesourcery.com>



> -----Original Message-----
> From: Yao Qi [mailto:yao@codesourcery.com]
> Sent: Wednesday, June 29, 2011 6:00 PM
> To: Terry Guo
> 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)
> 
> On 06/29/2011 04:47 PM, Terry Guo wrote:
> > Hi,
> >
> > First if you look at the generated binary code, I thought it is a
> valid case. After performing the function test, it will fall into
> function bar which is a normal function. At least my case can run
> correctly on QEMU. It is very likely for people to write program in
> assembly code like:
> >
> > main:
> >     b test
> >
> > test:
> >     movs r5, #10
> > bar:
> >     push.......
> >     .........
> >
> 
> We are lucky here GCC places bar next to function test physically, but
> gcc may also place function test and bar in other layout, like
> 
> main:
> 	b test
> 
> bar:
> 	push ...
> 
> test:
> 	moves r5, #10
> 
> After test, processor will run some instructions that we don't know.
> IMO, it is incorrect.
> 
> > You cannot say this is a invalid program. If you have concern about
> attribute NAKED, I can rewrite it in assembly code.
> >
> 
> I have no concern on attribute NAKED here.

I know that GCC will "luckily" place code like that. That's why I just post
assembly code first. The key point here is the program can be written in 
assembly code and in this way the function position can be ensured without
the help of luck. is my understanding right? 
I use "naked" here in C code because I am lazy to write
assembly code. You can omit the "naked" in C and look at the case as a case
written in assembly code.

> 
> > Second, we all know that current prologue analyzer cannot handle all
> cases. My patch only intends to be a worthwhile supplement for cases
> that beyond the prologue analyzer capability.
> >
> > Third, I also have strong interesting to enhance prologue analyze. I
> suggest we use another thread to discuss how to enhance prologue
> analyzer to handle all possible cases. And leave this one to discuss
> whether is it worthwhile to have my patch.
> 
> OK, thanks for your clarification.  If you think your test case is
> correct, please send the patch again, and the right people can
> review/approve your patch.
>
> --
> Yao (齐尧)
> 
> P.S.  1. could you please set up your mail client to newline your mail
> automatically?  It is hard to read one paragraph in one line.  2.
> could
> you reply mail with quoted context?

Thanks for your reminding.

BR,
Terry 





  reply	other threads:[~2011-06-29 10:17 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
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 [this message]
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='000701cc3645$b5004980$1f00dc80$@guo@arm.com' \
    --to=terry.guo@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=yao@codesourcery.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