This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: wrong htons() used?
- Subject: Re: wrong htons() used?
- From: Scott Bambrough <scottb at netwinder dot org>
- Date: Thu, 21 Oct 1999 17:09:05 -0400
- CC: gdb at sourceware dot cygnus dot com
- Organization: Rebel.com
- References: <19991021151610.A3919@comtrol.com>
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