summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-05-15 13:14:52 -0700
committerJosh Stone <jistone@redhat.com>2009-05-15 13:31:22 -0700
commitb6fa229bc4b361a23f23daa13af634a0515230d6 (patch)
treebc1ba43e264939bc71a9690aec7d8c719b7c1a5a /dwflpp.cxx
parentc94efd6357211094fce035d7435efe971bdf5ae1 (diff)
downloadsystemtap-steved-b6fa229bc4b361a23f23daa13af634a0515230d6.tar.gz
systemtap-steved-b6fa229bc4b361a23f23daa13af634a0515230d6.tar.xz
systemtap-steved-b6fa229bc4b361a23f23daa13af634a0515230d6.zip
Merge the dwflpp::query_cu_..._address methods
The method query_cu_containing_global_address was only called by query_cu_containing_module_address, and the latter was just doing a simple argument transform. They are now merged into a single method, query_cu_containing_address. The function module_address_to_global is also merged here at its only call site.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx27
1 files changed, 7 insertions, 20 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)
{