summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-09-03 16:34:42 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-09-07 18:06:03 +0300
commit17f82be73d930e8a921512f630a933acf8e49ab0 (patch)
treed1adf9271ee4e389b1ca1c36d41538bc0f05703d
parent2b87e45bdd2d3c16f56817c4bf6c16c7971de163 (diff)
Adjust addresses by offset before looking up file and line
Otherwise we end up with random addresses in the symbol. The symbol may contain inlined functions and the resulting locations are thus pretty random. Change-Id: I4410dea34dd9214ef05c9e5f221a42b18d228e2a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--app/perfunwind.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/perfunwind.cpp b/app/perfunwind.cpp
index 6babd58..2a2076c 100644
--- a/app/perfunwind.cpp
+++ b/app/perfunwind.cpp
@@ -319,7 +319,7 @@ static PerfUnwind::Frame lookupSymbol(PerfUnwind::UnwindInfo *ui, Dwfl *dwfl, Dw
elfFile = dwfl_module_info(mod, 0, 0, 0, 0, 0, 0, 0);
// We take the first line of the function for now, in order to reduce UI complexity
- Dwfl_Line *srcLine = dwfl_module_getsrc(mod, adjusted);
+ Dwfl_Line *srcLine = dwfl_module_getsrc(mod, adjusted - off);
if (srcLine)
srcFile = dwfl_lineinfo(srcLine, NULL, &line, &column, NULL, NULL);
}