]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2007-06-12 Markus Deuling <deuling@de.ibm.com>
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 12 Jun 2007 15:33:04 +0000 (15:33 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Tue, 12 Jun 2007 15:33:04 +0000 (15:33 +0000)
* gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise.
* gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* ada-lex.l (processInt): Likewise.
* f-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* ada-lang.c (ada_create_fundamental_type, ada_language_arch_info)
(gdbtypes_post_init, build_gdbtypes): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* parse.c (build_parse): Likewise.
* xcoffread.c (_initialize_xcoffread): Likewise.
* stabsread.c (define_symbol, read_one_struct_field, read_enum_type)
(read_range_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type, _initialize_m2_language)
(m2_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* coffread.c (coff_read_enum_type): Likewise.
* mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise.
* dwarf2read.c (new_symbol): Likewise.
* gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* ada-lex.l (processInt): Likewise.
* f-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* valarith.c (value_binop): Likewise.
* symfile.c (read_target_long_array, simple_overlay_update_1): Likewise.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
* symfile.c (TARGET_LONG_BYTES): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* coffread.c (decode_base_type): Likewise.
* gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise.
* stabsread.c (read_range_type): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.

24 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-lex.l
gdb/c-exp.y
gdb/c-lang.c
gdb/coffread.c
gdb/dwarf2read.c
gdb/f-exp.y
gdb/f-lang.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbtypes.c
gdb/m2-lang.c
gdb/mdebugread.c
gdb/objc-exp.y
gdb/objc-lang.c
gdb/p-exp.y
gdb/p-lang.c
gdb/parse.c
gdb/stabsread.c
gdb/symfile.c
gdb/valarith.c
gdb/xcoffread.c

index cd4322bfad5858a3c6863926ae4a417d125657e8..8912582dde6191f92761a5b7540d7b6f39ed730f 100644 (file)
@@ -1,3 +1,68 @@
+2007-06-12  Markus Deuling  <deuling@de.ibm.com>
+
+       * gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit.
+       * ada-lang.c (ada_create_fundamental_type)
+       (ada_language_arch_info): Likewise.
+       * c-lang.c (c_create_fundamental_type): Likewise.
+       * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise.
+       * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
+       * m2-lang.c (m2_create_fundamental_type): Likewise.
+       * objc-lang.c (objc_create_fundamental_type): Likewise.
+       * p-lang.c (pascal_create_fundamental_type): Likewise.
+       * gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit.
+       * c-exp.y (parse_number): Likewise.
+       * objc-exp.y (parse_number): Likewise.
+       * ada-lex.l (processInt): Likewise.
+       * f-exp.y (parse_number): Likewise.
+       * p-exp.y (parse_number): Likewise.
+       * ada-lang.c (ada_create_fundamental_type, ada_language_arch_info)
+       (gdbtypes_post_init, build_gdbtypes): Likewise.
+       * p-lang.c (pascal_create_fundamental_type): Likewise.
+       * parse.c (build_parse): Likewise.
+       * xcoffread.c (_initialize_xcoffread): Likewise.
+       * stabsread.c (define_symbol, read_one_struct_field, read_enum_type)
+       (read_range_type): Likewise.
+       * objc-lang.c (objc_create_fundamental_type): Likewise.
+       * f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise.
+       * m2-lang.c (m2_create_fundamental_type, _initialize_m2_language)
+       (m2_create_fundamental_type): Likewise.
+       * c-lang.c (c_create_fundamental_type): Likewise.
+       * coffread.c (coff_read_enum_type): Likewise.
+       * mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise.
+       * dwarf2read.c (new_symbol): Likewise.
+       * gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit.
+       * c-exp.y (parse_number): Likewise.
+       * objc-exp.y (parse_number): Likewise.
+       * ada-lex.l (processInt): Likewise.
+       * f-exp.y (parse_number): Likewise.
+       * p-exp.y (parse_number): Likewise.
+       * valarith.c (value_binop): Likewise.
+       * symfile.c (read_target_long_array, simple_overlay_update_1): Likewise.
+       * ada-lang.c (ada_create_fundamental_type)
+       (ada_language_arch_info): Likewise.
+       * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
+       * symfile.c (TARGET_LONG_BYTES): Likewise.
+       * p-lang.c (pascal_create_fundamental_type): Likewise.
+       * objc-lang.c (objc_create_fundamental_type): Likewise.
+       * m2-lang.c (m2_create_fundamental_type): Likewise.
+       * f-lang.c (f_create_fundamental_type): Likewise.
+       * c-lang.c (c_create_fundamental_type): Likewise.
+       * coffread.c (decode_base_type): Likewise.
+       * gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit.
+       * c-exp.y (parse_number): Likewise.
+       * objc-exp.y (parse_number): Likewise.
+       * p-exp.y (parse_number): Likewise.
+       * ada-lang.c (ada_create_fundamental_type)
+       (ada_language_arch_info): Likewise.
+       * gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise.
+       * stabsread.c (read_range_type): Likewise.
+       * p-lang.c (pascal_create_fundamental_type): Likewise.
+       * objc-lang.c (objc_create_fundamental_type): Likewise.
+       * m2-lang.c (m2_create_fundamental_type): Likewise.
+       * f-lang.c (f_create_fundamental_type): Likewise.
+       * c-lang.c (c_create_fundamental_type): Likewise.
+       * gdbarch.c, gdbarch.h: Regenerate.
+
 2007-06-12  Andreas Schwab  <schwab@suse.de>
 
        * frame-unwind.h (frame_dealloc_cache_ftype): Define.
index f79f7279150e0ce818fb1460cbc7a742da7aae54..7f83bfe7a8f11cc74424089ac89e78042f0d7db0 100644 (file)
@@ -10198,7 +10198,7 @@ ada_create_fundamental_type (struct objfile *objfile, int typeid)
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error.  */
       type = init_type (TYPE_CODE_INT,
-                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "<?type?>", objfile);
       warning (_("internal error: no Ada fundamental type %d"), typeid);
       break;
@@ -10224,63 +10224,66 @@ ada_create_fundamental_type (struct objfile *objfile, int typeid)
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "short_integer", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "short_integer", objfile);
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "integer", objfile);
       break;
     case FT_SIGNED_INTEGER:
-      type = init_type (TYPE_CODE_INT, TARGET_INT_BIT /
-                       TARGET_CHAR_BIT, 
+      type = init_type (TYPE_CODE_INT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer", objfile);        /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "long_integer", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "long_integer", objfile);
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                        0, "long_long_integer", objfile);
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
+                       0, "long_long_integer", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                        0, "long_long_integer", objfile);
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
+                       0, "long_long_integer", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
+                       TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
       type = init_type (TYPE_CODE_FLT,
@@ -10326,14 +10329,17 @@ ada_language_arch_info (struct gdbarch *current_gdbarch,
     = GDBARCH_OBSTACK_CALLOC (current_gdbarch, nr_ada_primitive_types + 1,
                              struct type *);
   lai->primitive_type_vector [ada_primitive_type_int] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "integer", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long] =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-               0, "long_integer", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "long_integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_short] =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-               0, "short_integer", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "short_integer", (struct objfile *) NULL);
   lai->string_char_type = 
     lai->primitive_type_vector [ada_primitive_type_char] =
     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
@@ -10345,17 +10351,20 @@ ada_language_arch_info (struct gdbarch *current_gdbarch,
     init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
                0, "long_float", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long_long] =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                0, "long_long_integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long_double] =
     init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
                0, "long_long_float", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_natural] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "natural", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "natural", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_positive] =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-               0, "positive", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "positive", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_void] = builtin->builtin_void;
 
   lai->primitive_type_vector [ada_primitive_type_system_address] =
index 45def663545759f3ef480407f13e95245d151746..a52f5054274701e62e21db77392b9a6f15b5732c 100644 (file)
@@ -341,11 +341,11 @@ processInt (const char *base0, const char *num0, const char *exp0)
       exp -= 1;
     }
 
-  if ((result >> (TARGET_INT_BIT-1)) == 0)
+  if ((result >> (gdbarch_int_bit (current_gdbarch)-1)) == 0)
     yylval.typed_val.type = type_int ();
-  else if ((result >> (TARGET_LONG_BIT-1)) == 0)
+  else if ((result >> (gdbarch_long_bit (current_gdbarch)-1)) == 0)
     yylval.typed_val.type = type_long ();
-  else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
+  else if (((result >> (gdbarch_long_bit (current_gdbarch)-1)) >> 1) == 0)
     {
       /* We have a number representable as an unsigned integer quantity.
          For consistency with the C treatment, we will treat it as an
index fde097dba35992983599daf770d7e7782fbee090..b67c7e1a8db6a77381c1ec1ec705f63cb26b7d1c 100644 (file)
@@ -1194,16 +1194,16 @@ parse_number (p, len, parsed_float, putithere)
      shift it right and see whether anything remains.  Note that we
      can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
      operation, because many compilers will warn about such a shift
-     (which always produces a zero result).  Sometimes TARGET_INT_BIT
-     or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
+     (which always produces a zero result).  Sometimes gdbarch_int_bit
+     or gdbarch_long_bit will be that big, sometimes not.  To deal with
      the case where it is we just always shift the value more than
      once, with fewer bits each time.  */
 
   un = (ULONGEST)n >> 2;
   if (long_p == 0
-      && (un >> (TARGET_INT_BIT - 2)) == 0)
+      && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
 
       /* A large decimal (not hex or octal) constant (between INT_MAX
         and UINT_MAX) is a long or unsigned long, according to ANSI,
@@ -1215,20 +1215,21 @@ parse_number (p, len, parsed_float, putithere)
       signed_type = builtin_type (current_gdbarch)->builtin_int;
     }
   else if (long_p <= 1
-          && (un >> (TARGET_LONG_BIT - 2)) == 0)
+          && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
       unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long;
       signed_type = builtin_type (current_gdbarch)->builtin_long;
     }
   else
     {
       int shift;
-      if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+      if (sizeof (ULONGEST) * HOST_CHAR_BIT 
+         < gdbarch_long_long_bit (current_gdbarch))
        /* A long long does not fit in a LONGEST.  */
        shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
       else
-       shift = (TARGET_LONG_LONG_BIT - 1);
+       shift = (gdbarch_long_long_bit (current_gdbarch) - 1);
       high_bit = (ULONGEST) 1 << shift;
       unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long_long;
       signed_type = builtin_type (current_gdbarch)->builtin_long_long;
index 52b2a36b22144e0a4aaa524073cd717591d46306..8dac4f5052c16730a1ea6b69c3da1ba0700dcee7 100644 (file)
@@ -219,7 +219,7 @@ c_create_fundamental_type (struct objfile *objfile, int typeid)
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error. */
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "<?type?>", objfile);
       warning (_("internal error: no C/C++ fundamental type %d"), typeid);
       break;
@@ -250,62 +250,65 @@ c_create_fundamental_type (struct objfile *objfile, int typeid)
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "short", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "short", objfile);   /* FIXME-fnf */
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "int", objfile);
       break;
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "int", objfile);     /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);    /* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                         / TARGET_CHAR_BIT,
                        0, "long long", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                         / TARGET_CHAR_BIT,
                        0, "signed long long", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                         / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
index a9be6f6914897a069746e0153fd9fc1abcc0157f..5b4e52a31bbe87924936080a3928d288ff927912 100644 (file)
@@ -1809,7 +1809,8 @@ decode_base_type (struct coff_symbol *cs, unsigned int c_type,
 
     case T_LONG:
       if (cs->c_sclass == C_FIELD
-         && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+         && aux->x_sym.x_misc.x_lnsz.x_size
+            > gdbarch_long_bit (current_gdbarch))
        return lookup_fundamental_type (current_objfile, FT_LONG_LONG);
       else
        return lookup_fundamental_type (current_objfile, FT_LONG);
@@ -1909,7 +1910,8 @@ decode_base_type (struct coff_symbol *cs, unsigned int c_type,
 
     case T_ULONG:
       if (cs->c_sclass == C_FIELD
-         && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+         && aux->x_sym.x_misc.x_lnsz.x_size
+            > gdbarch_long_bit (current_gdbarch))
        return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG_LONG);
       else
        return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
@@ -2082,8 +2084,8 @@ coff_read_enum_type (int index, int length, int lastsym)
 
   if (length > 0)
     TYPE_LENGTH (type) = length;
-  else
-    TYPE_LENGTH (type) = TARGET_INT_BIT / TARGET_CHAR_BIT;     /* Assume ints */
+  else /* Assume ints.  */
+    TYPE_LENGTH (type) = gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT;
   TYPE_CODE (type) = TYPE_CODE_ENUM;
   TYPE_NFIELDS (type) = nsyms;
   TYPE_FIELDS (type) = (struct field *)
index 2a33b9e5819f8a8e25746bff5d2dcaf761598233..42e50cf18cdaa5de9dce3770df80f15585f68e0f 100644 (file)
@@ -7153,8 +7153,9 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
             to something sensible.  */
          if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
            SYMBOL_TYPE (sym) = init_type (TYPE_CODE_INT,
-                                          TARGET_INT_BIT / HOST_CHAR_BIT, 0,
-                                          "<variable, no debug info>",
+                                          gdbarch_int_bit (current_gdbarch)
+                                            / HOST_CHAR_BIT,
+                                          0, "<variable, no debug info>",
                                           objfile);
          attr = dwarf2_attr (die, DW_AT_const_value, cu);
          if (attr)
index f87937373a25e86d175f09b3ee8e3a789d2f65fa..b03ca375e0e1ed716105755ae103b5fd82514e77 100644 (file)
@@ -766,23 +766,24 @@ parse_number (p, len, parsed_float, putithere)
      target int size is different to the target long size.
      
      In the expression below, we could have tested
-     (n >> TARGET_INT_BIT)
+     (n >> gdbarch_int_bit (current_gdbarch))
      to see if it was zero,
      but too many compilers warn about that, when ints and longs
      are the same size.  So we shift it twice, with fewer bits
      each time, for the same result.  */
   
-  if ((TARGET_INT_BIT != TARGET_LONG_BIT 
-       && ((n >> 2) >> (TARGET_INT_BIT-2)))   /* Avoid shift warning */
+  if ((gdbarch_int_bit (current_gdbarch) != gdbarch_long_bit (current_gdbarch)
+       && ((n >> 2)
+          >> (gdbarch_int_bit (current_gdbarch)-2))) /* Avoid shift warning */
       || long_p)
     {
-      high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch)-1);
       unsigned_type = builtin_type_unsigned_long;
       signed_type = builtin_type_long;
     }
   else 
     {
-      high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch)-1);
       unsigned_type = builtin_type_unsigned_int;
       signed_type = builtin_type_int;
     }    
index 46fb39cfa954c612373890830608da2cee36c862..76c5ec67c0d606610175bafe465af5d8430b24e5 100644 (file)
@@ -285,67 +285,70 @@ f_create_fundamental_type (struct objfile *objfile, int typeid)
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer*2", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "short", objfile);   /* FIXME-fnf */
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_BOOL,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "logical*2", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer*4", objfile);
       break;
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer", objfile);         /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_BOOL,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "logical*4", objfile);
       break;
     case FT_FIXED_DECIMAL:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "fixed decimal", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);    /* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                        / TARGET_CHAR_BIT,
                        0, "long long", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                        / TARGET_CHAR_BIT,
                        0, "signed long long", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch) 
+                        / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
@@ -392,7 +395,7 @@ f_create_fundamental_type (struct objfile *objfile, int typeid)
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error. */
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "<?type?>", objfile);
       warning (_("internal error: no F77 fundamental type %d"), typeid);
       break;
@@ -508,24 +511,24 @@ build_fortran_types (void)
               "logical*1", (struct objfile *) NULL);
 
   builtin_type_f_integer_s2 =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              0,
-              "integer*2", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "integer*2", (struct objfile *) NULL);
 
   builtin_type_f_logical_s2 =
-    init_type (TYPE_CODE_BOOL, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "logical*2", (struct objfile *) NULL);
+    init_type (TYPE_CODE_BOOL,
+              gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "logical*2", (struct objfile *) NULL);
 
   builtin_type_f_integer =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              0,
-              "integer", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "integer", (struct objfile *) NULL);
 
   builtin_type_f_logical =
-    init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "logical*4", (struct objfile *) NULL);
+    init_type (TYPE_CODE_BOOL, 
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "logical*4", (struct objfile *) NULL);
 
   builtin_type_f_real =
     init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
index f20b5bc632d468bfe8dec68500ab9c9662851a1d..810e93a96f498dd4e1dad0ab6c8c061a6886ef16 100644 (file)
@@ -401,11 +401,11 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
   current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
   current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
-  current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
+  current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
   current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
   current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
   current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
-  current_gdbarch->ptr_bit = TARGET_INT_BIT;
+  current_gdbarch->ptr_bit = current_gdbarch->int_bit;
   current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
   current_gdbarch->char_signed = -1;
   current_gdbarch->write_pc = generic_target_write_pc;
@@ -977,11 +977,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: inner_than = <0x%lx>\n",
                       (long) current_gdbarch->inner_than);
-#ifdef TARGET_INT_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_INT_BIT # %s\n",
-                      XSTRING (TARGET_INT_BIT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: int_bit = %s\n",
                       paddr_d (current_gdbarch->int_bit));
@@ -991,11 +986,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: integer_to_address = <0x%lx>\n",
                       (long) current_gdbarch->integer_to_address);
-#ifdef TARGET_LONG_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_BIT # %s\n",
-                      XSTRING (TARGET_LONG_BIT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_bit = %s\n",
                       paddr_d (current_gdbarch->long_bit));
@@ -1015,11 +1005,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_double_format = %s\n",
                       pformat (current_gdbarch->long_double_format));
-#ifdef TARGET_LONG_LONG_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
-                      XSTRING (TARGET_LONG_LONG_BIT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_long_bit = %s\n",
                       paddr_d (current_gdbarch->long_long_bit));
@@ -1194,11 +1179,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
                       (long) current_gdbarch->sdb_reg_to_regnum);
-#ifdef TARGET_SHORT_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
-                      XSTRING (TARGET_SHORT_BIT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: short_bit = %s\n",
                       paddr_d (current_gdbarch->short_bit));
index 21f26025d55011ed2d935cb234d7976271846530..97805c99ed0c1bc0165eaf51f5dde01e43876cbf 100644 (file)
@@ -87,46 +87,22 @@ extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
 
 extern int gdbarch_short_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_SHORT_BIT)
-#error "Non multi-arch definition of TARGET_SHORT_BIT"
-#endif
-#if !defined (TARGET_SHORT_BIT)
-#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
-#endif
 
 /* Number of bits in an int or unsigned int for the target machine. */
 
 extern int gdbarch_int_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_INT_BIT)
-#error "Non multi-arch definition of TARGET_INT_BIT"
-#endif
-#if !defined (TARGET_INT_BIT)
-#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
-#endif
 
 /* Number of bits in a long or unsigned long for the target machine. */
 
 extern int gdbarch_long_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_BIT)
-#error "Non multi-arch definition of TARGET_LONG_BIT"
-#endif
-#if !defined (TARGET_LONG_BIT)
-#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
-#endif
 
 /* Number of bits in a long long or unsigned long long for the target
    machine. */
 
 extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_LONG_BIT)
-#error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
-#endif
-#if !defined (TARGET_LONG_LONG_BIT)
-#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
-#endif
 
 /* The ABI default bit-size and format for "float", "double", and "long
    double".  These bit/format pairs should eventually be combined into
index b729c6b97facb05013869465bfe3232b083f6444..7595a96c57f384286d3849cae8af7b96241b2add 100755 (executable)
@@ -379,14 +379,14 @@ i::const struct target_desc *:target_desc:::::::paddr_d ((long) current_gdbarch-
 # v:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
 #
 # Number of bits in a short or unsigned short for the target machine.
-v:TARGET_SHORT_BIT:int:short_bit:::8 * sizeof (short):2*TARGET_CHAR_BIT::0
+v::int:short_bit:::8 * sizeof (short):2*TARGET_CHAR_BIT::0
 # Number of bits in an int or unsigned int for the target machine.
-v:TARGET_INT_BIT:int:int_bit:::8 * sizeof (int):4*TARGET_CHAR_BIT::0
+v::int:int_bit:::8 * sizeof (int):4*TARGET_CHAR_BIT::0
 # Number of bits in a long or unsigned long for the target machine.
-v:TARGET_LONG_BIT:int:long_bit:::8 * sizeof (long):4*TARGET_CHAR_BIT::0
+v::int:long_bit:::8 * sizeof (long):4*TARGET_CHAR_BIT::0
 # Number of bits in a long long or unsigned long long for the target
 # machine.
-v:TARGET_LONG_LONG_BIT:int:long_long_bit:::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
+v::int:long_long_bit:::8 * sizeof (LONGEST):2*current_gdbarch->long_bit::0
 
 # The ABI default bit-size and format for "float", "double", and "long
 # double".  These bit/format pairs should eventually be combined into
@@ -411,7 +411,7 @@ v:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat **:long_double_format:::::f
 # as well.
 #
 # ptr_bit is the size of a pointer on the target
-v:TARGET_PTR_BIT:int:ptr_bit:::8 * sizeof (void*):TARGET_INT_BIT::0
+v:TARGET_PTR_BIT: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:TARGET_PTR_BIT:
 # Number of bits in a BFD_VMA for the target object file format.
index 9ea7b633fabee12ea13388cadbd4a52b05a2ec42..92d5a39a846255584deb6ac78075d9a41bbc2e1e 100644 (file)
@@ -3434,38 +3434,38 @@ build_gdbtypes (void)
               TYPE_FLAG_UNSIGNED,
               "unsigned char", (struct objfile *) NULL);
   builtin_type_short =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              0,
-              "short", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "short", (struct objfile *) NULL);
   builtin_type_unsigned_short =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned short", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "unsigned short", (struct objfile *) NULL);
   builtin_type_int =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              0,
-              "int", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "int", (struct objfile *) NULL);
   builtin_type_unsigned_int =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned int", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "unsigned int", (struct objfile *) NULL);
   builtin_type_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-              0,
-              "long", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "long", (struct objfile *) NULL);
   builtin_type_unsigned_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned long", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "unsigned long", (struct objfile *) NULL);
   builtin_type_long_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-              0,
-              "long long", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "long long", (struct objfile *) NULL);
   builtin_type_unsigned_long_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, 
               "unsigned long long", (struct objfile *) NULL);
-
   builtin_type_float = build_flt (TARGET_FLOAT_BIT, "float",
                                  TARGET_FLOAT_FORMAT);
   builtin_type_double = build_flt (TARGET_DOUBLE_BIT, "double",
@@ -3629,37 +3629,38 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
               TYPE_FLAG_UNSIGNED,
               "unsigned char", (struct objfile *) NULL);
   builtin_type->builtin_short =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              0,
-              "short", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        0, "short", (struct objfile *) NULL);
   builtin_type->builtin_unsigned_short =
-    init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned short", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        TYPE_FLAG_UNSIGNED, "unsigned short", (struct objfile *) NULL);
   builtin_type->builtin_int =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              0,
-              "int", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        0, "int", (struct objfile *) NULL);
   builtin_type->builtin_unsigned_int =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned int", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        TYPE_FLAG_UNSIGNED, "unsigned int", (struct objfile *) NULL);
   builtin_type->builtin_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-              0,
-              "long", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        0, "long", (struct objfile *) NULL);
   builtin_type->builtin_unsigned_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned long", (struct objfile *) NULL);
+    init_type
+       (TYPE_CODE_INT, gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+        TYPE_FLAG_UNSIGNED, "unsigned long", (struct objfile *) NULL);
   builtin_type->builtin_long_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-              0,
-              "long long", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "long long", (struct objfile *) NULL);
   builtin_type->builtin_unsigned_long_long =
-    init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
-              "unsigned long long", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT,
+              gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              TYPE_FLAG_UNSIGNED, "unsigned long long", 
+              (struct objfile *) NULL);
   builtin_type->builtin_float
     = build_flt (gdbarch_float_bit (gdbarch), "float",
                 gdbarch_float_format (gdbarch));
index 0f4b66aaae5f78a95f5483af93043b0f8d578ac6..8aa66c6721ab93c4525bc11d4a273492a08910cc 100644 (file)
@@ -206,7 +206,7 @@ m2_create_fundamental_type (struct objfile *objfile, int typeid)
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error. */
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "<?type?>", objfile);
       warning (_("internal error: no Modula fundamental type %d"), typeid);
       break;
@@ -242,67 +242,70 @@ m2_create_fundamental_type (struct objfile *objfile, int typeid)
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "short", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "short", objfile);   /* FIXME-fnf */
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "int", objfile);
       break;
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "int", objfile);     /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
       break;
     case FT_FIXED_DECIMAL:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "fixed decimal", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);    /* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
                        0, "long long", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
                        0, "signed long long", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit (current_gdbarch)
+                         / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
@@ -448,11 +451,12 @@ _initialize_m2_language (void)
 {
   /* Modula-2 "pervasive" types.  NOTE:  these can be redefined!!! */
   builtin_type_m2_int =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-              0,
-              "INTEGER", (struct objfile *) NULL);
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+              0, "INTEGER", (struct objfile *) NULL);
   builtin_type_m2_card =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "CARDINAL", (struct objfile *) NULL);
   builtin_type_m2_real =
@@ -464,7 +468,8 @@ _initialize_m2_language (void)
               TYPE_FLAG_UNSIGNED,
               "CHAR", (struct objfile *) NULL);
   builtin_type_m2_bool =
-    init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
+    init_type (TYPE_CODE_BOOL, 
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "BOOLEAN", (struct objfile *) NULL);
 
index c4b6877e75dc0500c83b92b98f3bd618c451cb9e..29bf29afa61ae9ee7df87344139e83f1433ef1b3 100644 (file)
@@ -1046,7 +1046,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
               that too.  */
            if (TYPE_LENGTH (t) == TYPE_NFIELDS (t)
                || TYPE_LENGTH (t) == 0)
-             TYPE_LENGTH (t) = TARGET_INT_BIT / HOST_CHAR_BIT;
+             TYPE_LENGTH (t) = 
+               gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT;
            for (ext_tsym = ext_sh + external_sym_size;
                 ;
                 ext_tsym += external_sym_size)
@@ -4871,7 +4872,7 @@ _initialize_mdebugread (void)
      TYPE_CODE_ERROR print things in hex if it knows the size?  */
   mdebug_type_fixed_dec =
     init_type (TYPE_CODE_INT,
-              TARGET_INT_BIT / TARGET_CHAR_BIT,
+              gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
               0, "fixed decimal",
               (struct objfile *) NULL);
 
@@ -4885,6 +4886,7 @@ _initialize_mdebugread (void)
                                        "<function, no debug info>", NULL);
   TYPE_TARGET_TYPE (nodebug_func_symbol_type) = mdebug_type_int;
   nodebug_var_symbol_type =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
               "<variable, no debug info>", NULL);
 }
index 5f6095b0917229d348c0fadeb6dd8cd2764f04d7..d12a6c28f29cce017055e59f19a1f3e114e3315b 100644 (file)
@@ -1134,16 +1134,16 @@ parse_number (p, len, parsed_float, putithere)
      shift it right and see whether anything remains.  Note that we
      can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
      operation, because many compilers will warn about such a shift
-     (which always produces a zero result).  Sometimes TARGET_INT_BIT
-     or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
+     (which always produces a zero result).  Sometimes gdbarch_int_bit
+     or gdbarch_long_int will be that big, sometimes not.  To deal with
      the case where it is we just always shift the value more than
      once, with fewer bits each time.  */
 
   un = (unsigned LONGEST)n >> 2;
   if (long_p == 0
-      && (un >> (TARGET_INT_BIT - 2)) == 0)
+      && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
+      high_bit = ((unsigned LONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
 
       /* A large decimal (not hex or octal) constant (between INT_MAX
         and UINT_MAX) is a long or unsigned long, according to ANSI,
@@ -1155,16 +1155,16 @@ parse_number (p, len, parsed_float, putithere)
       signed_type = builtin_type_int;
     }
   else if (long_p <= 1
-          && (un >> (TARGET_LONG_BIT - 2)) == 0)
+          && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
+      high_bit = ((unsigned LONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
       unsigned_type = builtin_type_unsigned_long;
       signed_type = builtin_type_long;
     }
   else
     {
       high_bit = (((unsigned LONGEST)1)
-                 << (TARGET_LONG_LONG_BIT - 32 - 1)
+                 << (gdbarch_long_long_bit (current_gdbarch) - 32 - 1)
                  << 16
                  << 16);
       if (high_bit == 0)
index 261e818c1e5744037c818991fd9546d1fc8da84b..53c2f38137d51b4c299e50ee7154c3d05940a9b1 100644 (file)
@@ -461,7 +461,7 @@ objc_create_fundamental_type (struct objfile *objfile, int typeid)
           the type reconstruction work, this should probably become
           an error.  */
        type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "<?type?>", objfile);
         warning (_("internal error: no C/C++ fundamental type %d"), typeid);
        break;
@@ -487,62 +487,65 @@ objc_create_fundamental_type (struct objfile *objfile, int typeid)
        break;
       case FT_SHORT:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "short", objfile);
        break;
       case FT_SIGNED_SHORT:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "short", objfile); /* FIXME-fnf */
        break;
       case FT_UNSIGNED_SHORT:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
        break;
       case FT_INTEGER:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "int", objfile);
        break;
       case FT_SIGNED_INTEGER:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "int", objfile); /* FIXME -fnf */
        break;
       case FT_UNSIGNED_INTEGER:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
+                         gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
        break;
       case FT_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "long", objfile);
        break;
       case FT_SIGNED_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          0, "long", objfile); /* FIXME -fnf */
        break;
       case FT_UNSIGNED_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                          TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
        break;
       case FT_LONG_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_long_bit (current_gdbarch)
+                           / TARGET_CHAR_BIT,
                          0, "long long", objfile);
        break;
       case FT_SIGNED_LONG_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_long_bit (current_gdbarch)
+                           / TARGET_CHAR_BIT,
                          0, "signed long long", objfile);
        break;
       case FT_UNSIGNED_LONG_LONG:
        type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                         gdbarch_long_long_bit (current_gdbarch)
+                           / TARGET_CHAR_BIT,
                          TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
        break;
       case FT_FLOAT:
index 68e1a15e9e7d5902761ef9a988b8113bd295ea7b..683444132c9997797b6746403203fef16d1eddaf 100644 (file)
@@ -909,16 +909,16 @@ parse_number (p, len, parsed_float, putithere)
      shift it right and see whether anything remains.  Note that we
      can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
      operation, because many compilers will warn about such a shift
-     (which always produces a zero result).  Sometimes TARGET_INT_BIT
-     or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
+     (which always produces a zero result).  Sometimes gdbarch_int_bit
+     or gdbarch_long_bit will be that big, sometimes not.  To deal with
      the case where it is we just always shift the value more than
      once, with fewer bits each time.  */
 
   un = (ULONGEST)n >> 2;
   if (long_p == 0
-      && (un >> (TARGET_INT_BIT - 2)) == 0)
+      && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
 
       /* A large decimal (not hex or octal) constant (between INT_MAX
         and UINT_MAX) is a long or unsigned long, according to ANSI,
@@ -930,20 +930,21 @@ parse_number (p, len, parsed_float, putithere)
       signed_type = builtin_type_int;
     }
   else if (long_p <= 1
-          && (un >> (TARGET_LONG_BIT - 2)) == 0)
+          && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
     {
-      high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+      high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
       unsigned_type = builtin_type_unsigned_long;
       signed_type = builtin_type_long;
     }
   else
     {
       int shift;
-      if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+      if (sizeof (ULONGEST) * HOST_CHAR_BIT
+         < gdbarch_long_long_bit (current_gdbarch))
        /* A long long does not fit in a LONGEST.  */
        shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
       else
-       shift = (TARGET_LONG_LONG_BIT - 1);
+       shift = (gdbarch_long_long_bit (current_gdbarch) - 1);
       high_bit = (ULONGEST) 1 << shift;
       unsigned_type = builtin_type_unsigned_long_long;
       signed_type = builtin_type_long_long;
index 767718c66e78cccb9e24f5f3ce5f450b5d1fdccb..d4acd263a4a257c4acc2974308911acac46f2c49 100644 (file)
@@ -287,7 +287,7 @@ pascal_create_fundamental_type (struct objfile *objfile, int typeid)
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error. */
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "<?type?>", objfile);
       warning (_("internal error: no Pascal fundamental type %d"), typeid);
       break;
@@ -313,62 +313,65 @@ pascal_create_fundamental_type (struct objfile *objfile, int typeid)
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "integer", objfile);         /* FIXME-fnf */
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "word", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "longint", objfile);
       break;
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "longint", objfile);         /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "cardinal", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long", objfile);    /* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit
+                         (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "long long", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit
+                         (current_gdbarch) / TARGET_CHAR_BIT,
                        0, "signed long long", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       gdbarch_long_long_bit
+                         (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
index a2f8c026aa22bce4a44199056f9f49b2a4c4cf34..3284af3cdfb677f84cd3b24ccfa9cb645a612d6c 100644 (file)
@@ -1185,7 +1185,8 @@ build_parse (void)
     init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
   TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
   msym_data_symbol_type =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
               "<data variable, no debug info>", NULL);
   msym_unknown_symbol_type =
     init_type (TYPE_CODE_INT, 1, 0,
@@ -1193,7 +1194,8 @@ build_parse (void)
               NULL);
 
   msym_tls_symbol_type =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
               "<thread local variable, no debug info>", NULL);
 }
 
index 5d3da16376dd8f2ab527fe6dac96bdfd3ef2d675..75bb5f0080ee0880761dbf35940a73149d89be45 100644 (file)
@@ -984,12 +984,14 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
          /* Call it "int" because this is mainly C lossage.  */
          if (pcc_promotion_type == NULL)
            pcc_promotion_type =
-             init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+             init_type (TYPE_CODE_INT, 
+                        gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         0, "int", NULL);
 
          if (pcc_unsigned_promotion_type == NULL)
            pcc_unsigned_promotion_type =
-             init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+             init_type (TYPE_CODE_INT, 
+                        gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                         TYPE_FLAG_UNSIGNED, "unsigned int", NULL);
 
          /* If PCC says a parameter is a short or a char, it is
@@ -2840,7 +2842,8 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p,
       if ((FIELD_BITSIZE (fip->list->field)
           == TARGET_CHAR_BIT * TYPE_LENGTH (field_type)
           || (TYPE_CODE (field_type) == TYPE_CODE_ENUM
-              && FIELD_BITSIZE (fip->list->field) == TARGET_INT_BIT)
+              && FIELD_BITSIZE (fip->list->field)
+                 == gdbarch_int_bit (current_gdbarch))
          )
          &&
          FIELD_BITPOS (fip->list->field) % 8 == 0)
@@ -3533,7 +3536,7 @@ read_enum_type (char **pp, struct type *type,
 
   /* Now fill in the fields of the type-structure.  */
 
-  TYPE_LENGTH (type) = TARGET_INT_BIT / HOST_CHAR_BIT;
+  TYPE_LENGTH (type) = gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT;
   TYPE_CODE (type) = TYPE_CODE_ENUM;
   TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
   if (unsigned_enum)
@@ -3958,7 +3961,8 @@ read_range_type (char **pp, int typenums[2], int type_size,
       /* It is unsigned int or unsigned long.  */
       /* GCC 2.3.3 uses this for long long too, but that is just a GDB 3.5
          compatibility hack.  */
-      return init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+      return init_type (TYPE_CODE_INT, 
+                       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, NULL, objfile);
     }
 
@@ -4000,7 +4004,8 @@ read_range_type (char **pp, int typenums[2], int type_size,
      of self_subrange.  */
   else if (n3 == 0 && n2 < 0
           && (self_subrange
-              || n2 == -TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT))
+              || n2 == -gdbarch_long_long_bit
+                         (current_gdbarch) / TARGET_CHAR_BIT))
     return init_type (TYPE_CODE_INT, -n2, 0, NULL, objfile);
   else if (n2 == -n3 - 1)
     {
@@ -4031,7 +4036,8 @@ handle_true_range:
                 _("base type %d of range type is not defined"), rangenums[1]);
       if (range_type_index == NULL)
        range_type_index =
-         init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+         init_type (TYPE_CODE_INT, 
+                    gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
                     0, "range type index type", NULL);
       index_type = range_type_index;
     }
index 8e204e15bedfec556572bc097c4dc57c08cbdcc8..fac4c87ea0669940a3cc6288ef60834113645294 100644 (file)
@@ -3530,7 +3530,8 @@ enum ovly_index
   {
     VMA, SIZE, LMA, MAPPED
   };
-#define TARGET_LONG_BYTES (TARGET_LONG_BIT / TARGET_CHAR_BIT)
+#define TARGET_LONG_BYTES (gdbarch_long_bit (current_gdbarch) \
+                           / TARGET_CHAR_BIT)
 
 /* Throw away the cached copy of _ovly_table */
 static void
index b5c69e3535666b46217f681a1c4c096650975b19..90679740ad558280f06ab98889f01dd06d3e305b 100644 (file)
@@ -1028,7 +1028,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
          /* Can't just call init_type because we wouldn't know what
             name to give the type.  */
          val = allocate_value
-           (result_len > TARGET_LONG_BIT / HOST_CHAR_BIT
+           (result_len > gdbarch_long_bit (current_gdbarch) / HOST_CHAR_BIT
             ? builtin_type_unsigned_long_long
             : builtin_type_unsigned_long);
          store_unsigned_integer (value_contents_raw (val),
@@ -1153,7 +1153,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
          /* Can't just call init_type because we wouldn't know what
             name to give the type.  */
          val = allocate_value
-           (result_len > TARGET_LONG_BIT / HOST_CHAR_BIT
+           (result_len > gdbarch_long_bit (current_gdbarch) / HOST_CHAR_BIT
             ? builtin_type_long_long
             : builtin_type_long);
          store_signed_integer (value_contents_raw (val),
index 849692bc32cda45496aea3d1a8f990ad23dea8c4..8c8208ef51be3ab049c3fa176a5a78ab63f927ea 100644 (file)
@@ -3027,6 +3027,7 @@ _initialize_xcoffread (void)
                                "<function, no debug info>", NULL);
   TYPE_TARGET_TYPE (func_symbol_type) = builtin_type_int;
   var_symbol_type =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
               "<variable, no debug info>", NULL);
 }