From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24338 invoked by alias); 24 Aug 2010 06:39:08 -0000 Received: (qmail 24328 invoked by uid 22791); 24 Aug 2010 06:39:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_XT,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Aug 2010 06:39:00 +0000 Received: (qmail 31327 invoked from network); 24 Aug 2010 06:38:58 -0000 Received: from unknown (HELO codesourcery.com) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Aug 2010 06:38:58 -0000 Date: Tue, 24 Aug 2010 06:39:00 -0000 From: Yao Qi To: gdb-patches@sourceware.org Subject: [Patch,ARM] Next pc of sigreturn/rt_sigreturn syscall Message-ID: <20100824063854.GA29794@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00405.txt.bz2 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1032 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 --UugvWAfsgieZRqgk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="nextpc_of_svc.patch" Content-length: 733 2010-08-24 Yao Qi *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: --UugvWAfsgieZRqgk--