This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Aug 19, 2009 at 3:11 PM, Tom Tromey<tromey@redhat.com> wrote: > Paul> *p_refcount = 2; ?/* Both solib and objfile refer to this abfd. ?*/ > Paul> bfd_usrdata (so->abfd) = p_refcount; > > I haven't had time to read this patch fully and try to understand it. > > It just struck me from a first reading that it would be simpler, and > more conventional, to have a "gdb_bfd_ref" function, to go along with > gdb_bfd_unref, which we call whenever we assign a 'bfd*' to a field > somewhere. It would be slightly wasteful to set refcount to 1 everywhere, since solib is the only place where sharing could (currently) occur. But maybe it *is* a good idea anyway. Here is a proposed fix. Tested on Linux/x86_64 with no new failures. Also tested to fix the crash I observed. Thanks, -- Paul Pluzhnikov 2009-08-19 Paul Pluzhnikov <ppluzhnikov@google.com> * objfiles.h (gdb_bfd_ref): New prototype. * objfiles.c (gdb_bfd_ref): New function. (allocate_objfile): Call it. (gdb_bfd_unref): Adjust assertion. * solib.c (solib_map_sections): Add reference. (symbol_add_stub): Don't add reference here. * symfile.c (reread_symbols): Add reference.
Attachment:
gdb-bfd-ownership-20090819.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |