Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling)
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [rfc] [1/2] Remove macros TARGET_{SHORT,INT,LONG,LONG_LONG}_BIT
Date: Tue, 12 Jun 2007 14:16:00 -0000	[thread overview]
Message-ID: <200706121416.l5CEGL57024154@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <46692E6E.6090809@de.ibm.com> from "Markus Deuling" at Jun 08, 2007 12:24:46 PM

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


  reply	other threads:[~2007-06-12 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 10:26 Markus Deuling
2007-06-12 14:16 ` Ulrich Weigand [this message]
2007-06-12 14:33   ` Markus Deuling
2007-06-12 15:38     ` Ulrich Weigand
2007-06-12 16:37       ` Markus Deuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200706121416.l5CEGL57024154@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox