From: Richard Stuckey <richard.stuckey@arc.com>
To: gdb@sourceware.org
Subject: gdb 6.8 selected_byte_order function
Date: Wed, 24 Sep 2008 10:59:00 -0000 [thread overview]
Message-ID: <1222253904.3506.12.camel@sad-richards.arc.com> (raw)
Hello,
I am currently moving the ARC port of gdb from 6.6 on to 6.8, and I am a
little puzzled by the selected_byte_order function in file arch-utils.c;
I wonder if anyone could perhaps enlighten me about it.
The 6.8 code (this function did not exist in 6.6) is
enum bfd_endian
selected_byte_order (void)
{
if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
return gdbarch_byte_order (current_gdbarch);
else
return BFD_ENDIAN_UNKNOWN;
}
Given that that the variable ‘target_byte_order_user ‘ holds the user’s
preference as specified by the “set endian” command, it seems to me that
the code should be
if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
return target_byte_order_user;
else
return gdbarch_byte_order (current_gdbarch);
i.e. if the user has explicitly specified the byte order then we use
that, otherwise we use the order determined from the current
architecture.
I can see from the Changelogs, and various pages on the web (like
http://sourceware.org/ml/gdb-patches/2006-11/msg00052.html), that this
function has a history of change – so apologies if I have missed out on
all the reasoning that has led to the current version of the code!
Regards,
Richard Stuckey
next reply other threads:[~2008-09-24 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 10:59 Richard Stuckey [this message]
2008-09-24 13:08 ` Daniel Jacobowitz
2008-09-24 13:37 ` Richard Stuckey
2008-09-24 13:49 ` Daniel Jacobowitz
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=1222253904.3506.12.camel@sad-richards.arc.com \
--to=richard.stuckey@arc.com \
--cc=gdb@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