Bug 17684 - lookup of builtin types: correctness and performance issues
Summary: lookup of builtin types: correctness and performance issues
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2014-12-07 17:56 UTC by Doug Evans
Modified: 2015-03-18 18:14 UTC (History)
1 user (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Doug Evans 2014-12-07 17:56:56 UTC
This bug is to address the correctness and performance issues of gdb's current handling of the lookup of builtin types, as discussed in PR 16994.

correctness: Though rare, we should still properly handle it,
which is if we're in a file where the STATIC_BLOCK doesn't provide a definition for "double" (basetypes live in STATIC_BLOCK) and the fallback that gdb uses (search all static blocks of all objfiles) happens to find a find a definition of "double" in a file that was compiled with -fshort-double.

performance: We search in all static blocks of all objfiles.
The definition of "void" is typically not specified in debug info and yet gdb can look up "void" a lot.  Thus every time gdb goes to search "void" it will look in all static blocks of all objfiles, find nothing, and only *then* does c-exp.y:classify_name, for example, call language_lookup_primitive_type_by_name.

Fixing this will require giving lookup_symbol (et.al.) the ability to return builtin types as symbols.  Patch to follow.
Comment 1 dje 2015-03-18 18:14:49 UTC
Patch set is here: