From 1c6b77e564d4d849f1994d56d662ceb018a112d4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 1 Jul 2009 18:59:41 -0700 Subject: PR10327: resolve symbol aliases to dwarf functions This will first read in the symbol table for modules, and update the dwarf cu_function_cache with aliased names too. Then when iterating in dwarf, all of the possible names are matched, instead of only the canonical dwarf name. * dwflpp.cxx (dwflpp::iterate_over_functions): call update_symtab, and track wildcard addresses in a set to avoid alias dupes * dwflpp.h (symbol_table::Compare): removed * tapsets.cxx (symbol_table::map_by_addr): replaces list_by_addr (symbol_table::sort): removed -- multimap doesn't need sorting (symbol_table::mark_dwarf_redundancies): removed, see update_symtab (symbol_table::purge_syscall_stubs): remove map elements inline (dwarf_query::handle_query_module): preload the symtable. (query_dwarf_func): don't compare the function a second time, especially since it may have been an alias that matched at first. (module_info::get_symtab): allow being called multiple times (module_info::update_symtab): copy dies from the cache to the symtab, and also add aliased names to the cache --- dwflpp.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index 8b503b33..ec6c5a0c 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -87,6 +87,7 @@ module_info info_status symtab_status; // symbol table cached? void get_symtab(dwarf_query *q); + void update_symtab(cu_function_cache_t *funcs); module_info(const char *name) : mod(NULL), @@ -128,28 +129,6 @@ struct func_info Dwarf_Addr entrypc; Dwarf_Addr prologue_end; bool weak; - - // Comparison functor for list of functions sorted by address. The - // two versions that take a Dwarf_Addr let us use the STL algorithms - // upper_bound, equal_range et al., but we don't know whether the - // searched-for value will be passed as the first or the second - // argument. - struct Compare - { - bool operator() (const func_info* f1, const func_info* f2) const - { - return f1->addr < f2->addr; - } - // For doing lookups by address. - bool operator() (Dwarf_Addr addr, const func_info* f2) const - { - return addr < f2->addr; - } - bool operator() (const func_info* f1, Dwarf_Addr addr) const - { - return f1->addr < addr; - } - }; }; -- cgit