Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [patch 2/2] Implement gdbarch hook user_register_name on ARM
Date: Wed, 22 Dec 2010 17:44:00 -0000	[thread overview]
Message-ID: <4D12288E.6030109@codesourcery.com> (raw)
In-Reply-To: <201012211907.oBLJ7kiR011849@d06av02.portsmouth.uk.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

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 (齐尧)

[-- Attachment #2: remove_deprecated_fp_regnum.patch --]
[-- Type: text/x-patch, Size: 612 bytes --]

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);

  reply	other threads:[~2010-12-22 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 10:22 [patch 1/2] New gdbarch hook user_register_name Yao Qi
2010-12-15 10:48 ` [patch 2/2] Implement gdbarch hook user_register_name on ARM Yao Qi
2010-12-21 19:07   ` Ulrich Weigand
2010-12-22 17:44     ` Yao Qi [this message]
2010-12-22 18:12       ` Mark Kettenis
2010-12-23  7:19         ` Yao Qi
2010-12-23  1:54       ` Ulrich Weigand
2010-12-23  4:10         ` Yao Qi
2010-12-23 18:37           ` Ulrich Weigand
2010-12-24  5:16             ` Yao Qi
2010-12-28 14:52               ` Ulrich Weigand
2010-12-22 17:54   ` Richard Earnshaw
2010-12-23  2:05     ` Ulrich Weigand
2010-12-23  3:37       ` Joel Brobecker
2010-12-23 12:08         ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D12288E.6030109@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox