aboutsummaryrefslogtreecommitdiff
path: root/ld/ldfile.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2015-03-26 19:41:15 +0100
committerAndy Wingo <wingo@igalia.com>2015-03-26 19:41:54 +0100
commitff908ebf8612a737d9e168eca0604ff6c97556bc (patch)
tree5decbc2e9890ad4b60c7d8e7b940fef9ba29e4ef /ld/ldfile.c
parentf30d5c78faa5979fb933038923e5270b7728f96f (diff)
downloadgdb-ff908ebf8612a737d9e168eca0604ff6c97556bc.zip
gdb-ff908ebf8612a737d9e168eca0604ff6c97556bc.tar.gz
gdb-ff908ebf8612a737d9e168eca0604ff6c97556bc.tar.bz2
Properly intern constants into psymtab
Variables with a DW_AT_const_value but without a DW_AT_location were not getting added to the partial symbol table. They are added to the full symbol table, however, when the compilation unit's psymtabs are expanded. Before: (gdb) p one No symbol "one" in current context. (gdb) mt flush-symbol-cache (gdb) mt expand one.c (gdb) p one $1 = 1 After: (gdb) p one $1 = 1 To the user it's pretty strange, as depending on whether tab completion has forced expansion of all CUs or not the lookup might succeed, or not if the failure was already added to the symbol cache. This commit simply makes sure to add constants to the partial symbol tables. gdb/testsuite/ChangeLog: PR symtab/18148 * gdb.dwarf2/dw2-intercu.S (one, two): Add variables that have a const_value but not a location. * gdb.dwarf2/dw2-intercu.exp: Add tests that constants without location defined in non-main CUs are visible. gdb/ChangeLog: PR symtab/18148 * dwarf2read.c (struct partial_die_info): Add has_const_value member. (add_partial_symbol): Don't punt on symbols that have const_value attributes. (read_partial_die): Detect DW_AT_const_value.
Diffstat (limited to 'ld/ldfile.c')
0 files changed, 0 insertions, 0 deletions