This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

Re: dlclose()


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]