diff --git a/libraries/shared/src/Breakpoint.h b/libraries/shared/src/Breakpoint.h new file mode 100644 index 0000000000..0f67237c14 --- /dev/null +++ b/libraries/shared/src/Breakpoint.h @@ -0,0 +1,28 @@ +// +// Breakpoint.h +// +// +// Created by Dale Glass on 5/6/2022 +// Copyright 2022 Dale Glass +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +// Software defined breakpoints, for aiding in debugging + +#pragma once + +#if defined(__GNUC__) + #include + #define BREAKPOINT raise(SIGINT); +#elif defined(__clang__) + #define BREAKPOINT __builtin_trap(); +#elif _MSC_VER && !__INTEL_COMPILER + #include + #define BREAKPOINT __debugbreak(); +#else + #include "CrashHelpers.h" + #define BREAKPOINT crash::nullDeref(); +#endif