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]

[rfc] Fix separate debuginfo files on Cell (do not mask off high address bits)


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


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