This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

Re: packing/unpacking 4-octet longs




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.


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