diff options
-rw-r--r-- | dwflpp.cxx | 17 | ||||
-rw-r--r-- | dwflpp.h | 3 | ||||
-rw-r--r-- | tapsets.cxx | 4 |
3 files changed, 15 insertions, 9 deletions
@@ -150,7 +150,6 @@ dwflpp::focus_on_module(Dwfl_Module * m, module_info * mi) module_dwarf = NULL; - cu_name.clear(); cu = NULL; function_name.clear(); @@ -165,7 +164,6 @@ dwflpp::focus_on_cu(Dwarf_Die * c) assert(module); cu = c; - cu_name = dwarf_diename(c) ?: "CU"; // Reset existing pointers and names function_name.clear(); @@ -176,6 +174,13 @@ dwflpp::focus_on_cu(Dwarf_Die * c) } +string +dwflpp::cu_name(void) +{ + return dwarf_diename(cu) ?: "<unknown source>"; +} + + void dwflpp::focus_on_function(Dwarf_Die * f) { @@ -562,7 +567,7 @@ dwflpp::declaration_resolve(const char *name) global_alias_cache[cu->addr] = v; iterate_over_globals(global_alias_caching_callback, v); if (sess.verbose > 4) - clog << "global alias cache " << module_name << ":" << cu_name + clog << "global alias cache " << module_name << ":" << cu_name() << " size " << v->size() << endl; } @@ -611,7 +616,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * cu_function_cache[cu->addr] = v; dwarf_getfuncs (cu, cu_function_caching_callback, v, 0); if (sess.verbose > 4) - clog << "function cache " << module_name << ":" << cu_name + clog << "function cache " << module_name << ":" << cu_name() << " size " << v->size() << endl; mod_info->update_symtab(v); } @@ -621,7 +626,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * { Dwarf_Die& die = it->second; if (sess.verbose > 4) - clog << "function cache " << module_name << ":" << cu_name + clog << "function cache " << module_name << ":" << cu_name() << " hit " << function << endl; return (*callback)(& die, q); } @@ -635,7 +640,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * if (function_name_matches_pattern (func_name, function)) { if (sess.verbose > 4) - clog << "function cache " << module_name << ":" << cu_name + clog << "function cache " << module_name << ":" << cu_name() << " match " << func_name << " vs " << function << endl; rc = (*callback)(& die, q); @@ -170,7 +170,6 @@ struct dwflpp Dwarf_Die * cu; std::string module_name; - std::string cu_name; std::string function_name; dwflpp(systemtap_session & session, const std::string& user_module, bool kernel_p); @@ -183,6 +182,8 @@ struct dwflpp void focus_on_cu(Dwarf_Die * c); void focus_on_function(Dwarf_Die * f); + std::string cu_name(void); + Dwarf_Die *query_cu_containing_address(Dwarf_Addr a); bool module_name_matches(const std::string& pattern); diff --git a/tapsets.cxx b/tapsets.cxx index 04fbf6e0..10f3d0a7 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1395,7 +1395,7 @@ query_cu (Dwarf_Die * cudie, void * arg) q->dw.focus_on_cu (cudie); if (false && q->sess.verbose>2) - clog << "focused on CU '" << q->dw.cu_name + clog << "focused on CU '" << q->dw.cu_name() << "', in module '" << q->dw.module_name << "'\n"; if (q->has_statement_str || q->has_statement_num @@ -1443,7 +1443,7 @@ query_cu (Dwarf_Die * cudie, void * arg) if (address_line) msg << " (try 0x" << hex << lineaddr << ")"; else - msg << " (no line info found for '" << q->dw.cu_name + msg << " (no line info found for '" << q->dw.cu_name() << "', in module '" << q->dw.module_name << "')"; if (! q->sess.guru_mode) throw semantic_error(msg.str()); |