From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20188 invoked by alias); 15 Feb 2011 21:07:58 -0000 Received: (qmail 20178 invoked by uid 22791); 15 Feb 2011 21:07:57 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate3.uk.ibm.com (HELO mtagate3.uk.ibm.com) (194.196.100.163) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Feb 2011 21:07:52 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p1FL7nXu001893 for ; Tue, 15 Feb 2011 21:07:49 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1FL7tdo1794160 for ; Tue, 15 Feb 2011 21:07:55 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1FL7ncL019604 for ; Tue, 15 Feb 2011 14:07:49 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p1FL7lt5019595; Tue, 15 Feb 2011 14:07:48 -0700 Message-Id: <201102152107.p1FL7lt5019595@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 15 Feb 2011 22:07:47 +0100 Subject: Re: [try 3rd] arm_pc_is_thumb takes displaced stepping into account To: yao@codesourcery.com (Yao Qi) Date: Tue, 15 Feb 2011 21:15:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <4D5388D6.2050901@codesourcery.com> from "Yao Qi" at Feb 10, 2011 02:42:30 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2011-02/txt/msg00343.txt.bz2 Yao Qi wrote: > On 01/31/2011 11:38 PM, Ulrich Weigand wrote: > > What if the copy area contains more than a single instruction, and we > > need to find out the mode of the PC corresponding to the second of them? > > > > This approach can handle multiple instructions in copy area, because > during preparation of displaced stepping (in displaced_step_prepare), > regcache_write_pc is called to update PC to the *address of copy area*, > no matter how many instructions in copy area. > > Per my limited knowledge on GDB, I can't find a case that PC is set > somewhere of copy area other than the beginning of copy area during > displaced stepping. That is to say, we don't have to know the mode of > the 2nd instruction. Hmm, I guess you're right ... GDB does "hide" the fact that it has replaced the original instruction, and you should never end up in the middle of a displaced stepping sequence. The patch is OK, except for a couple of formatting issues: + struct displaced_step_closure* dsc + = get_displaced_step_closure_by_addr(memaddr); Please use struct displaced_step_closure *dsc (i.e. the * next to the variable, not the type). +struct displaced_step_closure* +get_displaced_step_closure_by_addr (CORE_ADDR addr); Here as well, there should be a space between the type and the *. Also, please do not start the function name on the next line in the header file; "grep ^get_displaced_step_closure_by_addr *" should find only the definition, not the declaration. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com