aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf-index-write.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-04-23 16:42:14 -0600
committerTom Tromey <tom@tromey.com>2019-05-04 13:45:34 -0600
commit20555e9e40f8e5ae041ca593d72c7148d94b6565 (patch)
treeeacdab1625262dfa1ecc67423f6d088f102e85b4 /gdb/dwarf-index-write.c
parent0af71a8e593b1991189ec4007cbae99367472196 (diff)
downloadbinutils-20555e9e40f8e5ae041ca593d72c7148d94b6565.zip
binutils-20555e9e40f8e5ae041ca593d72c7148d94b6565.tar.gz
binutils-20555e9e40f8e5ae041ca593d72c7148d94b6565.tar.bz2
Don't derive partial_symbol from general_symbol_info
This patch partly reverts commit 8a6d42345 ("Change representation of psymbol to flush out accessors"); specifically, it changes partial_symbol to no longer derive from general_symbol_info. The basic problem here is that the bcache compares objects bitwise, and this change made it less likely that the relevant fields in the psymbol would be fully initialized. This could be seen by running a test under valgrind on the Fedora-i686 buildbot. I considered a simpler patch, namely just zeroing the psymbol's "value" field in add_psymbol_to_bcache. However, it wasn't clear to me that this memset could not then be optimized away by the compiler. Regression tested by the buildbot. I think this should go in 8.3 as well. 2019-05-04 Tom Tromey <tom@tromey.com> * psymtab.c (psymbol_name_matches, match_partial_symbol) (lookup_partial_symbol, print_partial_symbols) (recursively_search_psymtabs, sort_pst_symbols, psymbol_hash) (psymbol_compare): Update. (add_psymbol_to_bcache): Clear the entire psymbol. (maintenance_check_psymtabs): Update. * psympriv.h (struct partial_symbol): Don't derive from general_symbol_info. <obj_section, unrelocated_address, address, set_unrelocated_address>: Update. <ginfo>: New member. * dwarf-index-write.c (write_psymbols, debug_names::insert) (debug_names::write_psymbols): Update.
Diffstat (limited to 'gdb/dwarf-index-write.c')
-rw-r--r--gdb/dwarf-index-write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c
index 01c1256..519179b 100644
--- a/gdb/dwarf-index-write.c
+++ b/gdb/dwarf-index-write.c
@@ -540,7 +540,7 @@ write_psymbols (struct mapped_symtab *symtab,
{
struct partial_symbol *psym = *psymp;
- if (psym->language == language_ada)
+ if (psym->ginfo.language == language_ada)
error (_("Ada is not currently supported by the index"));
/* Only add a given psymbol once. */
@@ -548,7 +548,7 @@ write_psymbols (struct mapped_symtab *symtab,
{
gdb_index_symbol_kind kind = symbol_kind (psym);
- add_index_entry (symtab, symbol_search_name (psym),
+ add_index_entry (symtab, symbol_search_name (&psym->ginfo),
is_static, kind, cu_index);
}
}
@@ -684,7 +684,7 @@ public:
const int dwarf_tag = psymbol_tag (psym);
if (dwarf_tag == 0)
return;
- const char *const name = symbol_search_name (psym);
+ const char *const name = symbol_search_name (&psym->ginfo);
const auto insertpair
= m_name_to_value_set.emplace (c_str_view (name),
std::set<symbol_value> ());
@@ -1181,7 +1181,7 @@ private:
{
struct partial_symbol *psym = *psymp;
- if (psym->language == language_ada)
+ if (psym->ginfo.language == language_ada)
error (_("Ada is not currently supported by the index"));
/* Only add a given psymbol once. */