Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [14/15] Add gdbarch to register_name callback in frv-tdep.c
@ 2007-10-31 10:48 Markus Deuling
  0 siblings, 0 replies; only message in thread
From: Markus Deuling @ 2007-10-31 10:48 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

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

Hi,

this patch adds gdbarch to register_name callback in frv-tdep.c.
The macro CURRENT_VARIANT included current_gdbarch. This patch replaces its occurences by its expression and then
replaces current_gdbarch.

Is this ok to commit?

ChangeLog: 


	* frv-tdep.c (frv_register_name): Add gdbarch parameter. Replace
	current_gdbarch by gdbarch.
	(frv_register_name, frv_check_watch_resources): Replace macro
	CURRENT_VARIANT by its expression.
	(CURRENT_VARIANT): Remove.

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






[-- Attachment #2: diff-frv-tdep --]
[-- Type: text/plain, Size: 1104 bytes --]

diff -urpN src/gdb/frv-tdep.c dev/gdb/frv-tdep.c
--- src/gdb/frv-tdep.c	2007-10-24 23:08:23.000000000 +0200
+++ dev/gdb/frv-tdep.c	2007-10-31 06:57:30.000000000 +0100
@@ -91,7 +91,6 @@ struct gdbarch_tdep
   char **register_names;
 };
 
-#define CURRENT_VARIANT (gdbarch_tdep (current_gdbarch))
 
 /* Return the FR-V ABI associated with GDBARCH.  */
 enum frv_abi
@@ -278,14 +277,14 @@ set_variant_scratch_registers (struct gd
 }
 
 static const char *
-frv_register_name (int reg)
+frv_register_name (struct gdbarch *gdbarch, int reg)
 {
   if (reg < 0)
     return "?toosmall?";
   if (reg >= frv_num_regs + frv_num_pseudo_regs)
     return "?toolarge?";
 
-  return CURRENT_VARIANT->register_names[reg];
+  return gdbarch_tdep (gdbarch)->register_names[reg];
 }
 
 
@@ -1282,7 +1281,7 @@ frv_return_value (struct gdbarch *gdbarc
 int
 frv_check_watch_resources (int type, int cnt, int ot)
 {
-  struct gdbarch_tdep *var = CURRENT_VARIANT;
+  struct gdbarch_tdep *var = gdbarch_tdep (current_gdbarch);
 
   /* Watchpoints not supported on simulator.  */
   if (strcmp (target_shortname, "sim") == 0)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-31 10:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-31 10:48 [rfc] [14/15] Add gdbarch to register_name callback in frv-tdep.c Markus Deuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox