Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [Patch,ARM] Next pc of sigreturn/rt_sigreturn syscall
Date: Tue, 24 Aug 2010 06:39:00 -0000	[thread overview]
Message-ID: <20100824063854.GA29794@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]

Hi,
This patch is to calculate correct address of 'next pc' of syscall
sigreturn and rt_sigreturn.

Tested on armv7l-unknown-linux-gnueabi, and a diff of test summary is
shown below:

-FAIL: gdb.base/sigstep.exp: step from handler; leave handler(timeout)
+PASS: gdb.base/sigstep.exp: step from handler; leave handler
-FAIL: gdb.base/sigstep.exp: stepi from handleri; leave signal trampoline
+PASS: gdb.base/sigstep.exp: stepi from handleri; leave signal trampoline (in main)
-FAIL: gdb.base/sigstep.exp: next from handler; leave handler (timeout)
+PASS: gdb.base/sigstep.exp: next from handler; leave handler
-FAIL: gdb.base/sigstep.exp: nexti from handleri; leave signal trampoline
+PASS: gdb.base/sigstep.exp: nexti from handleri; leave signal trampoline (in main)

                === gdb Summary ===

-# of expected passes           14664
-# of unexpected failures       314
+# of expected passes           14669
+# of unexpected failures       310

Is that OK?

-- 
Yao Qi
CodeSourcery
yao@codesourcery.com
(650) 331-3385 x739

[-- Attachment #2: nextpc_of_svc.patch --]
[-- Type: text/x-diff, Size: 733 bytes --]

2010-08-24  Yao Qi  <yao@codesourcery.com>

	*arm-tdep.c (arm_get_next_pc_raw): Calculate next pc of sigreturn or
	rt_sigreturn syscall.

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 1ac8817..978bb72 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3257,7 +3257,18 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
 	case 0xc:
 	case 0xd:
 	case 0xe:		/* coproc ops */
+	  break;
 	case 0xf:		/* SWI */
+	  {
+	    unsigned long svc_number = get_frame_register_unsigned (frame, 7);
+
+	    if (svc_number == 119 || svc_number == 173)
+	      {   
+		if (get_frame_type (frame) == SIGTRAMP_FRAME)
+		  {
+		    nextpc = frame_unwind_caller_pc (frame);
+		  }
+	      }
 	  break;
 
 	default:

             reply	other threads:[~2010-08-24  6:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  6:39 Yao Qi [this message]
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
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=20100824063854.GA29794@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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