[ASan] Print register values in a consistent way
authorTimur Iskhodzhanov <timurrrr@google.com>
Fri, 11 Jul 2014 12:14:46 +0000 (12:14 +0000)
committerTimur Iskhodzhanov <timurrrr@google.com>
Fri, 11 Jul 2014 12:14:46 +0000 (12:14 +0000)
llvm-svn: 212809

compiler-rt/lib/asan/asan_report.cc
compiler-rt/test/asan/TestCases/stack-overflow.cc

index fb7c8fd..cee0db5 100644 (file)
@@ -602,8 +602,8 @@ void ReportStackOverflow(uptr pc, uptr sp, uptr bp, void *context, uptr addr) {
   Printf("%s", d.Warning());
   Report(
       "ERROR: AddressSanitizer: stack-overflow on address %p"
-      " (pc %p sp %p bp %p T%d)\n",
-      (void *)addr, (void *)pc, (void *)sp, (void *)bp,
+      " (pc %p bp %p sp %p T%d)\n",
+      (void *)addr, (void *)pc, (void *)bp, (void *)sp,
       GetCurrentTidOrInvalid());
   Printf("%s", d.EndWarning());
   GET_STACK_TRACE_SIGNAL(pc, bp, context);
@@ -618,8 +618,8 @@ void ReportSIGSEGV(const char *description, uptr pc, uptr sp, uptr bp,
   Printf("%s", d.Warning());
   Report(
       "ERROR: AddressSanitizer: %s on unknown address %p"
-      " (pc %p sp %p bp %p T%d)\n",
-      description, (void *)addr, (void *)pc, (void *)sp, (void *)bp,
+      " (pc %p bp %p sp %p T%d)\n",
+      description, (void *)addr, (void *)pc, (void *)bp, (void *)sp,
       GetCurrentTidOrInvalid());
   Printf("%s", d.EndWarning());
   GET_STACK_TRACE_SIGNAL(pc, bp, context);
@@ -906,7 +906,7 @@ void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write,
   Decorator d;
   Printf("%s", d.Warning());
   Report("ERROR: AddressSanitizer: %s on address "
-             "%p at pc 0x%zx bp 0x%zx sp 0x%zx\n",
+             "%p at pc %p bp %p sp %p\n",
              bug_descr, (void*)addr, pc, bp, sp);
   Printf("%s", d.EndWarning());
 
index 234e3c7..9d7c72c 100644 (file)
@@ -74,7 +74,7 @@ void recursive_func(char *p) {
   if (y)
     recursive_func(buf);
   x = 1; // prevent tail call optimization
-  // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* sp 0x.* bp 0x.* T.*\)}}
+  // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}}
   // If stack overflow happens during function prologue, stack trace may be
   // corrupted. Unwind tables are not always 100% exact there.
   // For this reason, we don't do any further checks.