summaryrefslogtreecommitdiff
path: root/util/debug_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/debug_util.h')
-rw-r--r--util/debug_util.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/util/debug_util.h b/util/debug_util.h
index 7686ecc..abed8d9 100644
--- a/util/debug_util.h
+++ b/util/debug_util.h
@@ -62,7 +62,7 @@ namespace mongo {
#define MONGO_RARELY SOMETIMES( rarely, 128 )
#define RARELY MONGO_RARELY
-#define MONGO_ONCE for( static bool undone = true; undone; undone = false )
+#define MONGO_ONCE for( static bool undone = true; undone; undone = false )
#define ONCE MONGO_ONCE
#if defined(_WIN32)
@@ -74,30 +74,33 @@ namespace mongo {
void setupSIGTRAPforGDB();
extern int tlogLevel;
-
- inline void breakpoint(){
+
+ inline void breakpoint() {
if ( tlogLevel < 0 )
return;
+#ifdef _WIN32
+ //DEV DebugBreak();
+#endif
#ifndef _WIN32
// code to raise a breakpoint in GDB
ONCE {
//prevent SIGTRAP from crashing the program if default action is specified and we are not in gdb
struct sigaction current;
sigaction(SIGTRAP, NULL, &current);
- if (current.sa_handler == SIG_DFL){
+ if (current.sa_handler == SIG_DFL) {
signal(SIGTRAP, SIG_IGN);
}
}
-
+
raise(SIGTRAP);
#endif
}
-
+
// conditional breakpoint
- inline void breakif(bool test){
+ inline void breakif(bool test) {
if (test)
breakpoint();
}
-
+
} // namespace mongo