From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling)
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [patch]: Add endianess to valprint routines
Date: Tue, 20 May 2008 17:48:00 -0000 [thread overview]
Message-ID: <200805201524.m4KFOMQE011363@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <48314BC3.4040207@de.ibm.com> from "Markus Deuling" at May 19, 2008 11:43:31 AM
Markus Deuling wrote:
> * valprint.c (print_hex_chars, print_octal_chars, print_decimal_chars,
> print_binary_chars, print_char_chars): Add endianess parameter and
> replace gdbarch_byte_order.
> (val_print_type_code_int): Introduce gdbarch_byte_order to get at the
> endianness. Update call to print_hex_chars.
> * valprint.h (print_hex_chars, print_octal_chars, print_decimal_chars,
> print_binary_chars, print_char_chars): Add endianess parameter.
> * printcmd.c (print_scalar_formatted): Introduce gdbarch_byte_order to
> get at the endianness. Update print_*_char calls to use endianness.
This is basically OK, except for:
> #define START_P \
> - ((gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1)
> + ((endianness == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1)
> #define NOT_END_P \
> - ((gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
> + ((endianness == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
> #define NEXT_P \
> - ((gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG) ? p++ : p-- )
> + ((endianness == BFD_ENDIAN_BIG) ? p++ : p-- )
Can we please avoid having macros that implicitly access local variables?
As a minor nit, calling those variables "byte_order" instead of
"endianness" seems to be more common usage in GDB.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2008-05-20 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 15:19 Markus Deuling
2008-05-20 17:48 ` Ulrich Weigand [this message]
2008-05-21 16:45 ` Markus Deuling
2008-05-21 18:35 ` Ulrich Weigand
2008-05-23 16:32 ` 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=200805201524.m4KFOMQE011363@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