aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/arch-utils.c2
-rw-r--r--gdb/gcore.c10
-rw-r--r--gdb/gdbarch.c9
-rw-r--r--gdb/gdbarch.h6
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/m68hc11-tdep.c2
-rw-r--r--gdb/nto-procfs.c3
-rw-r--r--gdb/nto-tdep.c20
-rw-r--r--gdb/remote-mips.c6
10 files changed, 39 insertions, 35 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 818f772..f642adb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
2007-06-13 Markus Deuling <deuling@de.ibm.com>
+ * gdbarch.sh (TARGET_ARCHITECTURE): Replace by gdbarch_bfd_arch_info.
+ * arch-utils.c (show_architecture): Likewise.
+ * remote-mips.c (mips_open): Likewise
+ * nto-tdep.c (nto_find_and_open_solib)
+ (nto_init_solib_absolute_prefix): Likewise.
+ * nto-procfs (procfs_open): Likewise.
+ * m68hc11-tdep.c (gdb_print_insn_m68hc11): Likewise.
+ * gcore.c (default_gcore_mach, default_gcore_arch): Likewise.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+2007-06-13 Markus Deuling <deuling@de.ibm.com>
+
* gdbarch.sh (TARGET_BFD_VMA_BIT): Replace by gdbarch_bfd_vma_bit.
* gdbtypes.c (build_flt): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index f0bc5bb..4a46e35 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -404,7 +404,7 @@ show_architecture (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
const char *arch;
- arch = TARGET_ARCHITECTURE->printable_name;
+ arch = gdbarch_bfd_arch_info (current_gdbarch)->printable_name;
if (target_architecture_user == NULL)
fprintf_filtered (file, _("\
The target architecture is set automatically (currently %s)\n"), arch);
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 21280bb..3ab9f96 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -125,12 +125,11 @@ default_gcore_mach (void)
#if 1 /* See if this even matters... */
return 0;
#else
-#ifdef TARGET_ARCHITECTURE
- const struct bfd_arch_info *bfdarch = TARGET_ARCHITECTURE;
+
+ const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (current_gdbarch);
if (bfdarch != NULL)
return bfdarch->mach;
-#endif /* TARGET_ARCHITECTURE */
if (exec_bfd == NULL)
error (_("Can't find default bfd machine type (need execfile)."));
@@ -141,12 +140,11 @@ default_gcore_mach (void)
static enum bfd_architecture
default_gcore_arch (void)
{
-#ifdef TARGET_ARCHITECTURE
- const struct bfd_arch_info * bfdarch = TARGET_ARCHITECTURE;
+ const struct bfd_arch_info * bfdarch = gdbarch_bfd_arch_info
+ (current_gdbarch);
if (bfdarch != NULL)
return bfdarch->arch;
-#endif
if (exec_bfd == NULL)
error (_("Can't find bfd architecture for corefile (need execfile)."));
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index c1b705e..8ea41b1 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -404,7 +404,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
current_gdbarch->ptr_bit = current_gdbarch->int_bit;
- current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+ current_gdbarch->bfd_vma_bit = gdbarch_bfd_arch_info (current_gdbarch)->bits_per_address;
current_gdbarch->char_signed = -1;
current_gdbarch->write_pc = generic_target_write_pc;
current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
@@ -696,14 +696,9 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: believe_pcc_promotion = %s\n",
paddr_d (current_gdbarch->believe_pcc_promotion));
-#ifdef TARGET_ARCHITECTURE
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
- XSTRING (TARGET_ARCHITECTURE));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: bfd_arch_info = %s\n",
- TARGET_ARCHITECTURE->printable_name);
+ gdbarch_bfd_arch_info (current_gdbarch)->printable_name);
fprintf_unfiltered (file,
"gdbarch_dump: bfd_vma_bit = %s\n",
paddr_d (current_gdbarch->bfd_vma_bit));
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index e5fcc7b..ff52b36 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -60,12 +60,6 @@ extern struct gdbarch *current_gdbarch;
extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
-#if !defined (GDB_TM_FILE) && defined (TARGET_ARCHITECTURE)
-#error "Non multi-arch definition of TARGET_ARCHITECTURE"
-#endif
-#if !defined (TARGET_ARCHITECTURE)
-#define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
-#endif
extern int gdbarch_byte_order (struct gdbarch *gdbarch);
/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 58d7d2e..2c90ca1 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -367,7 +367,7 @@ function_list ()
{
# See below (DOCO) for description of each field
cat <<EOF
-i:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::TARGET_ARCHITECTURE->printable_name
+i::const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::gdbarch_bfd_arch_info (current_gdbarch)->printable_name
#
i::int:byte_order:::BFD_ENDIAN_BIG
#
@@ -415,7 +415,7 @@ v::int:ptr_bit:::8 * sizeof (void*):current_gdbarch->int_bit::0
# addr_bit is the size of a target address as represented in gdb
v:TARGET_ADDR_BIT:int:addr_bit:::8 * sizeof (void*):0:gdbarch_ptr_bit (current_gdbarch):
# Number of bits in a BFD_VMA for the target object file format.
-v::int:bfd_vma_bit:::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
+v::int:bfd_vma_bit:::8 * sizeof (void*):gdbarch_bfd_arch_info (current_gdbarch)->bits_per_address::0
#
# One if \`char' acts like \`signed char', zero if \`unsigned char'.
v::int:char_signed:::1:-1:1
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 0e8c512..dce1df2 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1350,7 +1350,7 @@ m68hc11_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
static int
gdb_print_insn_m68hc11 (bfd_vma memaddr, disassemble_info *info)
{
- if (TARGET_ARCHITECTURE->arch == bfd_arch_m68hc11)
+ if (gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_m68hc11)
return print_insn_m68hc11 (memaddr, info);
else
return print_insn_m68hc12 (memaddr, info);
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 57bfd87..7239fdb 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -203,7 +203,8 @@ procfs_open (char *arg, int from_tty)
else
{
if (sysinfo->type !=
- nto_map_arch_to_cputype (TARGET_ARCHITECTURE->arch_name))
+ nto_map_arch_to_cputype (gdbarch_bfd_arch_info
+ (current_gdbarch)->arch_name))
{
close (fd);
error (_("Invalid target CPU."));
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 1949f6f..c7fd017 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -108,20 +108,22 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
#define PATH_FMT "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0
- || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0)
+ else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "rs6000") == 0
+ || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "powerpc") == 0)
{
arch = "ppc";
endian = "be";
}
else
{
- arch = TARGET_ARCHITECTURE->arch_name;
+ arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
endian = gdbarch_byte_order (current_gdbarch)
== BFD_ENDIAN_BIG ? "be" : "le";
}
@@ -168,20 +170,22 @@ nto_init_solib_absolute_prefix (void)
const char *arch;
nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0
- || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0)
+ else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "rs6000") == 0
+ || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "powerpc") == 0)
{
arch = "ppc";
endian = "be";
}
else
{
- arch = TARGET_ARCHITECTURE->arch_name;
+ arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
endian = gdbarch_byte_order (current_gdbarch)
== BFD_ENDIAN_BIG ? "be" : "le";
}
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index c01cae0..a5f3cbf 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1594,10 +1594,10 @@ static void
mips_open (char *name, int from_tty)
{
const char *monitor_prompt = NULL;
- if (TARGET_ARCHITECTURE != NULL
- && TARGET_ARCHITECTURE->arch == bfd_arch_mips)
+ if (gdbarch_bfd_arch_info (current_gdbarch) != NULL
+ && gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_mips)
{
- switch (TARGET_ARCHITECTURE->mach)
+ switch (gdbarch_bfd_arch_info (current_gdbarch)->mach)
{
case bfd_mach_mips4100:
case bfd_mach_mips4300: