On 03-03-2020 16:48, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> Ideally, we'd like to get the language of the symbol without triggering > Tom> expansion into a full symtab, and get the speedup without having to set the > Tom> language manually. > > This seems like a good idea. > > Tom> +extern enum language > Tom> +find_psym_language (block_enum block_index, const char *name, > Tom> + const domain_enum domain); > > FYI we don't normally line break after the type for declarations, only > definitions. > > Tom> /* The languages above didn't identify the name of the main procedure. > Tom> Fallback to "main". */ > Tom> + > Tom> + /* Try to find language for main in psymtabs. */ > Tom> + enum language lang = find_psym_language (GLOBAL_BLOCK, "main", VAR_DOMAIN); > > Generic code shouldn't call directly into the psymtab code. While most > debug readers create psymtabs, they aren't required to. For example, > the DWARF index code bypasses psymtabs entirely -- but this call might > cause the DWARF reader to create psymtabs in this case. > > Instead the way to do this is add a new function pointer to > struct quick_symbol_functions, then implement it in the various debug > readers. Done, though I've only implemented it for one reader. OK like this? Thanks, - Tom