This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: RDI target broken in 000215 snapshot
FYI,
The current behavior is determined by gdbarch.c:
o it starts in auto mode using
TARGET_BYTE_ORDER_DEFAULT as an
initial value or (chosen arbitrarily)
BIG_ENDIAN as the next best guess.
o as soon as GDB encounters a binary
it pokes around the bfd file to determine
the endianess and uses that (provided things
are still auto).
To the best of my knowledge, no one has seriously investigated how to
set up an interface where the target determines architectural
information (such as endianess).
As for the current problem:
$ arm-elf-gdb
GNU gdb 4.18
[...]
This GDB was configured as "--host=i586-pc-linux-gnu --target=arm-elf".
(gdb) target rdi /dev/ttyS1
EmbeddedICE Manager (ADP, ARM7TDI) 2.07 (Advanced RISC Machines SDT
2.11a)
Rebuilt on Apr 1 1998 at 00:43:57
Serial Rate: 9600
Connected to ARM RDI target.
(gdb) show endian
The target endianness is set automatically (currently big endian)
$ ~/gdb-000222/gdb/gdb
GNU gdb 000222
[...]
This GDB was configured as "--host=i586-pc-linux-gnu --target=arm-elf".
(gdb) target rdi /dev/ttyS1
EmbeddedICE Manager (ADP, ARM7TDI) 2.07 (Advanced RISC Machines SDT
2.11a)
Rebuilt on Apr 1 1998 at 00:43:57
Serial Rate: 9600
Connected to ARM RDI target.
(gdb) show endian
The target endianness is set automatically (currently little endian)
it looks like TARGET_BYTE_ORDER_DEFAULT was changed or added in the
wrong place.
enjoy,
Andrew
Fernando Nasser wrote:
>
> Grant Edwards wrote:
> >
> > I had assumed that gdb was detecting the endianness of the
> > target already (before today, I didn't know it was user
> > selectable). I'll take a look at make the "auto" mode pay
> > attention to the target hardware indication. One could then
> > generate a warning if the endiannes of the target and the
> > endianness of a file being loaded disagree.
> >
> Good idea. If the endianess is set to auto, then you set it appropriately.
> If not, and it differs from the target, a warning is in order.
> You got no indication at all that something was wrong.
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@cygnus.com
> 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
> Toronto, Ontario M4P 2C9 Fax: 416-482-6299