Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb 6.8 selected_byte_order function
@ 2008-09-24 10:59 Richard Stuckey
  2008-09-24 13:08 ` Daniel Jacobowitz
  2008-09-24 13:37 ` Richard Stuckey
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Stuckey @ 2008-09-24 10:59 UTC (permalink / raw)
  To: gdb

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 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-24 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-24 10:59 gdb 6.8 selected_byte_order function Richard Stuckey
2008-09-24 13:08 ` Daniel Jacobowitz
2008-09-24 13:37 ` Richard Stuckey
2008-09-24 13:49   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox