Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Daniel Jacobowitz <drow@false.org>,
	Jim Blandy <jimb@codesourcery.com>,
	        GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [rfc] Wrap addresses in spu-gdb
Date: Tue, 21 Aug 2007 09:57:00 -0000	[thread overview]
Message-ID: <46CAB6B7.30806@de.ibm.com> (raw)
In-Reply-To: <200708201842.l7KIg16S028544@d12av02.megacenter.de.ibm.com>

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


  reply	other threads:[~2007-08-21  9:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08  6:46 Markus Deuling
2007-08-08 11:42 ` Daniel Jacobowitz
2007-08-08 14:12   ` Ulrich Weigand
2007-08-08 17:10     ` Jim Blandy
2007-08-09 10:39     ` Markus Deuling
2007-08-20 18:42       ` Ulrich Weigand
2007-08-21  9:57         ` Markus Deuling [this message]
2007-08-21 11:14           ` Daniel Jacobowitz
2007-08-27 13:01             ` Markus Deuling
2007-08-27 14:32               ` Ulrich Weigand

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=46CAB6B7.30806@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@codesourcery.com \
    --cc=uweigand@de.ibm.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