summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index eeccb90b..1728ec9e 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -3417,12 +3417,12 @@ dwarf_builder::build(systemtap_session & sess,
Elf_Scn *probe_scn = NULL;
dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ GElf_Shdr shdr_mem;
GElf_Shdr *shdr = NULL;
// Is there a .probes section?
while ((probe_scn = elf_nextscn (elf, probe_scn)))
{
- GElf_Shdr shdr_mem;
shdr = gelf_getshdr (probe_scn, &shdr_mem);
assert (shdr != NULL);
@@ -3433,6 +3433,22 @@ dwarf_builder::build(systemtap_session & sess,
}
}
+ // Older versions put .probes section in the debuginfo dwarf file,
+ // so check if it actually exists, if not take the main elf file
+ if (probe_type == probes_and_dwarf && shdr->sh_type == SHT_NOBITS)
+ {
+ elf = dwfl_module_getelf (dw->module, &bias);
+ dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ probe_scn = NULL;
+ while ((probe_scn = elf_nextscn (elf, probe_scn)))
+ {
+ shdr = gelf_getshdr (probe_scn, &shdr_mem);
+ if (strcmp (elf_strptr (elf, shstrndx, shdr->sh_name),
+ ".probes") == 0)
+ break;
+ }
+ }
+
// We got our .probes section, extract data.
if (probe_type == probes_and_dwarf)
{
@@ -5163,7 +5179,7 @@ tracepoint_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
expression *texp = require (tsym); // NB: throws nothing ...
assert (!tsym->saved_conversion_error); // ... but this is how we know it happened.
- pf->raw_components += "=%#x";
+ pf->raw_components += args[i].isptr ? "=%p" : "=%#x";
pf->args.push_back(texp);
}