Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [02/15] Add gdbarch to register_name callback in target-descriptions.c
Date: Wed, 31 Oct 2007 10:47:00 -0000	[thread overview]
Message-ID: <47285CCF.3040409@de.ibm.com> (raw)

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

Hi,

this patch adds gdbarch to register_name callback

Is this ok to commit?

ChangeLog: 

	* target-descriptions.c (tdesc_register_name): Add gdbarch parameter.
	(tdesc_register_name): Replace current_gdbarch by gdbarch.
	* target-descriptions.h (tdesc_register_name): Add gdbarch parameter.



-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com







[-- Attachment #2: diff-target-description --]
[-- Type: text/plain, Size: 1949 bytes --]

diff -urpN src/gdb/target-descriptions.c dev/gdb/target-descriptions.c
--- src/gdb/target-descriptions.c	2007-10-15 21:45:30.000000000 +0200
+++ dev/gdb/target-descriptions.c	2007-10-30 11:21:46.000000000 +0100
@@ -507,21 +507,20 @@ tdesc_find_register (struct gdbarch *gdb
    from an architecture-provided pseudo_register_name method.  */
 
 const char *
-tdesc_register_name (int regno)
+tdesc_register_name (struct gdbarch *gdbarch, int regno)
 {
-  struct tdesc_reg *reg = tdesc_find_register (current_gdbarch, regno);
-  int num_regs = gdbarch_num_regs (current_gdbarch);
-  int num_pseudo_regs = gdbarch_num_pseudo_regs (current_gdbarch);
+  struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno);
+  int num_regs = gdbarch_num_regs (gdbarch);
+  int num_pseudo_regs = gdbarch_num_pseudo_regs (gdbarch);
 
   if (reg != NULL)
     return reg->name;
 
   if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
     {
-      struct tdesc_arch_data *data = gdbarch_data (current_gdbarch,
-						   tdesc_data);
+      struct tdesc_arch_data *data = gdbarch_data (gdbarch, tdesc_data);
       gdb_assert (data->pseudo_register_name != NULL);
-      return data->pseudo_register_name (regno);
+      return data->pseudo_register_name (gdbarch, regno);
     }
 
   return "";
diff -urpN src/gdb/target-descriptions.h dev/gdb/target-descriptions.h
--- src/gdb/target-descriptions.h	2007-10-15 21:45:30.000000000 +0200
+++ dev/gdb/target-descriptions.h	2007-10-30 11:16:16.000000000 +0100
@@ -152,7 +152,7 @@ struct type *tdesc_named_type (const str
 /* Return the name of register REGNO, from the target description or
    from an architecture-provided pseudo_register_name method.  */
 
-const char *tdesc_register_name (int regno);
+const char *tdesc_register_name (struct gdbarch *gdbarch, int regno);
 
 /* Check whether REGNUM is a member of REGGROUP using the target
    description.  Return -1 if the target description does not


                 reply	other threads:[~2007-10-31 10:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=47285CCF.3040409@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /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