From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17973 invoked by alias); 23 Dec 2010 03:37:37 -0000 Received: (qmail 17964 invoked by uid 22791); 23 Dec 2010 03:37: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; Thu, 23 Dec 2010 03:37:32 +0000 Received: (qmail 25350 invoked from network); 23 Dec 2010 03:37:30 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Dec 2010 03:37:30 -0000 Message-ID: <4D12C3F4.8080301@codesourcery.com> Date: Thu, 23 Dec 2010 04:10: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: <201012222202.oBMM22Lg020960@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201012222202.oBMM22Lg020960@d06av02.portsmouth.uk.ibm.com> Content-Type: multipart/mixed; boundary="------------070502070409070005000307" 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/msg00421.txt.bz2 This is a multi-part message in MIME format. --------------070502070409070005000307 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 1611 On 12/23/2010 06:02 AM, Ulrich Weigand wrote: > Yao Qi wrote: > >> 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. > > Huh, I didn't even see this, I was refering to this line: > { "fp", 11 }, > in arm_register_aliases. As long as this line is there, changes to > set_gdbarch_deprecated_fp_regnum probably don't matter as this isn't > even evaluated, since "fp" is just treated as a user register instead > of a standard register. > Ulrich, changes to set_gdbarch_deprecated_fp_regnum matters here. There are two "fp", "pc" and "sp" in user registers. The first one is added from builtin_user_regs (fp, pc, sp, ps) in user_regs_init, and the second one is added from `arm_register_aliases' in our case. The first one is always used, so these three in arm_register_aliases are redundant. { "fp", 11 }, { "sp", 13 }, { "pc", 15 }, How about this patch to remove them? > But you're right that you need to remove the set_gdbarch_deprecated_fp_regnum > *also* in order to get the full default logic I had described. > Regression test is done. Two failures are fixed. FAIL: gdb.mi/mi-var-display.exp: create variable a2 in different scope FAIL: gdb.mi/mi2-var-display.exp: create variable a2 in different scope Committed. -- Yao (齐尧) --------------070502070409070005000307 Content-Type: text/x-patch; name="remove_arm_sp_fp_pc_alias.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remove_arm_sp_fp_pc_alias.patch" Content-length: 530 2010-12-23 Yao Qi arm-tdep.c: (arm_register_aliases): Remove sp, pc, and fp diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 636c1de..11c75cd 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -175,12 +175,9 @@ static const struct { "tr", 9 }, /* Special names. */ { "ip", 12 }, - { "sp", 13 }, { "lr", 14 }, - { "pc", 15 }, /* Names used by GCC (not listed in the ARM EABI). */ { "sl", 10 }, - { "fp", 11 }, /* A special name from the older ATPCS. */ { "wr", 7 }, }; --------------070502070409070005000307--