This is the mail archive of the
mailing list for the GDB project.
Re: protection from dangling pointers in dwarf info when .so's go away
- From: Daniel Jacobowitz <drow at false dot org>
- To: Doug Evans <dje at google dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 12 Dec 2007 22:27:24 -0500
- Subject: Re: protection from dangling pointers in dwarf info when .so's go away
- References: <firstname.lastname@example.org>
On Wed, Dec 12, 2007 at 05:57:58PM -0800, Doug Evans wrote:
> Is it the case that vptr_basetype for myclass should never have gotten
> assigned a value pointing into a .so (or any other obstack)?
Sounds likely to me, but may not be practical.
> Or is
> gdb supposed to have cleaned up after itself when the .so data got
We do this for user variables when their objfile goes away, by
recursively copying their type. We don't walk types from other
objfiles looking for pointers, so there really shouldn't be any.
> Or something else? Any guidance on where the fix should go is
> appreciated. I suppose an easy solution is to toss out all info, not
> just for .so's, though that will slow down re-runs.
No, that's impossible. Remember dlopen and dlclose.