From 544174947817538d15a105fe2de4f2094079fd6c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 25 Aug 2009 18:53:40 -0700 Subject: Compute cu_name dynamically We only need cu_name for errors and verbose messages, so it's a waste to always construct it in focus_on_cu. It's now built only as-needed. * dwflpp.cxx (dwflpp::cu_name): Now a method instead of a data member. (dwflpp::focus_on_module): No cu_name to clear now. (dwflpp::focus_on_cu): No cu_name to set now. (dwflpp::declaration_resolve): Adjust to call cu_name() now. (dwflpp::iterate_over_functions): Ditto. * tapsets.cxx (query_cu): Ditto. --- dwflpp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index 08c137c7..1c7c9215 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -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); -- cgit