This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: packing/unpacking 4-octet longs
- From: Timothy Wall <twall at oculustech dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 05 Dec 2001 12:31:42 -0500
- Subject: Re: packing/unpacking 4-octet longs
- Organization: Oculus Technologies
- References: <3C0CD32D.A118C5A0@oculustech.com> <3C0E4A96.6070601@cygnus.com>
- Reply-to: twall at oculustech dot com
Andrew Cagney wrote:
>
> Regarding the hard case, when you say that the byte order switches at an
> odd address. Is this an odd word address or an odd byte address?
>
In this case the word address is the same as the byte address. One byte = 16
bits, i.e.
octets are not addressable.
So if you read a long (two words) from address 0x1000, the DSP grabs the MSW from
0x1000,
and the LSW from 0x1001. If you read a long from address 0x2001, the DSP grabs
the MSW from
0x2001, and the LSW from 0x2000.
So in addition to ensuring that the data read by GDB for a long is aligned, I need
to swap words
if the original address wasn't aligned.
T.