Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Fix separate debuginfo files on Cell (do not mask off high address bits)
@ 2010-03-04 20:01 Ulrich Weigand
  2010-03-04 20:32 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2010-03-04 20:01 UTC (permalink / raw)
  To: gdb-patches, jan.kratochvil

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-05 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-04 20:01 [rfc] Fix separate debuginfo files on Cell (do not mask off high address bits) Ulrich Weigand
2010-03-04 20:32 ` Jan Kratochvil
2010-03-04 20:32   ` Jan Kratochvil
2010-03-05 19:35   ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox