This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] fix symbol reading for separate debug info
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com, nickc at redhat dot com
- Date: Thu, 26 Jun 2003 17:25:39 -0400
- Subject: [PATCH] fix symbol reading for separate debug info
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 <ezannoni@redhat.com>
* 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)
{