summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-06-24 14:20:08 +0200
committerMark Wielaard <mjw@redhat.com>2009-06-24 14:20:08 +0200
commit1f8592d1a615bef5bad1f255e761664e85d9e4f0 (patch)
tree05c01cbab8c8834bc356d3db70b8eeed904c2c9f /tapsets.cxx
parent123ed3dad4423edf313f3218b3d63804b7edfc47 (diff)
downloadsystemtap-steved-1f8592d1a615bef5bad1f255e761664e85d9e4f0.tar.gz
systemtap-steved-1f8592d1a615bef5bad1f255e761664e85d9e4f0.tar.xz
systemtap-steved-1f8592d1a615bef5bad1f255e761664e85d9e4f0.zip
PR10305 Mark probes fail on prelinked shared library.
Mark probes rely on literal statement addresses, these are based on the on-disk module address space. Introduce helper function to turn such addresses into symbol addresses as expected by libdwfl. Also properly adjust for dw bias when such addresses are used in dw queries. * dwflpp.h (dwflpp::literal_addr_to_sym_addr): New method. * dwflpp.cxx (query_cu_containing_address): Don't "globalize" address. (literal_addr_to_sym_addr): New method. * tapsets.cxx (query_module_dwarf): Turn literal addresses into symbol addresses. (query_dwarf_func): Likewise and adjust for dw module bias.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 6be7de11..cd6bc28e 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -986,8 +986,9 @@ dwarf_query::query_module_dwarf()
else
addr = statement_num_val;
- // NB: we don't need to add the module base address or bias
- // value here (for reasons that may be coincidental).
+ // Translate to an actual symbol address.
+ addr = dw.literal_addr_to_sym_addr (addr);
+
Dwarf_Die* cudie = dw.query_cu_containing_address(addr);
if (cudie) // address could be wildly out of range
query_cu(cudie, this);
@@ -1546,6 +1547,11 @@ query_dwarf_func (Dwarf_Die * func, base_query * bq)
Dwarf_Die d;
q->dw.function_die (&d);
+ // Translate literal address to symbol address, then
+ // compensate for dw bias.
+ query_addr = q->dw.literal_addr_to_sym_addr(query_addr);
+ query_addr -= q->dw.module_bias;
+
if (q->dw.die_has_pc (d, query_addr))
record_this_function = true;
}
@@ -1576,6 +1582,12 @@ query_dwarf_func (Dwarf_Die * func, base_query * bq)
else if (q->has_statement_num)
{
func.entrypc = q->statement_num_val;
+
+ // Translate literal address to symbol address, then
+ // compensate for dw bias (will be used for query dw funcs).
+ func.entrypc = q->dw.literal_addr_to_sym_addr(func.entrypc);
+ func.entrypc -= q->dw.module_bias;
+
q->filtered_functions.push_back (func);
if (q->dw.function_name_final_match (q->function))
return DWARF_CB_ABORT;