From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18526 invoked by alias); 5 Dec 2001 18:03:51 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18436 invoked from network); 5 Dec 2001 18:03:45 -0000 Received: from unknown (HELO localhost.cygnus.com) (216.138.202.10) by sources.redhat.com with SMTP; 5 Dec 2001 18:03:45 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 54DB73D5E; Wed, 5 Dec 2001 13:03:43 -0500 (EST) Message-ID: <3C0E617F.7020506@cygnus.com> Date: Wed, 05 Dec 2001 10:03:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: twall@oculustech.com Cc: gdb@sources.redhat.com Subject: Re: packing/unpacking 4-octet longs References: <3C0CD32D.A118C5A0@oculustech.com> <3C0E4A96.6070601@cygnus.com> <3C0E5A06.8F79CFB4@oculustech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00038.txt.bz2 > 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