Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org, jan.kratochvil@redhat.com
Subject: [rfc] Fix separate debuginfo files on Cell (do not mask off high address bits)
Date: Thu, 04 Mar 2010 20:01:00 -0000	[thread overview]
Message-ID: <201003042001.o24K12OX011806@d12av02.megacenter.de.ibm.com> (raw)

Hello,

when using the Cell/B.E. combined debugger, separate debug objfiles for
SPE executables are currently completely broken.  This is because the
new relocation code now masks off high address bits, corrupting the
encoded SPU ID in GDB CORE_ADDR values.

Jan, I understand you said this masking-off should no longer be necessary
due to other changes that occurred in the meantime.  Could you verify that
PIE still works for you with the patch below?

Tested on Cell/B.E. (PPU and SPU), fixes the sepdebug.exp test cases.

Bye,
Ulrich


ChangeLog:

	* symfile.c (build_section_addr_info_from_objfile): Do not mask
	off high address bits.

Index: gdb/symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.274
diff -u -p -r1.274 symfile.c
--- gdb/symfile.c	25 Feb 2010 15:40:01 -0000	1.274
+++ gdb/symfile.c	4 Mar 2010 13:20:32 -0000
@@ -364,18 +364,13 @@ build_section_addr_info_from_objfile (co
   struct section_addr_info *sap;
   int i;
   struct bfd_section *sec;
-  int addr_bit = gdbarch_addr_bit (objfile->gdbarch);
-  CORE_ADDR mask = CORE_ADDR_MAX;
-
-  if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-    mask = ((CORE_ADDR) 1 << addr_bit) - 1;
 
   sap = alloc_section_addr_info (objfile->num_sections);
   for (i = 0, sec = objfile->obfd->sections; sec != NULL; sec = sec->next)
     if (bfd_get_section_flags (objfile->obfd, sec) & (SEC_ALLOC | SEC_LOAD))
       {
 	sap->other[i].addr = (bfd_get_section_vma (objfile->obfd, sec)
-			      + objfile->section_offsets->offsets[i]) & mask;
+			      + objfile->section_offsets->offsets[i]);
 	sap->other[i].name = xstrdup (bfd_get_section_name (objfile->obfd,
 							    sec));
 	sap->other[i].sectindex = sec->index;
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


             reply	other threads:[~2010-03-04 20:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 20:01 Ulrich Weigand [this message]
2010-03-04 20:32 ` Jan Kratochvil
2010-03-04 20:32   ` Jan Kratochvil
2010-03-05 19:35   ` 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=201003042001.o24K12OX011806@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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