Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] fix for separate debug info
@ 2003-08-13 22:11 Elena Zannoni
  2003-08-14 20:12 ` Elena Zannoni
  0 siblings, 1 reply; 2+ messages in thread
From: Elena Zannoni @ 2003-08-13 22:11 UTC (permalink / raw)
  To: gdb-patches


Turns out that this patch:
2003-06-06  Mark Mitchell  <mark@codesourcery.com>

[...]
	* symfile.c [...]
	(symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs
	dynamically.
[...]

broke the handling of separate debug info files.

Here is a fix. Nobody had noticed this failure because you need the
separate debug info for libraries, etc installed and because there is
no test for this feature. I'll add one next.


elena


2003-08-13  Elena Zannoni  <ezannoni@redhat.com>

	* symfile.c (symbol_file_add_with_addrs_or_offsets): Make sure
	orig_addrs is set up properly.

Index: symfile.c
===================================================================
RCS file: /cvs/uberbaum/gdb/symfile.c,v
retrieving revision 1.101
diff -u -p -r1.101 symfile.c
--- symfile.c	27 Jun 2003 13:11:17 -0000	1.101
+++ symfile.c	13 Aug 2003 22:08:27 -0000
@@ -854,7 +854,12 @@ symbol_file_add_with_addrs_or_offsets (c
   orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));
   my_cleanups = make_cleanup (xfree, orig_addrs);
   if (addrs)
-    *orig_addrs = *addrs;
+    {
+      int i;
+      orig_addrs->num_sections = addrs->num_sections;
+      for (i = 0; i < addrs->num_sections; i++)
+	orig_addrs->other[i] = addrs->other[i];
+    }
 
   /* If the objfile uses a mapped symbol file, and we have a psymtab for
      it, then skip reading any symbols at this time. */


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

* Re: [PATCH] fix for separate debug info
  2003-08-13 22:11 [PATCH] fix for separate debug info Elena Zannoni
@ 2003-08-14 20:12 ` Elena Zannoni
  0 siblings, 0 replies; 2+ messages in thread
From: Elena Zannoni @ 2003-08-14 20:12 UTC (permalink / raw)
  To: gdb-patches

Elena Zannoni writes:
 > 
 > Turns out that this patch:
 > 2003-06-06  Mark Mitchell  <mark@codesourcery.com>
 > 
 > [...]
 > 	* symfile.c [...]
 > 	(symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs
 > 	dynamically.
 > [...]
 > 
 > broke the handling of separate debug info files.
 > 
 > Here is a fix. Nobody had noticed this failure because you need the
 > separate debug info for libraries, etc installed and because there is
 > no test for this feature. I'll add one next.
 > 
 > 
 > elena
 > 

committed to gdb-6 and mainline

elena


 > 
 > 2003-08-13  Elena Zannoni  <ezannoni@redhat.com>
 > 
 > 	* symfile.c (symbol_file_add_with_addrs_or_offsets): Make sure
 > 	orig_addrs is set up properly.
 > 
 > Index: symfile.c
 > ===================================================================
 > RCS file: /cvs/uberbaum/gdb/symfile.c,v
 > retrieving revision 1.101
 > diff -u -p -r1.101 symfile.c
 > --- symfile.c	27 Jun 2003 13:11:17 -0000	1.101
 > +++ symfile.c	13 Aug 2003 22:08:27 -0000
 > @@ -854,7 +854,12 @@ symbol_file_add_with_addrs_or_offsets (c
 >    orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));
 >    my_cleanups = make_cleanup (xfree, orig_addrs);
 >    if (addrs)
 > -    *orig_addrs = *addrs;
 > +    {
 > +      int i;
 > +      orig_addrs->num_sections = addrs->num_sections;
 > +      for (i = 0; i < addrs->num_sections; i++)
 > +	orig_addrs->other[i] = addrs->other[i];
 > +    }
 >  
 >    /* If the objfile uses a mapped symbol file, and we have a psymtab for
 >       it, then skip reading any symbols at this time. */


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

end of thread, other threads:[~2003-08-14 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-13 22:11 [PATCH] fix for separate debug info Elena Zannoni
2003-08-14 20:12 ` Elena Zannoni

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