From 228af5c49c06079e6bfe1daa64ead51b1dc979c7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 10:02:50 +0100 Subject: PR10622 Search for extern $variables in symbol table. * dwflpp.h (vardie_from_symtable): New method. * dwflpp.cxx (vardie_from_symtable): New method. (literal_stmt_for_local): Use vardie_from_symtable when no location attribute and DW_AT_external. * testsuite/buildok/xtime.stp: New testcase from PR10622. --- dwflpp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index 226b84d8..b3f71eb2 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -394,6 +394,7 @@ private: // Returns the call frame address operations for the given program counter. Dwarf_Op *get_cfa_ops (Dwarf_Addr pc); + Dwarf_Addr vardie_from_symtable(Dwarf_Die *vardie, Dwarf_Addr *addr); }; #endif // DWFLPP_H -- cgit From 063906a93ee3ea5b976f43e2dd1f73d29605fa4c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 22:20:32 +0100 Subject: Search other CUs of the module when resolving declarations. * dwflpp.h (declaration_resolve_other_cus): New method. (iterate_over_globals): Mark as static and takes a CU to iterate over. (global_alias_caching_callback_cus): New method. * dwflpp.cxx (global_alias_caching_callback_cus): New method. (declaration_resolve_other_cus): New method. (declaration_resolve): Call iterate_over_globals() with current cu. Call declaration_resolve_other_cus() when name not found. (iterate_over_globals): Takes cu_die to iterate over as argument. --- dwflpp.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index b3f71eb2..cdc6ad98 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -213,6 +213,7 @@ struct dwflpp std::vector getscopes(Dwarf_Addr pc); Dwarf_Die *declaration_resolve(const char *name); + Dwarf_Die *declaration_resolve_other_cus(const char *name); mod_cu_function_cache_t cu_function_cache; @@ -319,8 +320,10 @@ private: */ mod_cu_type_cache_t global_alias_cache; static int global_alias_caching_callback(Dwarf_Die *die, void *arg); - int iterate_over_globals (int (* callback)(Dwarf_Die *, void *), - void * data); + static int global_alias_caching_callback_cus(Dwarf_Die *die, void *arg); + static int iterate_over_globals (Dwarf_Die *, + int (* callback)(Dwarf_Die *, void *), + void * data); static int cu_function_caching_callback (Dwarf_Die* func, void *arg); -- cgit