This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

Re: Design advice, type pointers between object files


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


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