From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: stan@codesourcery.com (Stan Shebs)
Cc: dje@google.com (Doug Evans), gdb@sourceware.org
Subject: Re: Address spaces
Date: Thu, 24 Jul 2008 20:31:00 -0000 [thread overview]
Message-ID: <200807241827.m6OIRcJo010808@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <4888C0CE.8000502@codesourcery.com> from "Stan Shebs" at Jul 24, 2008 10:50:06 AM
Stan Shebs wrote:
> Is this code in the GDB sources now? I'm not seeing anything obvious.
Not yet; I'm still working on cleaning it up ...
> But I'm guessing you mean that there can be a main() for the PPE and a
> main() for each SPE, and that they can all be literally at 0x12480, but
> since GDB wouldn't like that you have to do trickery in the target
> before anything is delivered to GDB?
Yes, exactly. For address encoding into CORE_ADDR I'm using this:
#define SPUADDR(spu, addr) \
((spu) && !spu_standalone_p ()? \
(((ULONGEST)1 << 63) | ((ULONGEST)(spu)) << 32 | (addr)) : (addr))
#define SPUADDR_SPU(addr) \
(((addr) & ((ULONGEST)1 << 63))? (((ULONGEST)(addr) >> 32) & 0x7fffffff) : 0)
#define SPUADDR_ADDR(addr) \
(((addr) & ((ULONGEST)1 << 63))? ((ULONGEST)(addr) & 0xffffffff) : (addr))
I.e. CORE_ADDR values with MSB 0 encode regular PowerPC addresses, while
CORE_ADDR values with MSB 1 encode a tuple of SPU context ID + local store
address (this works as SPU IDs are basically file descriptors and local
store addresses are limited to 18 bits) ...
I'm using a special "shared library" target to re-map the SPU executables
at the mangled addresses as far as GDB core is concerned. A special target
stack implements a xfer_partial that unmangles addresses and accesses either
PowerPC memory or some SPU local store, as appropriate ...
If you're interested into more details, I'll be happy to send you my
current patchset.
What does *not* work satisfactorily in all circumstances right now are user
interface issues. I don't want to expose the mangled CORE_ADDR to the user,
so the extra bits are stripped via gdbarch_addr_bits, and reinserted by the
gdbarch_integer_to_pointer family of functions, based on whether the currently
selected frame is SPU or PowerPC code.
This makes it e.g. impossible to input a PowerPC address while in a SPU frame,
which would be useful occasionally. To do that right we'd have to expose a
user interface mechanism to select address spaces, though.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2008-07-24 18:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-24 0:14 Stan Shebs
2008-07-24 0:30 ` Doug Evans
2008-07-24 6:15 ` Stan Shebs
2008-07-24 15:56 ` Ulrich Weigand
2008-07-24 18:17 ` Stan Shebs
2008-07-24 18:28 ` Doug Evans
2008-07-25 5:52 ` Michael Snyder
2008-07-25 8:50 ` Jeremy Bennett
2008-07-24 20:31 ` Ulrich Weigand [this message]
2008-07-25 18:50 ` Stan Shebs
2008-07-25 3:31 ` Michael Snyder
2008-07-24 21:49 ` Paul Pluzhnikov
2008-07-25 3:29 ` Michael Snyder
2008-07-25 18:32 ` Stan Shebs
2008-07-25 19:13 ` Mark Kettenis
2008-07-25 19:24 ` Stan Shebs
2008-07-31 18:43 ` 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=200807241827.m6OIRcJo010808@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=dje@google.com \
--cc=gdb@sourceware.org \
--cc=stan@codesourcery.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