]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch)
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 11 Sep 2008 14:23:15 +0000 (14:23 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Thu, 11 Sep 2008 14:23:15 +0000 (14:23 +0000)
instead of builtin_type_ macros.
* amd64-tdep.c (amd64_register_type): Likewise.
(amd64_get_longjmp_target): Likewise.
* arm-tdep.c (arm_register_type): Likewise.
* avr-tdep.c (avr_register_type): Likewise.
* cris-tdep.c (cris_register_type, crisv32_register_type): Likewise.
* frv-tdep.c (frv_register_type): Likewise.
* h8300-tdep.c (h8300_register_type): Likewise.
* hppa-tdep.c (hppa32_convert_from_func_ptr_addr,
hppa_skip_trampoline_code): Likewise.
* i386-tdep.c (i386_register_type): Likewise.
(i386_unwind_pc, i386_sse_type): Likewise.
* ia64-tdep.c (ia64_register_type): Likewise.
* m32r-tdep.c (m32r_register_type): Likewise.
* m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
* m88k-tdep.c (m88k_register_type): Likewise.
* mep-tdep.c (mep_register_type): Likewise.
* mips-tdep.c (mips_pseudo_register_type): Likewise.
* mn10300-tdep.c (mn10300_register_type): Likewise.
* mt-tdep.c (mt_copro_register_type): Likewise.
* rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise.
(rs6000_convert_register_p, rs6000_register_to_value,
rs6000_value_to_register): Likewise.
* s390-tdep.c (s390_register_type): Likewise.
* sh64-tdep.c (sh64_register_type): Likewise.
(sh64_build_float_register_type, sh64_do_fp_register): Likewise.
* sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type,
sh_sh4_build_float_register_type, sh_sh4_register_type,
sh_default_register_type): Likewise.
* sparc64-tdep.c (sparc64_register_type): Likewise.
* sparc-tdep.c (sparc32_register_type): Likewise.
* spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise.
* v850-tdep.c (v850_register_type): Likewise.
* vax-tdep.c (vax_register_type): Likewise.
* xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc,
xtensa_push_dummy_call): Likewise.

* std-regs.c (value_of_builtin_frame_fp_reg,
value_of_builtin_frame_pc_reg): Likewise.
* target-descriptions.c (tdesc_register_type): Likewise.

30 files changed:
gdb/ChangeLog
gdb/alpha-tdep.c
gdb/amd64-tdep.c
gdb/arm-tdep.c
gdb/avr-tdep.c
gdb/cris-tdep.c
gdb/frv-tdep.c
gdb/h8300-tdep.c
gdb/hppa-tdep.c
gdb/i386-tdep.c
gdb/ia64-tdep.c
gdb/m32r-tdep.c
gdb/m68k-tdep.c
gdb/m88k-tdep.c
gdb/mep-tdep.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/mt-tdep.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sh-tdep.c
gdb/sh64-tdep.c
gdb/sparc-tdep.c
gdb/sparc64-tdep.c
gdb/spu-tdep.c
gdb/std-regs.c
gdb/target-descriptions.c
gdb/v850-tdep.c
gdb/vax-tdep.c
gdb/xtensa-tdep.c

index 70b9ae94cd7c8b387ee3eab890dc9aa26424d9c2..23ebcebdcb0f1e636b1de671cf351987aa8e4bc9 100644 (file)
@@ -1,3 +1,47 @@
+2008-09-11  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch)
+       instead of builtin_type_ macros.
+       * amd64-tdep.c (amd64_register_type): Likewise.
+       (amd64_get_longjmp_target): Likewise.
+       * arm-tdep.c (arm_register_type): Likewise.
+       * avr-tdep.c (avr_register_type): Likewise.
+       * cris-tdep.c (cris_register_type, crisv32_register_type): Likewise.
+       * frv-tdep.c (frv_register_type): Likewise.
+       * h8300-tdep.c (h8300_register_type): Likewise.
+       * hppa-tdep.c (hppa32_convert_from_func_ptr_addr, 
+       hppa_skip_trampoline_code): Likewise.
+       * i386-tdep.c (i386_register_type): Likewise.
+       (i386_unwind_pc, i386_sse_type): Likewise.
+       * ia64-tdep.c (ia64_register_type): Likewise.
+       * m32r-tdep.c (m32r_register_type): Likewise.
+       * m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise.
+       * m88k-tdep.c (m88k_register_type): Likewise.
+       * mep-tdep.c (mep_register_type): Likewise.
+       * mips-tdep.c (mips_pseudo_register_type): Likewise.
+       * mn10300-tdep.c (mn10300_register_type): Likewise.
+       * mt-tdep.c (mt_copro_register_type): Likewise.
+       * rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise.
+       (rs6000_convert_register_p, rs6000_register_to_value,
+       rs6000_value_to_register): Likewise.
+       * s390-tdep.c (s390_register_type): Likewise.
+       * sh64-tdep.c (sh64_register_type): Likewise.
+       (sh64_build_float_register_type, sh64_do_fp_register): Likewise.
+       * sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type,
+       sh_sh4_build_float_register_type, sh_sh4_register_type,
+       sh_default_register_type): Likewise.
+       * sparc64-tdep.c (sparc64_register_type): Likewise.
+       * sparc-tdep.c (sparc32_register_type): Likewise.
+       * spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise.
+       * v850-tdep.c (v850_register_type): Likewise.
+       * vax-tdep.c (vax_register_type): Likewise.
+       * xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc,
+       xtensa_push_dummy_call): Likewise.
+
+       * std-regs.c (value_of_builtin_frame_fp_reg,
+       value_of_builtin_frame_pc_reg): Likewise.
+       * target-descriptions.c (tdesc_register_type): Likewise.
+
 2008-09-11  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * ada-lang.c (ada_coerce_to_simple_array_type): Use builtin_type_int32
index fe8671f3a5c7497f9b8b0aaa4b8edda1698b0f49..27137d90382b3e9212562b11b5ed147a9ee6bc35 100644 (file)
@@ -95,9 +95,9 @@ static struct type *
 alpha_register_type (struct gdbarch *gdbarch, int regno)
 {
   if (regno == ALPHA_SP_REGNUM || regno == ALPHA_GP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   if (regno == ALPHA_PC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
 
   /* Don't need to worry about little vs big endian until 
      some jerk tries to port to alpha-unicosmk.  */
index 75c99ab60b6cb951049730a9e29bf6125789b7c7..9b7c8a4c583076d268b793a7333e8689c94717fc 100644 (file)
@@ -90,11 +90,11 @@ amd64_register_type (struct gdbarch *gdbarch, int regnum)
   if (regnum >= AMD64_RAX_REGNUM && regnum <= AMD64_RDI_REGNUM)
     return builtin_type_int64;
   if (regnum == AMD64_RBP_REGNUM || regnum == AMD64_RSP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   if (regnum >= AMD64_R8_REGNUM && regnum <= AMD64_R15_REGNUM)
     return builtin_type_int64;
   if (regnum == AMD64_RIP_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   if (regnum == AMD64_EFLAGS_REGNUM)
     return i386_eflags_type;
   if (regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM)
@@ -1277,7 +1277,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
   CORE_ADDR jb_addr;
   struct gdbarch *gdbarch = get_frame_arch (frame);
   int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset;
-  int len = TYPE_LENGTH (builtin_type_void_func_ptr);
+  int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr);
 
   /* If JB_PC_OFFSET is -1, we have no way to find out where the
      longjmp will land.         */
@@ -1285,11 +1285,12 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
     return 0;
 
   get_frame_register (frame, AMD64_RDI_REGNUM, buf);
-  jb_addr = extract_typed_address (buf, builtin_type_void_data_ptr);
+  jb_addr= extract_typed_address
+           (buf, builtin_type (gdbarch)->builtin_data_ptr);
   if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
     return 0;
 
-  *pc = extract_typed_address (buf, builtin_type_void_func_ptr);
+  *pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
 
   return 1;
 }
index cb0eb1293890717968a1e9c80518e12bc94c319c..30799d3a183376a93752acba9f5d81d3f927c87d 100644 (file)
@@ -1605,9 +1605,9 @@ arm_register_type (struct gdbarch *gdbarch, int regnum)
   if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS)
     return builtin_type_arm_ext;
   else if (regnum == ARM_SP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else if (regnum == ARM_PC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   else if (regnum >= ARRAY_SIZE (arm_register_names))
     /* These registers are only supported on targets which supply
        an XML description.  */
index 85f3c0a580942c01cbd56e4749d9f017331135fd..fdcd5076a1e5304af1c2a9602c4d71efc96cb376 100644 (file)
@@ -213,7 +213,7 @@ avr_register_type (struct gdbarch *gdbarch, int reg_nr)
   if (reg_nr == AVR_PC_REGNUM)
     return builtin_type_uint32;
   if (reg_nr == AVR_SP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else
     return builtin_type_uint8;
 }
index 54816db04fba6f0f7c9a53279b31ad6e5cb3b891..dd78e9cdc21de43cf0091092dbcebddf875b6cc8 100644 (file)
@@ -1650,10 +1650,10 @@ static struct type *
 cris_register_type (struct gdbarch *gdbarch, int regno)
 {
   if (regno == gdbarch_pc_regnum (gdbarch))
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   else if (regno == gdbarch_sp_regnum (gdbarch)
           || regno == CRIS_FP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else if ((regno >= 0 && regno < gdbarch_sp_regnum (gdbarch))
           || (regno >= MOF_REGNUM && regno <= USP_REGNUM))
     /* Note: R8 taken care of previous clause.  */
@@ -1671,10 +1671,10 @@ static struct type *
 crisv32_register_type (struct gdbarch *gdbarch, int regno)
 {
   if (regno == gdbarch_pc_regnum (gdbarch))
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   else if (regno == gdbarch_sp_regnum (gdbarch)
           || regno == CRIS_FP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else if ((regno >= 0 && regno <= ACR_REGNUM)
           || (regno >= EXS_REGNUM && regno <= SPC_REGNUM)
           || (regno == PID_REGNUM)
index 7c7942015a62d984290d6ee0dc95a68f7bc37a01..bf8f015fbaadba9bc531f1f2ee2b12b0fdcd89c4 100644 (file)
@@ -292,7 +292,7 @@ static struct type *
 frv_register_type (struct gdbarch *gdbarch, int reg)
 {
   if (reg >= first_fpr_regnum && reg <= last_fpr_regnum)
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   else if (reg == iacc0_regnum)
     return builtin_type_int64;
   else
index 1d5255380212887497847ec7622dd264a5997fbf..aaf5694cd77e59c8878a708c14b6aca15da4601e 100644 (file)
@@ -1112,10 +1112,10 @@ h8300_register_type (struct gdbarch *gdbarch, int regno)
       switch (regno)
        {
        case E_PC_REGNUM:
-         return builtin_type_void_func_ptr;
+         return builtin_type (gdbarch)->builtin_func_ptr;
        case E_SP_REGNUM:
        case E_FP_REGNUM:
-         return builtin_type_void_data_ptr;
+         return builtin_type (gdbarch)->builtin_data_ptr;
        default:
          if (regno == E_PSEUDO_CCR_REGNUM (gdbarch))
            return builtin_type_uint8;
index 4b2ec571e353c73f59d8d3a007cdf6f3cd83a2a5..cd844e820d626f7c234caff0833bdd1d381d8d98 100644 (file)
@@ -1245,8 +1245,9 @@ hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
 {
   if (addr & 2)
     {
+      struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
       CORE_ADDR plabel = addr & ~3;
-      return read_memory_typed_address (plabel, builtin_type_void_func_ptr);
+      return read_memory_typed_address (plabel, func_ptr_type);
     }
 
   return addr;
@@ -2898,6 +2899,9 @@ hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name)
 CORE_ADDR
 hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
+
   unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
   int dp_rel;
 
@@ -2908,7 +2912,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 
       /* PLABELs have bit 30 set; if it's a PLABEL, then dereference it.  */
       if (pc & 0x2)
-       pc = read_memory_typed_address (pc & ~0x3, builtin_type_void_func_ptr);
+       pc = read_memory_typed_address (pc & ~0x3, func_ptr_type);
 
       return pc;
     }
@@ -2929,7 +2933,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 
   if (in_plt_section (pc, NULL))
     {
-      pc = read_memory_typed_address (pc, builtin_type_void_func_ptr);
+      pc = read_memory_typed_address (pc, func_ptr_type);
 
       /* If the PLT slot has not yet been resolved, the target will be
          the PLT stub.  */
@@ -2943,7 +2947,7 @@ hppa_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
            }
 
          /* This should point to the fixup routine.  */
-         pc = read_memory_typed_address (pc + 8, builtin_type_void_func_ptr);
+         pc = read_memory_typed_address (pc + 8, func_ptr_type);
        }
     }
 
index 40cbde5bfff179ab5f1bd78803f13482ba5b1157..edaac21b186216c855db8a0cd0ae63be08c59179 100644 (file)
@@ -1275,7 +1275,7 @@ i386_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
   gdb_byte buf[8];
 
   frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
-  return extract_typed_address (buf, builtin_type_void_func_ptr);
+  return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
 }
 \f
 
@@ -2071,9 +2071,11 @@ i386_sse_type (struct gdbarch *gdbarch)
 
       t = init_composite_type ("__gdb_builtin_type_vec128i", TYPE_CODE_UNION);
       append_composite_type_field (t, "v4_float",
-                                  init_vector_type (builtin_type_float, 4));
+                                  init_vector_type (builtin_type (gdbarch)
+                                                    ->builtin_float, 4));
       append_composite_type_field (t, "v2_double",
-                                  init_vector_type (builtin_type_double, 2));
+                                  init_vector_type (builtin_type (gdbarch)
+                                                    ->builtin_double, 2));
       append_composite_type_field (t, "v16_int8",
                                   init_vector_type (builtin_type_int8, 16));
       append_composite_type_field (t, "v8_int16",
@@ -2100,13 +2102,13 @@ static struct type *
 i386_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum == I386_EIP_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
 
   if (regnum == I386_EFLAGS_REGNUM)
     return i386_eflags_type;
 
   if (regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
 
   if (i386_fp_regnum_p (gdbarch, regnum))
     return builtin_type_i387_ext;
@@ -2120,7 +2122,7 @@ i386_register_type (struct gdbarch *gdbarch, int regnum)
   if (regnum == I387_MXCSR_REGNUM (gdbarch_tdep (gdbarch)))
     return i386_mxcsr_type;
 
-  return builtin_type_int;
+  return builtin_type (gdbarch)->builtin_int;
 }
 
 /* Map a cooked register onto a raw register or memory.  For the i386,
index df5f43adc3e2ce9321a94201e72cafc57b670f80..2f2e26140ff0ee8c11f420c4e5932f3c47feb84a 100644 (file)
@@ -309,7 +309,7 @@ ia64_register_type (struct gdbarch *arch, int reg)
   if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
     return builtin_type_ia64_ext;
   else
-    return builtin_type_long;
+    return builtin_type (arch)->builtin_long;
 }
 
 static int
index 53f0d2080fbe131b91982da91c9474fed993fea2..c27195b2f9348fe3db837c99af8b36ac050cec5a 100644 (file)
@@ -231,9 +231,9 @@ static struct type *
 m32r_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if (reg_nr == M32R_PC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   else if (reg_nr == M32R_SP_REGNUM || reg_nr == M32R_FP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else
     return builtin_type_int32;
 }
index 2319d7877e0303d827472645a8a4cfd5816daeac..1a314405b11c36875c5d4ac95126ac3bc4a80afb 100644 (file)
@@ -120,7 +120,7 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
        }
 
       if (regnum == M68K_FPI_REGNUM)
-       return builtin_type_void_func_ptr;
+       return builtin_type (gdbarch)->builtin_func_ptr;
 
       if (regnum == M68K_FPC_REGNUM || regnum == M68K_FPS_REGNUM)
        return builtin_type_int32;
@@ -132,10 +132,10 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
     }
 
   if (regnum == gdbarch_pc_regnum (gdbarch))
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
 
   if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
 
   if (regnum == M68K_PS_REGNUM)
     return m68k_ps_type;
@@ -832,7 +832,7 @@ m68k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
   gdb_byte buf[8];
 
   frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
-  return extract_typed_address (buf, builtin_type_void_func_ptr);
+  return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
 }
 \f
 /* Normal frames.  */
index dc9b2919df297494ffa31620c06f1b979cc55c4c..ce3c5441a0619727af23e0ec97deb9f709193a61 100644 (file)
@@ -75,11 +75,11 @@ m88k_register_type (struct gdbarch *gdbarch, int regnum)
   /* SXIP, SNIP, SFIP and R1 contain code addresses.  */
   if ((regnum >= M88K_SXIP_REGNUM && regnum <= M88K_SFIP_REGNUM)
       || regnum == M88K_R1_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
 
   /* R30 and R31 typically contains data addresses.  */
   if (regnum == M88K_R30_REGNUM || regnum == M88K_R31_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
 
   return builtin_type_int32;
 }
index 6dfbcc16b5065c071a102313aa79b571c440facc..648ad91e42a6a30ea6e5bd4cbca89d8be76be342 100644 (file)
@@ -1097,14 +1097,14 @@ mep_register_type (struct gdbarch *gdbarch, int reg_nr)
       if (size == 32)
         {
           if (mep_pseudo_cr_is_float (reg_nr))
-            return builtin_type_float;
+            return builtin_type (gdbarch)->builtin_float;
           else
             return builtin_type_uint32;
         }
       else if (size == 64)
         {
           if (mep_pseudo_cr_is_float (reg_nr))
-            return builtin_type_double;
+            return builtin_type (gdbarch)->builtin_double;
           else
             return builtin_type_uint64;
         }
index 615938b60297d2698f9c82d3b7aed2d8ee0fb04c..1cc34489d3f5ff3b70aaebf63395c2cd3b2537e4 100644 (file)
@@ -737,12 +737,13 @@ mips_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
 
   /* Use pointer types for registers if we can.  For n32 we can not,
      since we do not have a 64-bit pointer type.  */
-  if (mips_abi_regsize (gdbarch) == TYPE_LENGTH (builtin_type_void_data_ptr))
+  if (mips_abi_regsize (gdbarch)
+      == TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr))
     {
       if (rawnum == MIPS_SP_REGNUM || rawnum == MIPS_EMBED_BADVADDR_REGNUM)
-       return builtin_type_void_data_ptr;
+       return builtin_type (gdbarch)->builtin_data_ptr;
       else if (rawnum == MIPS_EMBED_PC_REGNUM)
-       return builtin_type_void_func_ptr;
+       return builtin_type (gdbarch)->builtin_func_ptr;
     }
 
   if (mips_abi_regsize (gdbarch) == 4 && TYPE_LENGTH (rawtype) == 8
index 88cb150b73519e490e74fe7959964b6bcc60794f..50a72074311772da4d02f32cbe70886e21194501 100644 (file)
@@ -265,7 +265,7 @@ am33_2_register_name (struct gdbarch *gdbarch, int reg)
 static struct type *
 mn10300_register_type (struct gdbarch *gdbarch, int reg)
 {
-  return builtin_type_int;
+  return builtin_type (gdbarch)->builtin_int;
 }
 
 static CORE_ADDR
index fd3f5882d405bbb8892b9a7de74f6b8c1ee0f126..da4afe347ce5dac1848b7a9145de9c3fd1951a57 100644 (file)
@@ -226,9 +226,9 @@ mt_copro_register_type (struct gdbarch *arch, int regnum)
     case MT_MAC_REGNUM:
       return builtin_type_uint32;
     case MT_CONTEXT_REGNUM:
-      return builtin_type_long_long;
+      return builtin_type (arch)->builtin_long_long;
     case MT_FLAG_REGNUM:
-      return builtin_type_unsigned_char;
+      return builtin_type (arch)->builtin_unsigned_char;
     default:
       if (regnum >= MT_CPR0_REGNUM && regnum <= MT_CPR15_REGNUM)
        return builtin_type_int16;
index c8bc7ac082acafbf851a780034a811159bcc8c97..f46c979fb16a357f6ed53630409191d69b8b1fb1 100644 (file)
@@ -2264,7 +2264,8 @@ rs6000_builtin_type_vec64 (struct gdbarch *gdbarch)
       t = init_composite_type ("__ppc_builtin_type_vec64", TYPE_CODE_UNION);
       append_composite_type_field (t, "uint64", builtin_type_int64);
       append_composite_type_field (t, "v2_float",
-                                  init_vector_type (builtin_type_float, 2));
+                                  init_vector_type (builtin_type (gdbarch)
+                                                    ->builtin_float, 2));
       append_composite_type_field (t, "v2_int32",
                                   init_vector_type (builtin_type_int32, 2));
       append_composite_type_field (t, "v4_int16",
@@ -2462,7 +2463,8 @@ rs6000_convert_register_p (struct gdbarch *gdbarch, int regnum,
          && regnum >= tdep->ppc_fp0_regnum
          && regnum < tdep->ppc_fp0_regnum + ppc_num_fprs
          && TYPE_CODE (type) == TYPE_CODE_FLT
-         && TYPE_LENGTH (type) != TYPE_LENGTH (builtin_type_double));
+         && TYPE_LENGTH (type)
+            != TYPE_LENGTH (builtin_type (gdbarch)->builtin_double));
 }
 
 static void
@@ -2471,12 +2473,14 @@ rs6000_register_to_value (struct frame_info *frame,
                           struct type *type,
                           gdb_byte *to)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   gdb_byte from[MAX_REGISTER_SIZE];
   
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
 
   get_frame_register (frame, regnum, from);
-  convert_typed_floating (from, builtin_type_double, to, type);
+  convert_typed_floating (from, builtin_type (gdbarch)->builtin_double,
+                         to, type);
 }
 
 static void
@@ -2485,11 +2489,13 @@ rs6000_value_to_register (struct frame_info *frame,
                           struct type *type,
                           const gdb_byte *from)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   gdb_byte to[MAX_REGISTER_SIZE];
 
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
 
-  convert_typed_floating (from, type, to, builtin_type_double);
+  convert_typed_floating (from, type,
+                         to, builtin_type (gdbarch)->builtin_double);
   put_frame_register (frame, regnum, to);
 }
 
index 07c1b33ea6d9b19da9920e87aa155340afa9684a..7621bbf6cbc7fb054826d15123d35fa32070a900 100644 (file)
@@ -96,19 +96,19 @@ static struct type *
 s390_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum == S390_PSWM_REGNUM || regnum == S390_PSWA_REGNUM)
-    return builtin_type_long;
+    return builtin_type (gdbarch)->builtin_long;
   if (regnum >= S390_R0_REGNUM && regnum <= S390_R15_REGNUM)
-    return builtin_type_long;
+    return builtin_type (gdbarch)->builtin_long;
   if (regnum >= S390_A0_REGNUM && regnum <= S390_A15_REGNUM)
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
   if (regnum == S390_FPC_REGNUM)
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
   if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   if (regnum == S390_PC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   if (regnum == S390_CC_REGNUM)
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
 
   internal_error (__FILE__, __LINE__, _("invalid regnum"));
 }
index 20ba95ec08d35780fd5834210d9d63097ca3c860..63df344019157562e1eb3fa9389d4d6435ed9556 100644 (file)
@@ -2124,11 +2124,11 @@ sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
        && (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   else
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
 }
 
 /* Return the GDB type object for the "standard" data type
@@ -2138,18 +2138,18 @@ sh_sh3e_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
        && (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   else
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
 }
 
 static struct type *
-sh_sh4_build_float_register_type (int high)
+sh_sh4_build_float_register_type (struct gdbarch *gdbarch, int high)
 {
   struct type *temp;
 
   temp = create_range_type (NULL, builtin_type_int32, 0, high);
-  return create_array_type (NULL, builtin_type_float, temp);
+  return create_array_type (NULL, builtin_type (gdbarch)->builtin_float, temp);
 }
 
 static struct type *
@@ -2157,19 +2157,19 @@ sh_sh4_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if ((reg_nr >= gdbarch_fp0_regnum (gdbarch)
        && (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM))
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   else if (reg_nr >= FV0_REGNUM && reg_nr <= FV_LAST_REGNUM)
-    return sh_sh4_build_float_register_type (3);
+    return sh_sh4_build_float_register_type (gdbarch, 3);
   else
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
 }
 
 static struct type *
 sh_default_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
-  return builtin_type_int;
+  return builtin_type (gdbarch)->builtin_int;
 }
 
 /* Is a register in a reggroup?
index e127995cbdf6a92a036d12a4d8cb60ee9cee3035..7fd9c94b95713d0a62d39e809f892dbe4bad84df 100644 (file)
@@ -1495,12 +1495,12 @@ REGISTER_BYTE returns the register byte for the base register.
 */
 
 static struct type *
-sh64_build_float_register_type (int high)
+sh64_build_float_register_type (struct gdbarch *gdbarch, int high)
 {
   struct type *temp;
 
   temp = create_range_type (NULL, builtin_type_int32, 0, high);
-  return create_array_type (NULL, builtin_type_float, temp);
+  return create_array_type (NULL, builtin_type (gdbarch)->builtin_float, temp);
 }
 
 /* Return the GDB type object for the "standard" data type
@@ -1512,27 +1512,27 @@ sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
        && reg_nr <= FP_LAST_REGNUM)
       || (reg_nr >= FP0_C_REGNUM
          && reg_nr <= FP_LAST_C_REGNUM))
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   else if ((reg_nr >= DR0_REGNUM 
            && reg_nr <= DR_LAST_REGNUM)
           || (reg_nr >= DR0_C_REGNUM 
               && reg_nr <= DR_LAST_C_REGNUM))
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   else if  (reg_nr >= FPP0_REGNUM 
            && reg_nr <= FPP_LAST_REGNUM)
-    return sh64_build_float_register_type (1);
+    return sh64_build_float_register_type (gdbarch, 1);
   else if ((reg_nr >= FV0_REGNUM
            && reg_nr <= FV_LAST_REGNUM)
           ||(reg_nr >= FV0_C_REGNUM 
              && reg_nr <= FV_LAST_C_REGNUM))
-    return sh64_build_float_register_type (3);
+    return sh64_build_float_register_type (gdbarch, 3);
   else if (reg_nr == FPSCR_REGNUM)
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
   else if (reg_nr >= R0_C_REGNUM
           && reg_nr < FP0_C_REGNUM)
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
   else
-    return builtin_type_long_long;
+    return builtin_type (gdbarch)->builtin_long_long;
 }
 
 static void
@@ -1989,7 +1989,7 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
           regnum, gdbarch_register_name (gdbarch, regnum));
 
   /* Get the register as a number */ 
-  flt = unpack_double (builtin_type_float, raw_buffer, &inv);
+  flt = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv);
 
   /* Print the name and some spaces.  */
   fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);
index ff2feecb86fa10a30426e521c4252eda521708bf..d21697a449f38df8f386b347645488e9e0832dff 100644 (file)
@@ -332,16 +332,16 @@ static struct type *
 sparc32_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
 
   if (regnum >= SPARC32_D0_REGNUM && regnum <= SPARC32_D30_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
 
   if (regnum == SPARC_SP_REGNUM || regnum == SPARC_FP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
 
   if (regnum == SPARC32_PC_REGNUM || regnum == SPARC32_NPC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
 
   if (regnum == SPARC32_PSR_REGNUM)
     return sparc_psr_type;
index 25c8e57b1c4f2e4079a416fe2aa64c77db5fc0ea..582924720a4d04cef9b0e82637c1e37f9b755c69 100644 (file)
@@ -247,15 +247,15 @@ sparc64_register_type (struct gdbarch *gdbarch, int regnum)
   /* Raw registers.  */
 
   if (regnum == SPARC_SP_REGNUM || regnum == SPARC_FP_REGNUM)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   if (regnum >= SPARC_G0_REGNUM && regnum <= SPARC_I7_REGNUM)
     return builtin_type_int64;
   if (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
-    return builtin_type_float;
+    return builtin_type (gdbarch)->builtin_float;
   if (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   if (regnum == SPARC64_PC_REGNUM || regnum == SPARC64_NPC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   /* This raw register contains the contents of %cwp, %pstate, %asi
      and %ccr as laid out in a %tstate register.  */
   if (regnum == SPARC64_STATE_REGNUM)
@@ -280,9 +280,9 @@ sparc64_register_type (struct gdbarch *gdbarch, int regnum)
   if (regnum == SPARC64_CCR_REGNUM)
     return builtin_type_int64;
   if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
-    return builtin_type_double;
+    return builtin_type (gdbarch)->builtin_double;
   if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
-    return builtin_type_long_double;
+    return builtin_type (gdbarch)->builtin_long_double;
 
   internal_error (__FILE__, __LINE__, _("invalid regnum"));
 }
index e68b228fb0eaf443138481287f5dce66282b122e..e89402e05c25e74f3c65dc1220339cc920257d95 100644 (file)
@@ -74,9 +74,11 @@ spu_builtin_type_vec128 (struct gdbarch *gdbarch)
       append_composite_type_field (t, "v16_int8",
                                   init_vector_type (builtin_type_int8, 16));
       append_composite_type_field (t, "v2_double",
-                                  init_vector_type (builtin_type_double, 2));
+                                  init_vector_type (builtin_type (gdbarch)
+                                                    ->builtin_double, 2));
       append_composite_type_field (t, "v4_float",
-                                  init_vector_type (builtin_type_float, 4));
+                                  init_vector_type (builtin_type (gdbarch)
+                                                    ->builtin_float, 4));
 
       TYPE_VECTOR (t) = 1;
       TYPE_NAME (t) = "spu_builtin_type_vec128";
@@ -137,10 +139,10 @@ spu_register_type (struct gdbarch *gdbarch, int reg_nr)
       return builtin_type_uint32;
 
     case SPU_PC_REGNUM:
-      return builtin_type_void_func_ptr;
+      return builtin_type (gdbarch)->builtin_func_ptr;
 
     case SPU_SP_REGNUM:
-      return builtin_type_void_data_ptr;
+      return builtin_type (gdbarch)->builtin_data_ptr;
 
     case SPU_FPSCR_REGNUM:
       return builtin_type_uint128;
index 5a7a68be9d62d0c0fa092489231d1ef5cff12788..ffa7f711025212cd0204d1f52b7d749ece436a5b 100644 (file)
@@ -42,12 +42,13 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
                              frame);
   else
     {
-      struct value *val = allocate_value (builtin_type_void_data_ptr);
+      struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+      struct value *val = allocate_value (data_ptr_type);
       gdb_byte *buf = value_contents_raw (val);
       if (frame == NULL)
        memset (buf, 0, TYPE_LENGTH (value_type (val)));
       else
-       gdbarch_address_to_pointer (gdbarch, builtin_type_void_data_ptr,
+       gdbarch_address_to_pointer (gdbarch, data_ptr_type,
                                    buf, get_frame_base_address (frame));
       return val;
     }
@@ -61,12 +62,13 @@ value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
     return value_of_register (gdbarch_pc_regnum (gdbarch), frame);
   else
     {
-      struct value *val = allocate_value (builtin_type_void_func_ptr);
+      struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
+      struct value *val = allocate_value (func_ptr_type);
       gdb_byte *buf = value_contents_raw (val);
       if (frame == NULL)
        memset (buf, 0, TYPE_LENGTH (value_type (val)));
       else
-       gdbarch_address_to_pointer (gdbarch, builtin_type_void_func_ptr,
+       gdbarch_address_to_pointer (gdbarch, func_ptr_type,
                                    buf, get_frame_pc (frame));
       return val;
     }
index ca5b4fdc23b84a2b51334c020e378ed319dcc123..337a0bd0db693777f303273f75e960558f952382 100644 (file)
@@ -552,32 +552,32 @@ tdesc_register_type (struct gdbarch *gdbarch, int regno)
   if (strcmp (reg->type, "float") == 0)
     {
       if (reg->bitsize == gdbarch_float_bit (gdbarch))
-       return builtin_type_float;
+       return builtin_type (gdbarch)->builtin_float;
       else if (reg->bitsize == gdbarch_double_bit (gdbarch))
-       return builtin_type_double;
+       return builtin_type (gdbarch)->builtin_double;
       else if (reg->bitsize == gdbarch_long_double_bit (gdbarch))
-       return builtin_type_long_double;
+       return builtin_type (gdbarch)->builtin_long_double;
     }
   else if (strcmp (reg->type, "int") == 0)
     {
       if (reg->bitsize == gdbarch_long_bit (gdbarch))
-       return builtin_type_long;
+       return builtin_type (gdbarch)->builtin_long;
       else if (reg->bitsize == TARGET_CHAR_BIT)
-       return builtin_type_char;
+       return builtin_type (gdbarch)->builtin_char;
       else if (reg->bitsize == gdbarch_short_bit (gdbarch))
-       return builtin_type_short;
+       return builtin_type (gdbarch)->builtin_short;
       else if (reg->bitsize == gdbarch_int_bit (gdbarch))
-       return builtin_type_int;
+       return builtin_type (gdbarch)->builtin_int;
       else if (reg->bitsize == gdbarch_long_long_bit (gdbarch))
-       return builtin_type_long_long;
+       return builtin_type (gdbarch)->builtin_long_long;
       else if (reg->bitsize == gdbarch_ptr_bit (gdbarch))
        /* A bit desperate by this point... */
-       return builtin_type_void_data_ptr;
+       return builtin_type (gdbarch)->builtin_data_ptr;
     }
   else if (strcmp (reg->type, "code_ptr") == 0)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   else if (strcmp (reg->type, "data_ptr") == 0)
-    return builtin_type_void_data_ptr;
+    return builtin_type (gdbarch)->builtin_data_ptr;
   else
     internal_error (__FILE__, __LINE__,
                    "Register \"%s\" has an unknown type \"%s\"",
@@ -585,7 +585,7 @@ tdesc_register_type (struct gdbarch *gdbarch, int regno)
 
   warning (_("Register \"%s\" has an unsupported size (%d bits)"),
           reg->name, reg->bitsize);
-  return builtin_type_long;
+  return builtin_type (gdbarch)->builtin_long;
 }
 
 static int
index 7fce3119097ad34fd8dc1c2022eb0da1b037c028..2e5a4e7cf2569e6b2e090ed64c5d5423a1cd80b0 100644 (file)
@@ -183,7 +183,7 @@ static struct type *
 v850_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum == E_PC_REGNUM)
-    return builtin_type_void_func_ptr;
+    return builtin_type (gdbarch)->builtin_func_ptr;
   return builtin_type_int32;
 }
 
index 618befa3f5a8872912f347d2aae0b936611cf9f1..09b4bc716823d3cdf19a1f4c4d41aa3cb9e3938c 100644 (file)
@@ -61,7 +61,7 @@ vax_register_name (struct gdbarch *gdbarch, int regnum)
 static struct type *
 vax_register_type (struct gdbarch *gdbarch, int regnum)
 {
-  return builtin_type_int;
+  return builtin_type (gdbarch)->builtin_int;
 }
 \f
 /* Core file support.  */
index 7f8ecc2cef2d00cc5b705dcf2c849d279fe2faa6..e70710acd23758c4822ed64881e9aad8a650254b 100644 (file)
@@ -229,7 +229,7 @@ xtensa_register_type (struct gdbarch *gdbarch, int regnum)
                    + gdbarch_tdep (gdbarch)->num_aregs)
       || (regnum >= gdbarch_tdep (gdbarch)->a0_base
       && regnum < gdbarch_tdep (gdbarch)->a0_base + 16))
-    return builtin_type_int;
+    return builtin_type (gdbarch)->builtin_int;
 
   if (regnum == gdbarch_pc_regnum (gdbarch)
       || regnum == gdbarch_tdep (gdbarch)->a0_base + 1)
@@ -1015,15 +1015,16 @@ static CORE_ADDR
 xtensa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
   gdb_byte buf[8];
+  CORE_ADDR pc;
 
   DEBUGTRACE ("xtensa_unwind_pc (next_frame = %p)\n", next_frame);
 
   frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
+  pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
 
-  DEBUGINFO ("[xtensa_unwind_pc] pc = 0x%08x\n", (unsigned int)
-            extract_typed_address (buf, builtin_type_void_func_ptr));
+  DEBUGINFO ("[xtensa_unwind_pc] pc = 0x%08x\n", (unsigned int) pc);
 
-  return extract_typed_address (buf, builtin_type_void_func_ptr);
+  return pc;
 }
 
 
@@ -1677,9 +1678,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
        case TYPE_CODE_ENUM:
 
          /* Cast argument to long if necessary as the mask does it too.  */
-         if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
+         if (TYPE_LENGTH (arg_type)
+             < TYPE_LENGTH (builtin_type (gdbarch)->builtin_long))
            {
-             arg_type = builtin_type_long;
+             arg_type = builtin_type (gdbarch)->builtin_long;
              arg = value_cast (arg_type, arg);
            }
          /* Aligment is equal to the type length for the basic types.  */
@@ -1689,15 +1691,16 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
        case TYPE_CODE_FLT:
 
          /* Align doubles correctly.  */
-         if (TYPE_LENGTH (arg_type) == TYPE_LENGTH (builtin_type_double))
-           info->align = TYPE_LENGTH (builtin_type_double);
+         if (TYPE_LENGTH (arg_type)
+             == TYPE_LENGTH (builtin_type (gdbarch)->builtin_double))
+           info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_double);
          else
-           info->align = TYPE_LENGTH (builtin_type_long);
+           info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
          break;
 
        case TYPE_CODE_STRUCT:
        default:
-         info->align = TYPE_LENGTH (builtin_type_long);
+         info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
          break;
        }
       info->length = TYPE_LENGTH (arg_type);