Baselib_Debug.h 724 B

123456789101112131415161718192021
  1. #pragma once
  2. #ifdef __cplusplus
  3. BASELIB_C_INTERFACE
  4. {
  5. #endif
  6. // Generates breakpoint exception (interrupt) the same way as normal breakpoint would.
  7. //
  8. // If debugger is attached, this will break into the debugger.
  9. // If debugger is not attached, application will crash, unless breakpoint exception is handled.
  10. // Breakpoint exception can be handled on some platforms by using signal(SIGTRAP, ...) or AddVectoredExceptionHandler.
  11. // Platforms can override default compiler implementation by providing BASELIB_DEBUG_TRAP.
  12. #define Baselib_Debug_Break() BASELIB_DEBUG_TRAP()
  13. // \returns true if debugger is attached
  14. BASELIB_API bool Baselib_Debug_IsDebuggerAttached(void);
  15. #ifdef __cplusplus
  16. } // BASELIB_C_INTERFACE
  17. #endif