about summary refs log tree commit diff
path: root/src/rt/rust_debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_debug.h')
-rw-r--r--src/rt/rust_debug.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rt/rust_debug.h b/src/rt/rust_debug.h
index da9838ba341..40a4c28f052 100644
--- a/src/rt/rust_debug.h
+++ b/src/rt/rust_debug.h
@@ -7,6 +7,19 @@
 #include <string>
 #include <cstdlib>
 
+#ifndef _WIN32
+
+#include <signal.h>
+#define BREAKPOINT_AWESOME                      \
+    do {                                        \
+        signal(SIGTRAP, SIG_IGN);               \
+        raise(SIGTRAP);                         \
+    } while (0)
+
+#else
+#define BREAKPOINT_AWESOME
+#endif
+
 struct rust_task;
 
 namespace debug {