From: Vitaly Buka Date: Mon, 26 Nov 2018 21:48:45 +0000 (+0000) Subject: [cfi] Make sanstats print address of the check X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db87ced890a6f949895ddbd233d752dfed5a65c2;p=platform%2Fupstream%2Fllvm.git [cfi] Make sanstats print address of the check Summary: Help with off-line symbolization or other type debugging. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53606 llvm-svn: 347600 --- diff --git a/llvm/test/tools/sanstats/elf.test b/llvm/test/tools/sanstats/elf.test index ab90b50..44a1268a 100644 --- a/llvm/test/tools/sanstats/elf.test +++ b/llvm/test/tools/sanstats/elf.test @@ -25,19 +25,19 @@ # RUN: sanstats %t.stats | FileCheck %s -# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1 -# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 2 -# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-derived-cast 3 -# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-unrelated-cast 4 -# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-icall 5 -# CHECK: /tmp{{[/\\]}}f.c:3 f3 6 +# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1 +# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 2 +# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-derived-cast 3 +# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-unrelated-cast 4 +# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 5 +# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 6 -# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-vcall 7 -# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 8 -# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-derived-cast 9 -# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-unrelated-cast 11 -# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-icall 12 -# CHECK: /tmp{{[/\\]}}f.c:1 f1 14 +# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-vcall 7 +# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 8 +# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-derived-cast 9 +# CHECK: 0x0000000000000020 /tmp{{[/\\]}}f.c:3 f3 cfi-unrelated-cast 11 +# CHECK: 0x0000000000000010 /tmp{{[/\\]}}f.c:2 f2 cfi-icall 12 +# CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 14 --- !ELF FileHeader: diff --git a/llvm/tools/sanstats/sanstats.cpp b/llvm/tools/sanstats/sanstats.cpp index 71f0207..214aeea 100644 --- a/llvm/tools/sanstats/sanstats.cpp +++ b/llvm/tools/sanstats/sanstats.cpp @@ -81,8 +81,9 @@ const char *ReadModule(char SizeofPtr, const char *Begin, const char *End) { // remove one from the address to get the correct DI. if (Expected LineInfo = Symbolizer.symbolizeCode(Filename, Addr - 1)) { - llvm::outs() << LineInfo->FileName << ':' << LineInfo->Line << ' ' - << LineInfo->FunctionName << ' '; + llvm::outs() << format_hex(Addr - 1, 18) << ' ' << LineInfo->FileName + << ':' << LineInfo->Line << ' ' << LineInfo->FunctionName + << ' '; } else { logAllUnhandledErrors(LineInfo.takeError(), llvm::outs(), " "); }