radv: set writes_memory for global memory stores/atomics
[mesa.git] / src / gallium / auxiliary / util / u_debug_stack.h
index b1848ddefa82b181bfaea969d11a7ea6a4539f35..fff41a5a9ea0e082cf31ff68fa34a860fcde4d97 100644 (file)
 #ifndef U_DEBUG_STACK_H_
 #define U_DEBUG_STACK_H_
 
+#include <stdio.h>
+
+#ifdef HAVE_LIBUNWIND
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+#endif
 
 /**
  * @file
@@ -45,15 +51,23 @@ extern "C" {
 /**
  * Represent a frame from a stack backtrace.
  *
- * XXX: Do not change this.
+#if defined(PIPE_OS_WINDOWS) && !defined(HAVE_LIBUNWIND)
+ * XXX: Do not change this. (passed to Windows' CaptureStackBackTrace())
+#endif
  *
  * TODO: This should be refactored as a void * typedef.
  */
 struct debug_stack_frame 
 {
+#ifdef HAVE_LIBUNWIND
+   unw_word_t start_ip;
+   unsigned int off;
+   const char *procname;
+#else
    const void *function;
+#endif
 };
-   
+
 
 void
 debug_backtrace_capture(struct debug_stack_frame *backtrace,
@@ -64,6 +78,10 @@ void
 debug_backtrace_dump(const struct debug_stack_frame *backtrace, 
                      unsigned nr_frames);
 
+void
+debug_backtrace_print(FILE *f,
+                      const struct debug_stack_frame *backtrace,
+                      unsigned nr_frames);
 
 #ifdef __cplusplus
 }