diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-06-01 00:11:51 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-06-06 23:39:55 -0700 |
| commit | c816eea000f56e250bb251dc1a1d357efd5a0438 (patch) | |
| tree | 1796e02f98bdc5dbf627b4a7d577b37125c622f0 /src/rt/rust_debug.h | |
| parent | 469ff08e646d4f56403a8d6dbd97d146bd8eeefb (diff) | |
| download | rust-c816eea000f56e250bb251dc1a1d357efd5a0438.tar.gz rust-c816eea000f56e250bb251dc1a1d357efd5a0438.zip | |
std: Add debug::breakpoint
Diffstat (limited to 'src/rt/rust_debug.h')
| -rw-r--r-- | src/rt/rust_debug.h | 13 |
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 { |
