summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwflpp.cxx27
-rw-r--r--dwflpp.h5
-rw-r--r--tapsets.cxx2
3 files changed, 9 insertions, 25 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index f8d42c78..a13339ce 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -182,11 +182,17 @@ dwflpp::focus_on_function(Dwarf_Die * f)
void
-dwflpp::query_cu_containing_global_address(Dwarf_Addr a, void *arg)
+dwflpp::query_cu_containing_address(Dwarf_Addr a, void *arg)
{
Dwarf_Addr bias;
assert(dwfl);
+ assert(module);
get_module_dwarf();
+
+ // globalize the module-relative address
+ if (module_name != TOK_KERNEL && dwfl_module_relocations (module) > 0)
+ a += module_start;
+
Dwarf_Die* cudie = dwfl_module_addrdie(module, a, &bias);
if (cudie) // address could be wildly out of range
query_cu (cudie, arg);
@@ -194,25 +200,6 @@ dwflpp::query_cu_containing_global_address(Dwarf_Addr a, void *arg)
}
-void
-dwflpp::query_cu_containing_module_address(Dwarf_Addr a, void *arg)
-{
- query_cu_containing_global_address(module_address_to_global(a), arg);
-}
-
-
-Dwarf_Addr
-dwflpp::module_address_to_global(Dwarf_Addr a)
-{
- assert(dwfl);
- assert(module);
- get_module_dwarf();
- if (module_name == TOK_KERNEL || dwfl_module_relocations (module) <= 0)
- return a;
- return a + module_start;
-}
-
-
bool
dwflpp::module_name_matches(string pattern)
{
diff --git a/dwflpp.h b/dwflpp.h
index 85817391..5ae00131 100644
--- a/dwflpp.h
+++ b/dwflpp.h
@@ -197,10 +197,7 @@ struct dwflpp
void focus_on_cu(Dwarf_Die * c);
void focus_on_function(Dwarf_Die * f);
- void query_cu_containing_global_address(Dwarf_Addr a, void *arg);
- void query_cu_containing_module_address(Dwarf_Addr a, void *arg);
-
- Dwarf_Addr module_address_to_global(Dwarf_Addr a);
+ void query_cu_containing_address(Dwarf_Addr a, void *arg);
bool module_name_matches(std::string pattern);
bool name_has_wildcard(std::string pattern);
diff --git a/tapsets.cxx b/tapsets.cxx
index 3aad1730..3437205f 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -751,7 +751,7 @@ dwarf_query::query_module_dwarf()
// NB: we don't need to add the module base address or bias
// value here (for reasons that may be coincidental).
- dw.query_cu_containing_module_address(addr, this);
+ dw.query_cu_containing_address(addr, this);
}
else
{