From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21089 invoked by alias); 22 Dec 2010 16:34:39 -0000 Received: (qmail 20843 invoked by uid 22791); 22 Dec 2010 16:34:36 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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, 22 Dec 2010 16:34:30 +0000 Received: (qmail 27395 invoked from network); 22 Dec 2010 16:34:28 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Dec 2010 16:34:28 -0000 Message-ID: <4D12288E.6030109@codesourcery.com> Date: Wed, 22 Dec 2010 17:44:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [patch 2/2] Implement gdbarch hook user_register_name on ARM References: <201012211907.oBLJ7kiR011849@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201012211907.oBLJ7kiR011849@d06av02.portsmouth.uk.ibm.com> Content-Type: multipart/mixed; boundary="------------060807070204060905030301" 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-12/txt/msg00405.txt.bz2 This is a multi-part message in MIME format. --------------060807070204060905030301 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 1395 On 12/22/2010 03:07 AM, Ulrich Weigand wrote: > Yao Qi wrote: >> On 12/15/2010 06:22 PM, Yao Qi wrote: >>> Once this patch is applied, we leave more flexibility to backend to >>> determine what is the correct register number given a register alias. >> >> This patch is to implement user_register_name on ARM. With this, we can >> handle alias "fp" according to the current frame's mode (ARM or Thumb). >> >> Regression testing is still running on ARM. Comments are welcome. > > I'm wondering why the ARM back-end actively defines "fp" as user register > anyway. If it simply were to *not* do so, GDB would fall back to the > default implementation of $fp using value_of_builtin_frame_fp_reg, which > seems to do always the correct thing anyway. It returns the value of the > frame base as returned by arm_normal_frame_base, which will have been > determined from r11 or r7 as appropriate for the mode. Good catch! set_gdbarch_deprecated_fp_regnum is called in arm_gdbarch_init since 2003, introduced by this patch "Deprecate TARGET_READ_FP, read_fp and FP_REGNUM" http://sourceware.org/ml/gdb-patches/2003-04/msg00471.html set_gdbarch_deprecated_fp_regnum is no longer used in most of targets, and I don't see any reason why we have to keep it in ARM, so I draft this one-line patch. Any comments/objections to this one-line patch? [Regression test is still running.] -- Yao (齐尧) --------------060807070204060905030301 Content-Type: text/x-patch; name="remove_deprecated_fp_regnum.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remove_deprecated_fp_regnum.patch" Content-length: 612 gdb/ * arm-tdep.c (arm_gdbarch_init): Remove invoke to set_gdbarch_deprecated_fp_regnum. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 636c1de..1f112ee 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -7457,7 +7457,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) arm_remote_breakpoint_from_pc); /* Information about registers, etc. */ - set_gdbarch_deprecated_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */ set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM); set_gdbarch_num_regs (gdbarch, ARM_NUM_REGS); --------------060807070204060905030301--