summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-02-03 13:56:01 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-02-16 18:04:25 +0200
commita85031f07273fa1e7e4cc77fd2470fd4bf3f6c1d (patch)
treec7371d5f038da2c2f02de78c0e21c55a12e0abc1
parentf0d8bc1fbea7c29e8fdabac29faf50a58531336c (diff)
Use libdw's recommendation to retrieve symbol information
Change-Id: I88e3db81f0d9b888b7e025f3c00d1cfdaab19b68 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--perfunwind.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/perfunwind.cpp b/perfunwind.cpp
index 682ae88..4af25a6 100644
--- a/perfunwind.cpp
+++ b/perfunwind.cpp
@@ -208,13 +208,16 @@ static PerfUnwind::Frame lookupSymbol(const PerfUnwind *unwind, Dwfl *dwfl, Dwar
const char *filename = NULL;
GElf_Sym sym;
+ GElf_Off off;
if (mod) {
- symname = dwfl_module_addrsym (mod, ip, &sym, 0);
+ symname = dwfl_module_addrinfo (mod, ip, &off, &sym, 0, 0, 0);
filename = dwfl_module_info(mod, 0, 0, 0, 0, 0, 0, 0);
}
if (symname)
demangled = bfd_demangle(NULL, symname, 0x3);
+ else
+ qWarning() << "no symbol found for" << ip << "in" << filename;
return PerfUnwind::Frame(symname ? sym.st_value : ip, demangled ? demangled : symname, filename);
}