Filipe Cabecinhas | fddfdca | 2016-08-30 17:08:55 +0000 | [diff] [blame] | 1 | //===-- asan_errors.cc ------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file is a part of AddressSanitizer, an address sanity checker. |
| 11 | // |
| 12 | // ASan implementation for error structures. |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "asan_errors.h" |
| 16 | #include "asan_stack.h" |
| 17 | |
| 18 | namespace __asan { |
| 19 | |
| 20 | void ErrorStackOverflow::Print() { |
| 21 | Decorator d; |
| 22 | Printf("%s", d.Warning()); |
| 23 | Report( |
| 24 | "ERROR: AddressSanitizer: stack-overflow on address %p" |
| 25 | " (pc %p bp %p sp %p T%d)\n", |
| 26 | (void *)addr, (void *)pc, (void *)bp, (void *)sp, tid); |
| 27 | Printf("%s", d.EndWarning()); |
| 28 | scariness.Print(); |
| 29 | BufferedStackTrace stack; |
| 30 | GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context, |
| 31 | common_flags()->fast_unwind_on_fatal); |
| 32 | stack.Print(); |
| 33 | ReportErrorSummary("stack-overflow", &stack); |
| 34 | } |
| 35 | |
| 36 | } // namespace __asan |