diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2010-06-19 17:36:51 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2010-06-19 17:36:51 +0000 |
commit | d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0 (patch) | |
tree | 321615fd866fdd7f688d14fbf8b62ba1de12ff36 /gdb/spu-tdep.h | |
parent | fbece226ba5bc19f942384f8a048eba3bd92f99a (diff) | |
download | gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.zip gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.tar.gz gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.tar.bz2 |
ChangeLog:
* spu-multiarch.c (spu_xfer_partial): Wrap around local store
limit on local store memory accesses.
* spu-linux-nat.c (spu_xfer_partial): Likewise.
* spu-tdep.c (spu_lslr): Remove.
(spu_pointer_to_address): Do not truncate addresses.
(spu_integer_to_address): Likewise.
(spu_overlay_new_objfile): Use SPU_OVERLAY_LMA.
* spu-tdep.h: Add comments.
(SPUADDR_SPU): Respect SPU_OVERLAY_LMA bit.
(SPU_OVERLAY_LMA): Define.
gdbserver/ChangeLog:
* spu-low.c (spu_read_memory): Wrap around local store limit.
(spu_write_memory): Likewise.
testsuite/ChangeLog:
* gdb.arch/spu-ls.exp: New file.
* gdb.arch/spu-ls.c: Likewise.
Diffstat (limited to 'gdb/spu-tdep.h')
-rw-r--r-- | gdb/spu-tdep.h | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/gdb/spu-tdep.h b/gdb/spu-tdep.h index 9e70db9..4b83f74 100644 --- a/gdb/spu-tdep.h +++ b/gdb/spu-tdep.h @@ -50,14 +50,71 @@ enum spu_regnum /* Local store. */ #define SPU_LS_SIZE 0x40000 -/* Address conversions. */ +/* Address conversions. + + In a combined PPU/SPU debugging session, we have to consider multiple + address spaces: the PPU 32- or 64-bit address space, and the 32-bit + local store address space for each SPU context. As it is currently + not yet possible to use the program_space / address_space mechanism + to represent this, we encode all those addresses into one single + 64-bit address for the whole process. For SPU programs using overlays, + this address space must also include separate ranges reserved for the + LMA of overlay sections. + + + The following combinations are supported for combined debugging: + + PPU address (this relies on the fact that PPC 64-bit user space + addresses can never have the highest-most bit set): + + +-+---------------------------------+ + |0| ADDR [63] | + +-+---------------------------------+ + + SPU address for SPU context with id SPU (this assumes that SPU + IDs, which are file descriptors, are never larger than 2^30): + + +-+-+--------------+----------------+ + |1|0| SPU [30] | ADDR [32] | + +-+-+--------------+----------------+ + + SPU overlay section LMA for SPU context with id SPU: + + +-+-+--------------+----------------+ + |1|1| SPU [30] | ADDR [32] | + +-+-+--------------+----------------+ + + + In SPU stand-alone debugging mode (using spu-linux-nat.c), + the following combinations are supported: + + SPU address: + + +-+-+--------------+----------------+ + |0|0| 0 | ADDR [32] | + +-+-+--------------+----------------+ + + SPU overlay section LMA: + + +-+-+--------------+----------------+ + |0|1| 0 | ADDR [32] | + +-+-+--------------+----------------+ + + + The following macros allow manipulation of addresses in the + above formats. */ + #define SPUADDR(spu, addr) \ ((spu) != -1? (ULONGEST)1 << 63 | (ULONGEST)(spu) << 32 | (addr) : (addr)) + #define SPUADDR_SPU(addr) \ (((addr) & (ULONGEST)1 << 63) \ - ? (int) ((ULONGEST)(addr) >> 32 & 0x7fffffff) \ + ? (int) ((ULONGEST)(addr) >> 32 & 0x3fffffff) \ : -1) + #define SPUADDR_ADDR(addr) \ (((addr) & (ULONGEST)1 << 63)? (ULONGEST)(addr) & 0xffffffff : (addr)) +#define SPU_OVERLAY_LMA ((ULONGEST)1 << 62) + #endif |