summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_diag.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ubsan/ubsan_diag.h')
-rw-r--r--lib/ubsan/ubsan_diag.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_diag.h b/lib/ubsan/ubsan_diag.h
index 54d15a0cc..033695190 100644
--- a/lib/ubsan/ubsan_diag.h
+++ b/lib/ubsan/ubsan_diag.h
@@ -14,6 +14,7 @@
#define UBSAN_DIAG_H
#include "ubsan_value.h"
+#include "sanitizer_common/sanitizer_stacktrace.h"
namespace __ubsan {
@@ -203,6 +204,13 @@ public:
Diag &operator<<(const Range &R) { return AddRange(R); }
};
+void MaybePrintStackTrace(uptr pc, uptr bp);
+
+#define MAYBE_PRINT_STACK_TRACE() do { \
+ GET_CALLER_PC_BP_SP; \
+ MaybePrintStackTrace(pc, bp); \
+} while (0)
+
} // namespace __ubsan
#endif // UBSAN_DIAG_H