From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24868 invoked by alias); 28 Feb 2011 17:37:18 -0000 Received: (qmail 24821 invoked by uid 22791); 28 Feb 2011 17:37:17 -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; Mon, 28 Feb 2011 17:37:12 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p1SHb9Ao006329 for ; Mon, 28 Feb 2011 17:37:09 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1SHbJIR1855656 for ; Mon, 28 Feb 2011 17:37:19 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 p1SHakjC004777 for ; Mon, 28 Feb 2011 10:36:46 -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 p1SHajew004773; Mon, 28 Feb 2011 10:36:45 -0700 Message-Id: <201102281736.p1SHajew004773@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 28 Feb 2011 18:36:45 +0100 Subject: Re: Displaced stepping 0002: refactor and create some copy helpers To: yao@codesourcery.com (Yao Qi) Date: Mon, 28 Feb 2011 17:53:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <4D692067.9020307@codesourcery.com> from "Yao Qi" at Feb 26, 2011 11:46:47 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/msg00916.txt.bz2 Yao Qi wrote: > The patch continues to refactor code, in order to > 1) make copy functions separated for ARM and Thumb, I think it makes sense to split the copy functions into the part that actually decodes the instruction and installs the target instruction (which depends on ARM vs. Thumb), and the part that sets up registers and installs the cleanup etc. (which only depends on the semantics of the instruction, not its encoding). For symmetry, I'd then prefer if *all* copy functions were split up that way (in the end, you'll probably need all of them anyway, since just about all ARM instructions have an alternate encoding as Thumb/Thumb-2). > 2) define some copy helper functions for some ARM and Thumb-2 instructions. These look really awkward to me, what with the union and all those function pointers ... It seems preferable to me to keep instruction decoding between ARM and Thumb fully separate, even if this means we have a small amount of duplication. > -copy_unmodified (struct gdbarch *gdbarch, uint32_t insn, > - const char *iname, struct displaced_step_closure *dsc) > +arm_copy_unmodified (uint32_t insn, const char *iname, > + struct displaced_step_closure *dsc) Again for symmetry reasons, it's probably better if *all* copy_ functions get the gdbarch, even if they currently don't need it. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com