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.

(I'm trying to avoid using the word byte it is dangerous :-)

So the architecture is really this hybrid 8bit/16bit thing where low 
bits of the address are used to imply an interpretation of the data.  Ulgh.

Can this be represented as another hybrid integer type - two 16 bit 
words unpacked in a very strange way?

The other (I'm not so sure about) possability is, since GDB must read in 
16bit chunks, modify it to mimic the hardware and 8bit swap things on 
the way in/out.

On this, what will happen with an 8bit character.  Won't GDB need to 
read/modify/write such a value?

	Andrew






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