This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: gdb patch: problem in elfread.c
- To: davidw at gordian dot com
- Subject: Re: gdb patch: problem in elfread.c
- From: Jim Kingdon <kingdon at redhat dot com>
- Date: Mon, 14 Feb 2000 10:40:08 -0500
- CC: akale at veritas dot com
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <Pine.BSF.3.96.1000213145339.20647B-100000@ares.gordian.com>
A checkin of mine a day or a few ago made GDB stop working on ELF
files (GDB dumps core on symbol read). Oops. I've checked in a fix
(this time I ran the testsuite *before* checking it in, rather than
planning to do it after and not getting around to it :-().
Does this story have a moral? Perhaps, pick one of:
* Do take care when checking in patches, even if you are frustrated
about the patch having sat around for a while. Take the time to
follow established procedures - they can help you as well as get in
your way.
* If you see a patch go by on gdb-patches which interests you, feel
free to test it and post success/failure reports.
or even
* it is better to check in patches rather than let them sit around,
because then they actually get tested (no I don't mean this one
seriously, at least not in the general case).
Thanks to David Whedon and Amit S. Kale for noticing and fixing this.
David Whedon asked:
> I'm not sure if I should send this to gdb-patches or to you folks.
Sending it directly to the guilty parties is good, although a CC to
gdb-patches or bug-gdb or some such wouldn't be a bad idea.
2000-02-14 Amit S. Kale <akale@veritas.com>
* elfread.c (elf_symtab_read): Move the use of sym to after where
it is set.
Checked in by Jim Kingdon <kingdon@redhat.com>
Index: elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- elfread.c 2000/02/11 19:37:06 1.2
+++ elfread.c 2000/02/14 15:27:28 1.3
@@ -293,10 +293,10 @@
if (number_of_symbols < 0)
error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
bfd_errmsg (bfd_get_error ()));
- offset = ANOFFSET (objfile->section_offsets, sym->section->index);
for (i = 0; i < number_of_symbols; i++)
{
sym = symbol_table[i];
+ offset = ANOFFSET (objfile->section_offsets, sym->section->index);
if (sym->name == NULL || *sym->name == '\0')
{
/* Skip names that don't exist (shouldn't happen), or names