[llvm] r347600 - [cfi] Make sanstats print address of the check

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 13:48:45 PST 2018


Author: vitalybuka
Date: Mon Nov 26 13:48:45 2018
New Revision: 347600

URL: http://llvm.org/viewvc/llvm-project?rev=347600&view=rev
Log:
[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

Modified:
    llvm/trunk/test/tools/sanstats/elf.test
    llvm/trunk/tools/sanstats/sanstats.cpp

Modified: llvm/trunk/test/tools/sanstats/elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/sanstats/elf.test?rev=347600&r1=347599&r2=347600&view=diff
==============================================================================
--- llvm/trunk/test/tools/sanstats/elf.test (original)
+++ llvm/trunk/test/tools/sanstats/elf.test Mon Nov 26 13:48:45 2018
@@ -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 <unknown> 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 <unknown> 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 <unknown> 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 <unknown> 14
 
 --- !ELF
 FileHeader:      

Modified: llvm/trunk/tools/sanstats/sanstats.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/sanstats/sanstats.cpp?rev=347600&r1=347599&r2=347600&view=diff
==============================================================================
--- llvm/trunk/tools/sanstats/sanstats.cpp (original)
+++ llvm/trunk/tools/sanstats/sanstats.cpp Mon Nov 26 13:48:45 2018
@@ -81,8 +81,9 @@ const char *ReadModule(char SizeofPtr, c
     // remove one from the address to get the correct DI.
     if (Expected<DILineInfo> 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(), "<error> ");
     }




More information about the llvm-commits mailing list