This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: dlclose()
- To: Jim Kingdon <kingdon at redhat dot com>
- Subject: Re: dlclose()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 01 Mar 2000 22:57:02 +1100
- CC: gdb-patches at sourceware dot cygnus dot com, blizzard at mozilla dot org
- Organization: Cygnus Solutions
- References: <200002161953.OAA07411@devserv.devel.redhat.com>
Jim Kingdon wrote:
>
> Here's another patch for the dlclose() problem we've been talking
> about (5130 in bugzilla.redhat.com and all). I'm not sure how well I
> like this patch but it should avoid the problem with flushing and
> reloading shared library symbols all the time as in the HJ/Sam patch.
>
> Chris, want to weigh in on this (e.g. try out the patches)? Mozilla
> is going to be one of the most affected if we do something dumb (or
> something great) with shared library support.
>
> 2000-02-16 Jim Kingdon <kingdon@redhat.com>
>
> * solib.c (find_solib): New argument recheck.
> * solib.c (solib_add): Pass it as 1, and add logic to delete
> shared libraries which aren't still in the inferior.
> (struct so_list): New field found_me, for solib_add.
> * solib.c (other find_solib callers): Pass recheck as 0.
> + /* FIXME: also need to fix up section tables that
> + we put in the target vector, right? */
> + if (so_list_head->sections)
> + {
> + free ((PTR) so_list_head->sections);
> + }
> +
> + assert (so->abfd != NULL);
One fix, and some extra random noise:
Fix: Instead of calling abort() or error() call internal_error(). GDB
should be trying to avoid crashes (intentional or otherwize) at all
costs. (Yes I know that I've still got 80 odd abort() calls that need
to be replaced by either error() or internal_error() :-)
Perhaphs, make the fixme prefix ``FIXME: kingdon/2000-12-16: ...''. As
you've by now discovered, your comments are going to be around for a
long long time so you might as well make it clear how it you^D^D^D it is
:-)
Thank to ISO-C, both ``PTR'' and ((PTR) some-aribtrary-pointer) are no
longer needed in GDB.
JimB's got the final say.
enjoy,
Andrew
PS: Thanks for running the tests.