diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-06-15 17:47:36 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-06-15 17:47:36 +0200 |
commit | d438dd9bc070216016e02f4958fe9dea571712c9 (patch) | |
tree | 7b64f4335a3386b6076c1771b2b9e27dfcb98a19 | |
parent | cba30aa93a8836cd9f88b494c17bc991c997d5f2 (diff) | |
download | systemtap-steved-d438dd9bc070216016e02f4958fe9dea571712c9.tar.gz systemtap-steved-d438dd9bc070216016e02f4958fe9dea571712c9.tar.xz systemtap-steved-d438dd9bc070216016e02f4958fe9dea571712c9.zip |
PR10285. User space PROBE marks aren't found with separate debuginfo.
The original logic was a little confused. It could end up searching the
separate debuginfo twice instead of falling back to the main elf file.
Now we explicitly search the main elf file first (where the .probes
section really should be) and only then fall back to the separate
debuginfo file.
* tapsets.cxx (dwarf_builder::probe_table::probe_table): Search main
elf file first, then fall back on separate debuginfo file if necessary.
* testsuite/systemtap.exelib/exelib.exp: Enable mark.tcl testcase.
main elf file or the debuginfo file, but would interpret
-rw-r--r-- | tapsets.cxx | 16 | ||||
-rw-r--r-- | testsuite/systemtap.exelib/exelib.exp | 3 |
2 files changed, 8 insertions, 11 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 0707e052..79a7aa93 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -692,8 +692,8 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s Dwarf_Addr bias; size_t shstrndx; - elf = (dwarf_getelf (dwfl_module_getdwarf (dw->module, &bias)) - ?: dwfl_module_getelf (dw->module, &bias)); + // Explicitly look in the main elf file first. + elf = dwfl_module_getelf (dw->module, &bias); Elf_Scn *probe_scn = NULL; dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx)); @@ -713,17 +713,15 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s } } - if (!have_probes) - return; - // Older versions put .probes section in the debuginfo dwarf file, - // so check if it actually exists, if not take the main elf file - if (have_probes && shdr->sh_type == SHT_NOBITS) + // so check if it actually exists, if not take a look in the debuginfo file + if (! have_probes || (have_probes && shdr->sh_type == SHT_NOBITS)) { - elf = dwfl_module_getelf (dw->module, &bias); + elf = dwarf_getelf (dwfl_module_getdwarf (dw->module, &bias)); + if (! elf) + return; dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx)); probe_scn = NULL; - have_probes = false; while ((probe_scn = elf_nextscn (elf, probe_scn))) { shdr = gelf_getshdr (probe_scn, &shdr_mem); diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp index 0a4ee8b0..960ebbfa 100644 --- a/testsuite/systemtap.exelib/exelib.exp +++ b/testsuite/systemtap.exelib/exelib.exp @@ -2,8 +2,7 @@ # (with gcc/g++, -O0/-O3, prelinked/pie, seperate debuginfo) # Then runs tests with a list of execs. -set subtestlist {lib uname ustack cleanup} -#set subtestlist {mark} # Currently disabled, fails sep-debug case. +set subtestlist {lib mark uname ustack cleanup} proc seperate_debuginfo {elffile} { set objcopy [list "objcopy" "--only-keep-debug"] |