This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Clear current source symtab if belongs to objfile being freed
- From: Jim Blandy <jimb at red-bean dot com>
- To: fnf at specifix dot com
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 3 Jan 2006 15:26:16 -0800
- Subject: Re: [PATCH] Clear current source symtab if belongs to objfile being freed
- References: <200601031242.38425.fnf@specifix.com>
On 1/3/06, Fred Fish <fnf@specifix.com> wrote:
> I stumbled over this problem while chasing something else. If the
> current source symtab belongs to a loaded shared library, and the
> objfile for that library is freed in the process or rerunning the
> executable, the current source symtab can be left pointing to garbage.
>
> An alternative solution, though a little more heavy handed, would be
> to replace the previous clear_pc_function_cache() call with a call to
> clear_symtab_users().
>
> Comments?
! /* I *think* all our callers call clear_symtab_users. If so, no
! need to call this here. Update: We are called via
! objfile_purge_solibs which doesn't call clear_symtab_users. */
I don't think we need our comments to be so archeological. If we
apply this patch, we should just change it to something direct like:
/* Not all our callers call clear_symtab_users
(objfile_purge_solibs, for example),
so we need to call this here. */
It seems to me, though, that the 'nosharedlibrary' and 'set
solib-absolute-prefix' commands actually ought to be calling
clear_symtab_users, no? I mean, types and blocks used by displays and
all those things are going to become invalidated, aren't they?