Skip to content
Snippets Groups Projects
Commit 4a7152e4 authored by Ryan Pavlik's avatar Ryan Pavlik
Browse files

st/oxr: Switch logger to using XRT_DEBUGBREAK

parent 655a0a9f
No related branches found
No related tags found
No related merge requests found
Pipeline #11279 failed
...@@ -16,13 +16,11 @@ ...@@ -16,13 +16,11 @@
#include "oxr_objects.h" #include "oxr_objects.h"
#include "oxr_logger.h" #include "oxr_logger.h"
#ifdef _MSC_VER
// needed for __debugbreak()
#include <intrin.h>
#endif // _MSC_VER
DEBUG_GET_ONCE_BOOL_OPTION(entrypoints, "OXR_DEBUG_ENTRYPOINTS", false) DEBUG_GET_ONCE_BOOL_OPTION(entrypoints, "OXR_DEBUG_ENTRYPOINTS", false)
#ifdef XRT_DEBUGBREAK
DEBUG_GET_ONCE_BOOL_OPTION(break_on_error, "OXR_BREAK_ON_ERROR", false) DEBUG_GET_ONCE_BOOL_OPTION(break_on_error, "OXR_BREAK_ON_ERROR", false)
#endif // XRT_DEBUGBREAK
static const char * static const char *
oxr_result_to_string(XrResult result); oxr_result_to_string(XrResult result);
...@@ -97,14 +95,13 @@ oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt, ...) ...@@ -97,14 +95,13 @@ oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt, ...)
va_end(args); va_end(args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
#ifdef XRT_DEBUGBREAK
if (debug_get_bool_option_break_on_error()) { if (debug_get_bool_option_break_on_error()) {
/// Trigger a debugger breakpoint. /// Trigger a debugger breakpoint.
#ifdef _MSC_VER XRT_DEBUGBREAK();
__debugbreak();
#else
__builtin_trap();
#endif
} }
#endif
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment