diff options
author | Kostya Serebryany <kcc@google.com> | 2014-11-13 20:41:38 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-11-13 20:41:38 +0000 |
commit | 721c9de2127dd04a1a383fc164b6036632e2a271 (patch) | |
tree | 5275c09e09235f15fe0ae824d5bbef4151a7d1f9 /libsanitizer/ubsan/ubsan_diag.cc | |
parent | 68ee31d601f1f20a733f979481a98c193a4129e1 (diff) |
libsanitizer merge from upstream r221802
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@217518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer/ubsan/ubsan_diag.cc')
-rw-r--r-- | libsanitizer/ubsan/ubsan_diag.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libsanitizer/ubsan/ubsan_diag.cc b/libsanitizer/ubsan/ubsan_diag.cc index 828127ab84d..028ac1a9b97 100644 --- a/libsanitizer/ubsan/ubsan_diag.cc +++ b/libsanitizer/ubsan/ubsan_diag.cc @@ -14,6 +14,7 @@ #include "ubsan_flags.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_stacktrace.h" +#include "sanitizer_common/sanitizer_stacktrace_printer.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include <stdio.h> @@ -31,7 +32,7 @@ static void MaybePrintStackTrace(uptr pc, uptr bp) { // under ASan). if (StackTrace::WillUseFastUnwind(false)) return; - StackTrace stack; + BufferedStackTrace stack; stack.Unwind(kStackTraceMax, pc, bp, 0, 0, 0, false); stack.Print(); } @@ -44,12 +45,12 @@ static void MaybeReportErrorSummary(Location Loc) { if (Loc.isSourceLocation()) { SourceLocation SLoc = Loc.getSourceLocation(); if (!SLoc.isInvalid()) { - ReportErrorSummary("runtime-error", SLoc.getFilename(), SLoc.getLine(), - ""); + ReportErrorSummary("undefined-behavior", SLoc.getFilename(), + SLoc.getLine(), ""); return; } } - ReportErrorSummary("runtime-error"); + ReportErrorSummary("undefined-behavior"); } namespace { @@ -127,14 +128,16 @@ static void renderLocation(Location Loc) { if (SLoc.isInvalid()) LocBuffer.append("<unknown>"); else - PrintSourceLocation(&LocBuffer, SLoc.getFilename(), SLoc.getLine(), - SLoc.getColumn()); + RenderSourceLocation(&LocBuffer, SLoc.getFilename(), SLoc.getLine(), + SLoc.getColumn(), common_flags()->strip_path_prefix); break; } - case Location::LK_Module: - PrintModuleAndOffset(&LocBuffer, Loc.getModuleLocation().getModuleName(), - Loc.getModuleLocation().getOffset()); + case Location::LK_Module: { + ModuleLocation MLoc = Loc.getModuleLocation(); + RenderModuleLocation(&LocBuffer, MLoc.getModuleName(), MLoc.getOffset(), + common_flags()->strip_path_prefix); break; + } case Location::LK_Memory: LocBuffer.append("%p", Loc.getMemoryLocation()); break; |