PR c++/11702
* NEWS: Add entry. * dwarf2read.c (dwarf2_add_field): If DW_AT_const_value is present, create a symbol for the field and record the value. (new_symbol): Handle DW_TAG_member. * gdbtypes.c (field_is_static): Remove FIXME. * symtab.c (search_symbols): When searching for VARIABLES_DOMAIN, only ignore LOC_CONST symbols that are enums. testsuite/ Test PR c++/11702. * gdb.cp/m-static.exp: Add testcase. * gdb.cp/m-static.h (gnu_obj_4): Add initialized static const member.
This commit is contained in:
parent
6e70227d64
commit
254e6b9ed4
8 changed files with 68 additions and 8 deletions
|
@ -3057,10 +3057,15 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
|
|||
if (file_matches (real_symtab->filename, files, nfiles)
|
||||
&& ((regexp == NULL
|
||||
|| re_exec (SYMBOL_NATURAL_NAME (sym)) != 0)
|
||||
&& ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF
|
||||
&& ((kind == VARIABLES_DOMAIN
|
||||
&& SYMBOL_CLASS (sym) != LOC_TYPEDEF
|
||||
&& SYMBOL_CLASS (sym) != LOC_UNRESOLVED
|
||||
&& SYMBOL_CLASS (sym) != LOC_BLOCK
|
||||
&& SYMBOL_CLASS (sym) != LOC_CONST)
|
||||
/* LOC_CONST can be used for more than just enums,
|
||||
e.g., c++ static const members.
|
||||
We only want to skip enums here. */
|
||||
&& !(SYMBOL_CLASS (sym) == LOC_CONST
|
||||
&& TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_ENUM))
|
||||
|| (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK)
|
||||
|| (kind == TYPES_DOMAIN && SYMBOL_CLASS (sym) == LOC_TYPEDEF))))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue