This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Mon, 05 Nov 2007 13:21:33 +0100
- Subject: [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
Hi,
this patch replaces AM33 macro from n10300 target and then replaces current_gdbarch
by appropriate methods.
Tested building with --target=mn10300. Ok to commit?
ChangeLog:
* mn10300-tdep.c (set_reg_offsets,mn10300_analyze_prologue): Replace
AM33 by its expression. Use get_frame_arch to get at the current
architecture by frame_info.
* mn10300-tdep.h (AM33_MODE): Remove.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urpN src/gdb/mn10300-tdep.c dev2/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c 2007-11-05 05:32:22.000000000 +0100
+++ dev2/gdb/mn10300-tdep.c 2007-11-05 09:10:03.000000000 +0100
@@ -328,7 +328,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_this_base (cache, base);
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode == 2)
{
/* If bit N is set in fpregmask, fsN is saved on the stack.
The floating point registers are saved in ascending order.
@@ -384,7 +384,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_reg_addr (cache, E_D2_REGNUM, base + offset);
offset += 4;
}
- if (AM33_MODE)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode)
{
if (movm_args & movm_exother_bit)
{
@@ -603,7 +603,7 @@ mn10300_analyze_prologue (struct frame_i
goto finish_prologue;
}
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode == 2)
{
/* Determine if any floating point registers are to be saved.
Look for one of the following three prologue formats:
diff -urpN src/gdb/mn10300-tdep.h dev2/gdb/mn10300-tdep.h
--- src/gdb/mn10300-tdep.h 2007-08-23 20:08:36.000000000 +0200
+++ dev2/gdb/mn10300-tdep.h 2007-11-05 09:10:12.000000000 +0100
@@ -77,4 +77,3 @@ struct gdbarch_tdep
int am33_mode;
};
-#define AM33_MODE (gdbarch_tdep (current_gdbarch)->am33_mode)