From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27157 invoked by alias); 25 Aug 2010 14:31:47 -0000 Received: (qmail 27149 invoked by uid 22791); 25 Aug 2010 14:31:46 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,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; Wed, 25 Aug 2010 14:31:42 +0000 Received: (qmail 32435 invoked from network); 25 Aug 2010 14:31:40 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Aug 2010 14:31:40 -0000 Date: Wed, 25 Aug 2010 14:31:00 -0000 From: Daniel Jacobowitz To: Yao Qi Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: [Patch,ARM] Next pc of sigreturn/rt_sigreturn syscall Message-ID: <20100825143137.GG28036@caradoc.them.org> References: <20100824063854.GA29794@codesourcery.com> <201008241127.o7OBR38E024928@glazunov.sibelius.xs4all.nl> <20100824141253.GA13547@caradoc.them.org> <20100825030554.GC29794@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100825030554.GC29794@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00431.txt.bz2 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