1 /* CC0 (Public domain) - see LICENSE file for details */
2 #ifndef CCAN_BREAKPOINT_H
3 #define CCAN_BREAKPOINT_H
4 #include <ccan/compiler/compiler.h>
10 void breakpoint_init(void) COLD;
11 extern bool breakpoint_initialized;
12 extern bool breakpoint_under_debug;
15 * breakpoint - stop if running under the debugger.
17 static inline void breakpoint(void)
19 if (!breakpoint_initialized)
21 if (breakpoint_under_debug)
22 kill(getpid(), SIGTRAP);
24 #endif /* CCAN_BREAKPOINT_H */