Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Terry Guo" <terry.guo@arm.com>
To: <gdb-patches@sourceware.org>
Cc: <yao@codesourcery.com>,	<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 01:26:00 -0000	[thread overview]
Message-ID: <000101cc35fb$8d45ff60$a7d1fe20$@guo@arm.com> (raw)
In-Reply-To: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com>

Hi,

I slightly modified the test case and got the below code:

00008142 <test>:
    8142:       250a            movs    r5, #10

00008144 <bar>:
    8144:       b510            push    {r4, lr}
    8146:       2300            movs    r3, #0
    8148:       4c07            ldr     r4, [pc, #28]   ; (8168 <bar+0x24>)
    814a:       4908            ldr     r1, [pc, #32]   ; (816c <bar+0x28>)
    814c:       4808            ldr     r0, [pc, #32]   ; (8170 <bar+0x2c>)
    814e:       e001            b.n     8154 <bar+0x10>
    8150:       505a            str     r2, [r3, r1]
    8152:       3304            adds    r3, #4
    8154:       185a            adds    r2, r3, r1
    8156:       4282            cmp     r2, r0
    8158:       591a            ldr     r2, [r3, r4]
    815a:       d3f9            bcc.n   8150 <bar+0xc>
    815c:       42aa            cmp     r2, r5
    815e:       bf8c            ite     hi
    8160:       2500            movhi   r5, #0
    8162:       2501            movls   r5, #1
    8164:       bd10            pop     {r4, pc}
    8166:       bf00            nop

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
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?

Best regards,
Terry




  reply	other threads:[~2011-06-29  1:26 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 [this message]
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
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='000101cc35fb$8d45ff60$a7d1fe20$@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