From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13053 invoked by alias); 4 Mar 2010 20:01:14 -0000 Received: (qmail 12826 invoked by uid 22791); 4 Mar 2010 20:01:13 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.17.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 20:01:06 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id o24K13jr001586 for ; Thu, 4 Mar 2010 20:01:03 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o24K13dd1716334 for ; Thu, 4 Mar 2010 21:01:03 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o24K13Cp011817 for ; Thu, 4 Mar 2010 21:01:03 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o24K12OX011806; Thu, 4 Mar 2010 21:01:02 +0100 Message-Id: <201003042001.o24K12OX011806@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 04 Mar 2010 21:01:01 +0100 Subject: [rfc] Fix separate debuginfo files on Cell (do not mask off high address bits) To: gdb-patches@sourceware.org, jan.kratochvil@redhat.com Date: Thu, 04 Mar 2010 20:01:00 -0000 From: "Ulrich Weigand" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00210.txt.bz2 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