This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Design advice, type pointers between object files
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Rodney M. Bates" <rodney dot bates at wichita dot edu>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 11 Feb 2005 11:49:36 -0500
- Subject: Re: Design advice, type pointers between object files
- References: <420CDC37.6070705@wichita.edu>
On Fri, Feb 11, 2005 at 10:24:23AM -0600, Rodney M. Bates wrote:
> Do any other languages do this, or do they all create copies of
> type and main_type nodes in every objfile-obstack that has symbols
> referring to them? Apparently, somebody believed the STAB type info
> produced by the Modula-3 compiler was not good enough, although
> it does exist, and I haven't seen any obvious problems with it.
There should always be a definition of the type, if there is a variable
which references it. This problem has come up with stabs
cross-references before; caching between objfiles is a bad idea.
There's some code to copy types in gdbtypes.c IIRC.
> Other possibilities that occur to me:
> 1. Don't discard dynamic library object files when doing a rerun.
> 2. Do discard and reload the main object file when doing a rerun.
No. These are really bad ideas and they don't scale to the general
case - any of these files could change between runs.
> 3. When looking up a type in this way, make copies of the type and
> main_type nodes in the objfile_obstack of the referring symbol.
Would work, I guess.
The best thing would be to try disabling this and using the type info
from your compiler. If it works, it'll be more efficient.
--
Daniel Jacobowitz
CodeSourcery, LLC