From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30687 invoked by alias); 15 Apr 2013 12:50:27 -0000 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 Received: (qmail 30678 invoked by uid 89); 15 Apr 2013 12:50:26 -0000 X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_EG autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 15 Apr 2013 12:50:26 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9A9C52E3BE; Mon, 15 Apr 2013 08:50:24 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iNa4kopokEiz; Mon, 15 Apr 2013 08:50:24 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6A07E2E2BE; Mon, 15 Apr 2013 08:50:24 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 225B6C2B74; Mon, 15 Apr 2013 05:50:22 -0700 (PDT) Date: Mon, 15 Apr 2013 16:36:00 -0000 From: Joel Brobecker To: marcus.shawcroft@arm.com, yufeng.zhang@arm.com Cc: gdb-patches@sourceware.org Subject: unnecessary aarch64_write_pc ? Message-ID: <20130415125021.GB3525@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-04/txt/msg00420.txt.bz2 Hello, I noticed the following code: > /* Implement the "write_pc" gdbarch method. */ > > static void > aarch64_write_pc (struct regcache *regcache, CORE_ADDR pc) > { > regcache_cooked_write_unsigned (regcache, AARCH64_PC_REGNUM, pc); > } But looking at the only use of the gdbarch_write_pc function, I see: > void > regcache_write_pc (struct regcache *regcache, CORE_ADDR pc) > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > > if (gdbarch_write_pc_p (gdbarch)) > gdbarch_write_pc (gdbarch, regcache, pc); > else if (gdbarch_pc_regnum (gdbarch) >= 0) > regcache_cooked_write_unsigned (regcache, > gdbarch_pc_regnum (gdbarch), pc); > else > internal_error (__FILE__, __LINE__, > _("regcache_write_pc: Unable to update PC")); > > /* Writing the PC (for instance, from "load") invalidates the > current frame. */ > reinit_frame_cache (); > } And gdbarch_pc_regnum is AARCH64_PC_REGNUM. So it looks like we shouldn't need aarch64_write_pc? I am reviewing the other definitions, and so far, they do seem to be necessary. -- Joel