Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: twall@oculustech.com
Cc: gdb@sources.redhat.com
Subject: Re: packing/unpacking 4-octet longs
Date: Wed, 05 Dec 2001 10:03:00 -0000	[thread overview]
Message-ID: <3C0E617F.7020506@cygnus.com> (raw)
In-Reply-To: <3C0E5A06.8F79CFB4@oculustech.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.

(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






  reply	other threads:[~2001-12-05 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04  5:44 Timothy Wall
2001-12-05  8:26 ` Andrew Cagney
2001-12-05  8:46   ` Richard Earnshaw
2001-12-05 10:11     ` Lars Brinkhoff
2001-12-05 10:42     ` Andrew Cagney
2001-12-06  2:03       ` Richard Earnshaw
2001-12-05  9:31   ` Timothy Wall
2001-12-05 10:03     ` Andrew Cagney [this message]
2001-12-05 10:20       ` Timothy Wall
2001-12-05 10:49         ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C0E617F.7020506@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=twall@oculustech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox