summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/sanstats/sanstats.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/sanstats/sanstats.cpp b/tools/sanstats/sanstats.cpp
index b2216eab119e..4463c0f0e48c 100644
--- a/tools/sanstats/sanstats.cpp
+++ b/tools/sanstats/sanstats.cpp
@@ -76,8 +76,11 @@ const char *ReadModule(char SizeofPtr, const char *Begin, const char *End) {
if (Begin == End)
return nullptr;
+ // As the instrumentation tracks the return address and not
+ // the address of the call to `__sanitizer_stats_report` we
+ // remove one from the address to get the correct DI.
if (Expected<DILineInfo> LineInfo =
- Symbolizer.symbolizeCode(Filename, Addr)) {
+ Symbolizer.symbolizeCode(Filename, Addr - 1)) {
llvm::outs() << LineInfo->FileName << ':' << LineInfo->Line << ' '
<< LineInfo->FunctionName << ' ';
} else {