[Patch,ARM] Next pc of sigreturn/rt_sigreturn syscall

Yao Qi
2010-08-24T06:39:08Z

[-- 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;