2007-06-13 Markus Deuling <deuling@de.ibm.com>
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 13 Jun 2007 17:53:51 +0000 (17:53 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 13 Jun 2007 17:53:51 +0000 (17:53 +0000)
* 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.

gdb/ChangeLog
gdb/arch-utils.c
gdb/gcore.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/m68hc11-tdep.c
gdb/nto-procfs.c
gdb/nto-tdep.c
gdb/remote-mips.c

index 818f772d4464313174112059a7912de6a82df663..f642adb18da751b5497667d1d24e66df6aad2e20 100644 (file)
@@ -1,3 +1,15 @@
+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.
index f0bc5bb1dab72014df5a5c076b1e3466f2f7dc6a..4a46e3535db05de767413ce2c9d5a672247c4ffd 100644 (file)
@@ -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);
index 21280bba9f768b424b2abd4250a71dfd79a37cd3..3ab9f9615d4ca5f9a8164044cdf0d247baf75e54 100644 (file)
@@ -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)."));
 
index c1b705e67d2a331ad1ff7e70c327cb92865ff1b3..8ea41b1f186bbc951b5aba7120221eb6c0b51bbb 100644 (file)
@@ -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));
index e5fcc7bce995776e6db42a50e23c4504a02c006e..ff52b36f6e0ed7ede1bc94915830e809dcc8be89 100644 (file)
@@ -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. */
index 58d7d2e25122b371877f4a49a81eb4d180935e83..2c90ca18b485fab00390c08456eabfbc0ff6f650 100755 (executable)
@@ -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
index 0e8c51215183c498486af3ded8f0588b4de9f87e..dce1df2248d94793c20b126a87113334c1010df5 100644 (file)
@@ -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);
index 57bfd87597a1147c4d2bf35057146a93f8021fd9..7239fdb89f1b5e0b3ec15d2a8f41fed7a0c78feb 100644 (file)
@@ -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."));
index 1949f6f578957709841bc4d7f54cc862483598a2..c7fd01751827ec8257d39651afa450bac3af5870 100644 (file)
@@ -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";
     }
index c01cae0eefa3459d3e7a74b5bd2d6ba19ac5b411..a5f3cbf94a6431ff8309f0d30ed5ab7d0eb859e2 100644 (file)
@@ -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: