This is the mail archive of the gdb-patches@sourceware.org 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: [RFC][gdb] Use partial symbol table to find language for main


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> 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.

Tom


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