public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Richard Earnshaw <Richard.Earnshaw@buzzard.freeserve.co.uk>
Cc: gdb-patches@sourceware.org, julian@codesourcery.com
Subject: Re: [patch] Fix PR tdep/12352: Handle str pc, [Rd, #imm] in displaced stepping
Date: Mon, 24 Jan 2011 13:22:00 -0000	[thread overview]
Message-ID: <4D3D3278.5050602@codesourcery.com> (raw)
In-Reply-To: <4D3AF29E.3020708@buzzard.freeserve.co.uk>

On 01/22/2011 11:07 PM, Richard Earnshaw wrote:
> On 28/12/10 16:41, Yao Qi wrote:
>> When I read arm-tdep.c:copy_ldr_str_ldrb_strb, I feel pretty hard to
>> understand two lines of code,
>>
>>       dsc->modinsn[0] = 0xe58ff014;  /* str pc, [pc, #20].  */
>>       dsc->modinsn[1] = 0xe59f4010;  /* ldr r4, [pc, #16].  */
> 
> Hmm, looks like a rather convoluted way of moving the PC into R4.
> Julian, I think this patch was yours... can you remember why  "MOV R4,
> PC" wasn't sufficient?
> 

IIUC, these two instructions together with 'sub r4, r4, pc' are used to
calculate the offset of 'str pc ADDR', which is 8 or
12(implementation-dependent, but consistent for a given device).
AFAIK, 'mov r4, pc' doesn't help.

-- 
Yao (齐尧)

  reply	other threads:[~2011-01-24  8:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28 17:24 Yao Qi
2011-01-06 14:03 ` [Ping : patch] " Yao Qi
2011-01-19 16:17   ` [Ping 2: " Yao Qi
2011-01-22 23:44 ` [patch] " Richard Earnshaw
2011-01-24 13:22   ` Yao Qi [this message]
2011-01-31  0:31   ` Yao Qi
2011-01-31 15:56     ` Ulrich Weigand
2011-02-09  6:15       ` Yao Qi
2011-02-09 13:51         ` Ulrich Weigand
2011-02-10  6:19           ` Yao Qi
2011-02-14 14:39             ` Ulrich Weigand
2011-02-15 10:55               ` Yao Qi
2011-02-15 13:36                 ` Ulrich Weigand
2011-02-15 15:57                   ` 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=4D3D3278.5050602@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=Richard.Earnshaw@buzzard.freeserve.co.uk \
    --cc=gdb-patches@sourceware.org \
    --cc=julian@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).