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


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

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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