summaryrefslogtreecommitdiffstats
path: root/common/spice_common.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-07-14 10:50:49 +0300
committerAlon Levy <alevy@redhat.com>2011-07-19 20:33:25 +0300
commita3cde2d971227ba2ca96de710993dc3c0b7b28df (patch)
tree17416e31d0f7d1eca96e1e998c245f0f3a68b320 /common/spice_common.h
parent70135614623d573def52d062ccce34ffc42a5d0f (diff)
downloadspice-a3cde2d971227ba2ca96de710993dc3c0b7b28df.tar.gz
spice-a3cde2d971227ba2ca96de710993dc3c0b7b28df.tar.xz
spice-a3cde2d971227ba2ca96de710993dc3c0b7b28df.zip
common: add backtrace via gstack or glibc backtrace
Add a backtrace printing function copied from xserver os/backtrace.c that uses gstack, and if that isn't found then glibc's backtrace. Used in ASSERT, tested on F15.
Diffstat (limited to 'common/spice_common.h')
-rw-r--r--common/spice_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/spice_common.h b/common/spice_common.h
index bc74486b..6c5154c1 100644
--- a/common/spice_common.h
+++ b/common/spice_common.h
@@ -22,9 +22,11 @@
#include <stdint.h>
#include <time.h>
#include <stdlib.h>
+#include "backtrace.h"
#define ASSERT(x) if (!(x)) { \
printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
+ spice_backtrace(); \
abort(); \
}