forked from OSchip/llvm-project
[sanstats] Print the correct line information.
The instrumentation tracks the return address and not that of the call so we remove one to compensate. Thanks for Peter Collingbourne for confirming the analysis of the problem. llvm-svn: 307871
This commit is contained in:
parent
a6c57dd989
commit
4d6ef11e48
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
# RUN: sanstats %p/Inputs/debuginfo.stats | FileCheck %s
|
||||
|
||||
# CHECK: stats.cpp:23 vcall.cfi cfi-vcall 37
|
||||
# CHECK: stats.cpp:28 nvcall.cfi cfi-nvcall 51
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue