This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: wrong htons() used?


The problem is in tm-arm.h.  It defines TARGET_BYTE_ORDER_SELECTABLE. 
The compatibility code in gdbarch.c 
defaults to big endian (see line 2777).  Add the following to tm-arm.h:

#define TARGET_BYTE_ORDER_DEFAULT       LITTLE_ENDIAN

I think this will fix your problem.  I have fixed this while merging my
target code for Linux with the current ARM target code.  I have
defaulted the embedded targets to LITTLE_ENDIAN.  Any objections.

Scott

Grant.Edwards@comtrol.com wrote:
> 
> When gdb is built for target arm-elf on a linux i386, it uses
> the wrong htons() definition when building stuff in the
> rdi-share directory. The proper behavior of htons() on a i386
> system is to swap the two bytes.  In arm-elf-gdb, it doesn't.
> 
> I assume that what is happening is that it's using the htons()
> that would be applicible if gdb was going to execute on an
> big-endian ARM architecture, but I can't figure out where this
> happens...
> 
> Any pointers?
> 
> --
> Grant Edwards
> Grant.Edwards@comtrol.com

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