From 8096dd7dbc7bc5712da58a6f9bcb90c0b74c10db Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 26 Aug 2009 20:09:48 -0700 Subject: Reorganize iterate_over_labels I noticed that iterate_over_labels was using a static variable as a recursion variable, which isn't a safe thing to do since it will only be initialized once. While fixing that, I also reorganized the function quite a bit. * dwflpp.cxx (dwflpp::iterate_over_labels): Take the current function as a parameter instead of using a static local. Rewrite some of the code as well to try to make it more obvious. * tapsets.cxx (add_label_name): Remove in favor of query_label. (query_label): New, to check decl_file and fix probe listing. (query_srcfile_label, query_cu): Adjust to iterate_over_labels change and start using query_label as the callback. --- dwflpp.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index 1c7c9215..073b9bfc 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -78,7 +78,6 @@ typedef std::vector inline_instance_map_t; /* XXX FIXME functions that dwflpp needs from tapsets.cxx */ func_info_map_t *get_filtered_functions(dwarf_query *q); inline_instance_map_t *get_filtered_inlines(dwarf_query *q); -void add_label_name(dwarf_query *q, const char *name); struct @@ -225,15 +224,17 @@ struct dwflpp void *data); void iterate_over_labels (Dwarf_Die *begin_die, - const char *sym, - const char *symfunction, - void *data, + const std::string& sym, + const std::string& symfunction, + dwarf_query *q, void (* callback)(const std::string &, + const char *, const char *, int, Dwarf_Die *, Dwarf_Addr, - dwarf_query *)); + dwarf_query *), + const std::string& current_function); void collect_srcfiles_matching (std::string const & pattern, std::set & filtered_srcfiles); -- cgit