This is the mail archive of the gdb-patches@sourceware.org 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: [rfc] Wrap addresses in spu-gdb


Hi,

Ulrich Weigand schrieb:
Well, I'm seeing these regressions:
actually. I must have overseen these two.

FAIL: gdb.cp/cp-relocate.exp: break *'int func<1>(int)'
FAIL: gdb.cp/cp-relocate.exp: break *'int func<2>(int)'
Could you investigate those?

In the gdb.cp/cp-relocate.exp testcase "add-symbol-file" tries to load two sections of an objfile at hard-wired addresses 0x40000 and 0x80000.


Within SPU these addresses are wrapped to the size of the Local Store
(which is btw 0x40000 :-) ) so 0x40000 and 0x80000 are wrapped to 0x0.

break *'int func<1>(int)'^M
Breakpoint 1 at 0x40: file ../../../src/gdb/testsuite/gdb.cp/cp-relocate.cc, line 21.^M
(gdb) FAIL: gdb.cp/cp-relocate.exp: break *'int func<1>(int)'
break *'int func<2>(int)'^M
Breakpoint 2 at 0x68: file ../../../src/gdb/testsuite/gdb.cp/cp-relocate.cc, line 21.^M (gdb) FAIL: gdb.cp/cp-relocate.exp: break *'int func<2>(in


As seen here the original addresses of the two functions (detected in the
beginning of the testcase: 0x40 and 0x68) remain as addresses for the functions.
The arent replaced by 0x0.

If the testcase addresses are changed to, for example, 0x40100 and 0x80100 the wrapping produces addresses <> 0x0. Now the adresses for the functions are set (correctly):

break *'int func<1>(int)'^M
Breakpoint 1 at 0x100: file ../../../src/gdb/testsuite/gdb.cp/cp-relocate.cc, line 21.^M
(gdb) FAIL: gdb.cp/cp-relocate.exp: break *'int func<1>(int)'
break *'int func<2>(int)'^M
Note: breakpoint 1 also set at pc 0x100.^M
Breakpoint 2 at 0x100: file ../../../src/gdb/testsuite/gdb.cp/cp-relocate.cc, line 21.^M
(gdb) FAIL: gdb.cp/cp-relocate.exp: break *'int func<2>(int)'

In this case both are set to 0x100 which is correct for SPU:
(0x40100 % SPU_LS_SIZE) == (0x80100 % SPU_LS_SIZE) == 0x100.

So there are three issues:

1) Should add-symbol-file set the function address to -in this case- 0x0 ?
  SPU hardware would handle both 0x40000 and 0x80000 as 0x0.

2) As seen in my example "add-symbol-file" loads two functions to the same addresses 0x100.
Is this valid?


3) Should the used addresses in the testcase be changed to, for example,
  0x10000 and 0x20000? This would work for SPU, too. Or shall I introduce
  variables for this addresses and set them to a range < SPU_LS_SIZE for
  SPU targets only?

What do you think?

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com


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