This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix a crash when displaying variables from shared library.
- From: Tom Tromey <tromey at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Pedro Alves <pedro at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 03 Mar 2009 17:48:38 -0700
- Subject: Re: [patch] Fix a crash when displaying variables from shared library.
- References: <20090205030257.8A6073A6B7A@localhost> <m3wsc3459t.fsf@fleche.redhat.com> <8ac60eac0902061837p5885b812j8a26669e799702e1@mail.gmail.com> <m3y6wdrbn1.fsf@fleche.redhat.com> <8ac60eac0902181458g39dfbce9k63c3329528b0aad5@mail.gmail.com> <20090223010759.GA30997@adacore.com> <8ac60eac0902231012lb42bcb1q8b8cf19ad2ac192@mail.gmail.com> <8ac60eac0903021830w363783ear7d4c8fc1177d6448@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> Unfortunately, this code still crashes, because no_shared_libraries
Paul> first calls objfile_purge_solibs (which indirectly does
Paul> obstack_free), and only then clear_solib, which notifies me that
Paul> the library has already disappeared. When I proceed to use symbol,
Paul> I am already using dangling obstack :-(
Paul> Is it ok to move observer notification to before
Paul> objfile_purge_solibs, or should I add a new notification?
IMO it is ok to move this notification if you audit the existing users
to make sure they don't break.
However, it seems to me that you could also do this another way, by
noting at parse time which objfiles are referenced by a given display,
and then arranging to require a re-parse when an objfile is destroyed.
I think the existing objfile_data machinery could be used for this.
Tom