This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] [1/2] Remove macros TARGET_{SHORT,INT,LONG,LONG_LONG}_BIT


Hallo Ulrich,

Ulrich Weigand wrote:
Markus Deuling wrote:

this patch removes following macros from gdbarch.sh:

* TARGET_SHORT_BIT
* TARGET_INT_BIT
* TARGET_LONG_BIT
* TARGET_LONG_LONG_BIT

Just some minor formatting issues:


- high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
This adds one space too many.


-      if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+      if (sizeof (ULONGEST) * HOST_CHAR_BIT < gdbarch_long_long_bit
+						(current_gdbarch))
I'd rather write this as
      if (sizeof (ULONGEST) * HOST_CHAR_BIT
          < gdbarch_long_long_bit (current_gdbarch))

-	  && 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))
Likewise.

- && 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))
Likewise.


- 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 */
Line too long.


-      if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+      if (sizeof (ULONGEST) * HOST_CHAR_BIT < gdbarch_long_long_bit
+						(current_gdbarch))
See above.

- && FIELD_BITSIZE (fip->list->field) == TARGET_INT_BIT)
+ && FIELD_BITSIZE + (fip->list->field) == gdbarch_int_bit (current_gdbarch))
I'd rather write this as:
FIELD_BITSIZE (fip->list->field)
== gdbarch_int_bit (current_gdbarch)


-#define TARGET_LONG_BYTES (TARGET_LONG_BIT / TARGET_CHAR_BIT)
+#define TARGET_LONG_BYTES (gdbarch_long_bit (current_gdbarch) \
+  / TARGET_CHAR_BIT)
Indentation.

Otherwise this looks fine to me. (It does conflict heavily with my
builtin_type cleanup patch series, unfortunately ... But I guess
your patch still should go first, and I'll update mine accordingly.)


Bye,
Ulrich


thank you for your review. I attached the new version of the patch.



-- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com

diff -urN src/gdb/ada-lang.c dev/gdb/ada-lang.c
--- src/gdb/ada-lang.c	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/ada-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -10198,7 +10198,7 @@
          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 @@
       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 @@
     = 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 @@
     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] =
diff -urN src/gdb/ada-lex.l dev/gdb/ada-lex.l
--- src/gdb/ada-lex.l	2007-01-09 18:58:49.000000000 +0100
+++ dev/gdb/ada-lex.l	2007-06-12 16:16:31.000000000 +0200
@@ -341,11 +341,11 @@
       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
diff -urN src/gdb/c-exp.y dev/gdb/c-exp.y
--- src/gdb/c-exp.y	2007-06-06 05:21:54.000000000 +0200
+++ dev/gdb/c-exp.y	2007-06-12 16:23:23.000000000 +0200
@@ -1194,16 +1194,16 @@
      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 @@
       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;
diff -urN src/gdb/c-lang.c dev/gdb/c-lang.c
--- src/gdb/c-lang.c	2007-05-07 13:49:04.000000000 +0200
+++ dev/gdb/c-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -219,7 +219,7 @@
          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 @@
       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:
diff -urN src/gdb/coffread.c dev/gdb/coffread.c
--- src/gdb/coffread.c	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/coffread.c	2007-06-12 16:24:52.000000000 +0200
@@ -1809,7 +1809,8 @@
 
     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 @@
 
     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 @@
 
   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 *)
diff -urN src/gdb/dwarf2read.c dev/gdb/dwarf2read.c
--- src/gdb/dwarf2read.c	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/dwarf2read.c	2007-06-12 16:16:31.000000000 +0200
@@ -7153,8 +7153,9 @@
 	     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)
diff -urN src/gdb/f-exp.y dev/gdb/f-exp.y
--- src/gdb/f-exp.y	2007-01-09 18:58:50.000000000 +0100
+++ dev/gdb/f-exp.y	2007-06-12 16:26:07.000000000 +0200
@@ -766,23 +766,24 @@
      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;
     }    
diff -urN src/gdb/f-lang.c dev/gdb/f-lang.c
--- src/gdb/f-lang.c	2007-01-09 18:58:50.000000000 +0100
+++ dev/gdb/f-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -285,67 +285,70 @@
       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 @@
          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 @@
 	       "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,
diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.c	2007-06-12 16:16:31.000000000 +0200
@@ -401,11 +401,11 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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));
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.h	2007-06-12 16:16:31.000000000 +0200
@@ -87,46 +87,22 @@
 
 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
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh	2007-06-11 11:31:56.000000000 +0200
+++ dev/gdb/gdbarch.sh	2007-06-12 16:16:31.000000000 +0200
@@ -379,14 +379,14 @@
 # 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 @@
 # 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.
diff -urN src/gdb/gdbtypes.c dev/gdb/gdbtypes.c
--- src/gdb/gdbtypes.c	2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbtypes.c	2007-06-12 16:16:31.000000000 +0200
@@ -3434,38 +3434,38 @@
 	       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 @@
 	       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));
diff -urN src/gdb/m2-lang.c dev/gdb/m2-lang.c
--- src/gdb/m2-lang.c	2007-01-09 18:58:51.000000000 +0100
+++ dev/gdb/m2-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -206,7 +206,7 @@
          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 @@
       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 @@
 {
   /* 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 @@
 	       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);
 
diff -urN src/gdb/mdebugread.c dev/gdb/mdebugread.c
--- src/gdb/mdebugread.c	2007-01-09 18:58:52.000000000 +0100
+++ dev/gdb/mdebugread.c	2007-06-12 16:16:31.000000000 +0200
@@ -1046,7 +1046,8 @@
 	       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 @@
      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 @@
 					"<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);
 }
diff -urN src/gdb/objc-exp.y dev/gdb/objc-exp.y
--- src/gdb/objc-exp.y	2007-01-09 18:58:55.000000000 +0100
+++ dev/gdb/objc-exp.y	2007-06-12 16:16:31.000000000 +0200
@@ -1134,16 +1134,16 @@
      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 @@
       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)
diff -urN src/gdb/objc-lang.c dev/gdb/objc-lang.c
--- src/gdb/objc-lang.c	2007-06-11 11:31:58.000000000 +0200
+++ dev/gdb/objc-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -461,7 +461,7 @@
 	   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 @@
 	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:
diff -urN src/gdb/parse.c dev/gdb/parse.c
--- src/gdb/parse.c	2007-06-06 05:21:54.000000000 +0200
+++ dev/gdb/parse.c	2007-06-12 16:16:31.000000000 +0200
@@ -1185,7 +1185,8 @@
     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 @@
 	       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);
 }
 
diff -urN src/gdb/p-exp.y dev/gdb/p-exp.y
--- src/gdb/p-exp.y	2007-01-09 18:58:55.000000000 +0100
+++ dev/gdb/p-exp.y	2007-06-12 16:27:11.000000000 +0200
@@ -909,16 +909,16 @@
      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 @@
       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;
diff -urN src/gdb/p-lang.c dev/gdb/p-lang.c
--- src/gdb/p-lang.c	2007-01-09 18:58:55.000000000 +0100
+++ dev/gdb/p-lang.c	2007-06-12 16:16:31.000000000 +0200
@@ -287,7 +287,7 @@
          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 @@
       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:
diff -urN src/gdb/stabsread.c dev/gdb/stabsread.c
--- src/gdb/stabsread.c	2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/stabsread.c	2007-06-12 16:28:49.000000000 +0200
@@ -984,12 +984,14 @@
 	  /* 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 @@
       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 @@
 
   /* 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 @@
       /* 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 @@
      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 @@
 		 _("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;
     }
diff -urN src/gdb/symfile.c dev/gdb/symfile.c
--- src/gdb/symfile.c	2007-05-11 21:57:17.000000000 +0200
+++ dev/gdb/symfile.c	2007-06-12 16:29:47.000000000 +0200
@@ -3530,7 +3530,8 @@
   {
     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
diff -urN src/gdb/valarith.c dev/gdb/valarith.c
--- src/gdb/valarith.c	2007-01-09 18:58:59.000000000 +0100
+++ dev/gdb/valarith.c	2007-06-12 16:16:31.000000000 +0200
@@ -1028,7 +1028,7 @@
 	  /* 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 @@
 	  /* 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),
diff -urN src/gdb/xcoffread.c dev/gdb/xcoffread.c
--- src/gdb/xcoffread.c	2007-01-09 18:58:59.000000000 +0100
+++ dev/gdb/xcoffread.c	2007-06-12 16:16:32.000000000 +0200
@@ -3027,6 +3027,7 @@
 				"<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);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]