* 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_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.
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);
#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)."));
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)."));
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;
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));
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. */
{
# 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
#
# 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
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);
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."));
#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";
}
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";
}
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: