gallium: add CONSTBUF type to tgsi_file_type
[mesa.git] / src / gallium / auxiliary / util / u_debug_stack.h
index f50f04e0f7bf8400fed525151281530cc4fe7146..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
@@ -42,11 +48,26 @@ extern "C" {
 #endif
 
 
+/**
+ * Represent a frame from a stack backtrace.
+ *
+#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,
@@ -57,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
 }