From: Daniel Jacobowitz <dan@codesourcery.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb-patches@sourceware.org
Subject: Re: [Patch,ARM] Next pc of sigreturn/rt_sigreturn syscall
Date: Wed, 25 Aug 2010 14:31:00 -0000 [thread overview]
Message-ID: <20100825143137.GG28036@caradoc.them.org> (raw)
In-Reply-To: <20100825030554.GC29794@codesourcery.com>
Generally looks OK.
On Tue, Aug 24, 2010 at 08:05:55PM -0700, Yao Qi wrote:
> Here is the updated patch, in which:
> 1. Add arm_linux_syscall_next_pc, similar to
> mips_linux_syscall_next_pc. Compute the return address of SWI in both
> ARM mode and Thumb mode.
> 2. Extract some common code from arm_linux_copy_svc.
A valid return address won't be zero, but it's still confusing.
Please do this the way that e.g. mips_linux_get_longjmp_target does;
return 0 or 1, and have a CORE_ADDR * parameter.
> +static int
> +arm_linux_sigreturn_return_addr(struct frame_info *frame,
> + unsigned long svc_number)
Space before "(". Same problem in other places, too.
> +/* When FRAME is at a syscall instruction, return the PC of the next
> + instruction to be executed. */
> +
> +static CORE_ADDR
> +arm_linux_syscall_next_pc (struct frame_info *frame)
> +{
> + CORE_ADDR pc = get_frame_pc (frame);
> + CORE_ADDR return_addr = 0;
> + return_addr = arm_linux_sigreturn_return_addr(frame,
> + get_frame_register_unsigned (frame, 7));
Line too long; move the read of r7 to another temporary.
What about non-EABI? We shouldn't wire this up for non-EABI binaries,
because the syscall number won't be in r7.
> @@ -2808,7 +2808,16 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
> else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */
> {
> unsigned long cond = bits (inst1, 8, 11);
> - if (cond != 0x0f && condition_true (cond, status)) /* 0x0f = SWI */
> + if (cond == 0x0f) /* 0x0f = SWI */
Why did you remove the condition_true check?
> + {
> + struct gdbarch_tdep *tdep;
> + tdep = gdbarch_tdep (get_frame_arch (frame));
You can just use gdbarch_tdep (gdbarch).
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2010-08-25 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-24 6:39 Yao Qi
2010-08-24 11:28 ` Mark Kettenis
2010-08-24 14:13 ` Daniel Jacobowitz
2010-08-25 3:06 ` Yao Qi
2010-08-25 14:31 ` Daniel Jacobowitz [this message]
2010-08-26 8:51 ` Yao Qi
2010-08-30 13:00 ` Daniel Jacobowitz
2010-08-30 13:08 ` Mark Kettenis
2010-08-30 15:35 ` 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=20100825143137.GG28036@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).