]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libsanitizer/sanitizer_common/sanitizer_stacktrace.h
libsanitizer merge from upstream r191666
[thirdparty/gcc.git] / libsanitizer / sanitizer_common / sanitizer_stacktrace.h
index fd0c4671a61fbc2c7fad702e1b25d70ae208b2d6..1f05753d20777ab49d09f12ba12a6e7c45c45b51 100644 (file)
@@ -17,6 +17,15 @@ namespace __sanitizer {
 
 static const uptr kStackTraceMax = 256;
 
+#if SANITIZER_LINUX && (defined(__arm__) || \
+    defined(__powerpc__) || defined(__powerpc64__) || \
+    defined(__sparc__) || \
+    defined(__mips__))
+#define SANITIZER_CAN_FAST_UNWIND 0
+#else
+#define SANITIZER_CAN_FAST_UNWIND 1
+#endif
+
 struct StackTrace {
   typedef bool (*SymbolizeCallback)(const void *pc, char *out_buffer,
                                      int out_size);
@@ -49,8 +58,10 @@ struct StackTrace {
   static uptr GetCurrentPc();
   static uptr GetPreviousInstructionPc(uptr pc);
 
+  SANITIZER_INTERFACE_ATTRIBUTE
   static uptr CompressStack(StackTrace *stack,
                             u32 *compressed, uptr size);
+  SANITIZER_INTERFACE_ATTRIBUTE
   static void UncompressStack(StackTrace *stack,
                               u32 *compressed, uptr size);
 };
@@ -59,6 +70,9 @@ struct StackTrace {
 const char *StripPathPrefix(const char *filepath,
                             const char *strip_file_prefix);
 
+void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp,
+                   uptr stack_top, uptr stack_bottom, bool fast);
+
 }  // namespace __sanitizer
 
 // Use this macro if you want to print stack trace with the caller