From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14580 invoked by alias); 26 Jun 2003 21:18:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14566 invoked from network); 26 Jun 2003 21:18:46 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Jun 2003 21:18:46 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5QLIjH22168 for ; Thu, 26 Jun 2003 17:18:45 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5QLIjI05527 for ; Thu, 26 Jun 2003 17:18:45 -0400 Received: from localhost.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5QLIj215250; Thu, 26 Jun 2003 17:18:45 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 794862CA39; Thu, 26 Jun 2003 17:25:39 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16123.25811.278735.90386@localhost.redhat.com> Date: Thu, 26 Jun 2003 21:18:00 -0000 To: gdb-patches@sources.redhat.com, nickc@redhat.com Subject: [PATCH] fix symbol reading for separate debug info X-SW-Source: 2003-06/txt/msg00802.txt.bz2 This fixes the problem reported by Nick in: http://sources.redhat.com/ml/gdb-patches/2003-06/msg00409.html The binutils support for the separate debug info file can now be used. I think Nick has a couple of fixes for objcopy to check in. Ah, to generate the separate debug files I did: /home/ezannoni/uberbaum/installed/bin/strip --strip-debug /home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break -o /home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break.stripped /home/ezannoni/uberbaum/installed/bin/strip --only-keep-debug /home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break -o /home/ezannoni/sepdebug-binutils/home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break.debug /home/ezannoni/uberbaum/installed/bin/objcopy --add-gnu-debuglink=/home/ezannoni/sepdebug-binutils/home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break.debug /home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break.stripped /home/ezannoni/gdb-sources/tomago/gdb/testsuite/gdb.base/break elena 2003-06-26 Elena Zannoni * symfile.c (syms_from_objfile): Move variables to inner block. Move the checks for the non-mainline case a bit earlier to avoid doing some useless computations. Index: symfile.c =================================================================== RCS file: /cvs/uberbaum/gdb/symfile.c,v retrieving revision 1.100 diff -u -p -r1.100 symfile.c --- symfile.c 22 Jun 2003 18:32:49 -0000 1.100 +++ symfile.c 26 Jun 2003 20:43:20 -0000 @@ -566,12 +566,8 @@ syms_from_objfile (struct objfile *objfi int mainline, int verbo) { - asection *lower_sect; - asection *sect; - CORE_ADDR lower_offset; struct section_addr_info *local_addr = NULL; struct cleanup *old_chain; - int i; gdb_assert (! (addrs && offsets)); @@ -626,8 +622,13 @@ syms_from_objfile (struct objfile *objfi We no longer warn if the lowest section is not a text segment (as happens for the PA64 port. */ - if (!mainline) + if (!mainline && addrs && addrs->other[0].name) { + asection *lower_sect; + asection *sect; + CORE_ADDR lower_offset; + int i; + /* Find lowest loadable section to be used as starting point for continguous sections. FIXME!! won't work without call to find .text first, but this assumes text is lowest section. */ @@ -659,9 +660,7 @@ syms_from_objfile (struct objfile *objfi (the loadable section directly below it in memory). this_offset = lower_offset = lower_addr - lower_orig_addr */ - /* Calculate offsets for sections. */ - if (addrs) - for (i=0 ; i < addrs->num_sections && addrs->other[i].name; i++) + for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++) { if (addrs->other[i].addr != 0) {