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: names of symbols


David,

This certainly sounds like a convenient direction from our standpoint.  A 
few considerations come to mind:

1. Most trivial (and therefore most annoying and contentious (;->)): the
   name SYMBOL_MATCHES_NATURAL_NAME is not entirely descriptive of what
   we do and of what one would want to do.  As I described our strategy
   to you, we first mangle the name and then search for a match with
   SYMBOL_SEARCH_NAME.  I'm not sure that 
      SYMBOL_MATCHES_NATURAL_NAME (symbol, name);
   conveys that NAME might not be a natural name.  

2. This makes me wonder a little about cross-language queries---e.g., 
   asking for an Ada symbol from C++ code.  How does C++ know to mangle?
   Well, probably the solution of using 'set lang ada' temporarily in this
   case isn't so terribly bad.

3. I was a bit puzzled about what to do with this, from 
   build_minimal_symbol_hash_tables:

      if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
	add_minsym_to_demangled_hash_table (msym,
                                            objfile->msymbol_demangled_hash);

   In Ada, I have no need of this hash table, but we DO need to demangle
   names.  It seems odd, but am I expected to provide a SYMBOL_DEMANGLED_NAME
   that is NULL and a SYMBOL_NATURAL_NAME that is ... um ... natural?

4. As to other bits: what did you think of my suggestion of handling
   multiple matches with a version of symbol_lookup that takes a 
   call-back as argument (i.e., to be called with each matching symbol)?

Paul


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