Breakpoint.h#
Fully qualified name: carb/Breakpoint.h
File members: carb/Breakpoint.h
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
//
// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
// property and proprietary rights in and to this material, related
// documentation and any modifications thereto. Any use, reproduction,
// disclosure or distribution of this material and related documentation
// without an express license agreement from NVIDIA CORPORATION or
// its affiliates is strictly prohibited.
#pragma once
#include "Architecture.h"
#include "Compiler.h"
#include "Platform.h"
// Temporary defines
#ifndef DOXYGEN_BUILD
# if defined(__has_builtin)
# define CARBLOCAL_HAS_BUILTIN_DEBUGTRAP (__has_builtin(__builtin_debugtrap))
# else
# define CARBLOCAL_HAS_BUILTIN_DEBUGTRAP 0
# endif
#endif
#ifdef DOXYGEN_BUILD
# define CARB_BREAK_POINT()
#elif CARB_COMPILER_MSC && !CARB_TOOLCHAIN_CLANG
# define CARB_BREAK_POINT() ::__debugbreak()
#elif CARBLOCAL_HAS_BUILTIN_DEBUGTRAP
# define CARB_BREAK_POINT() __builtin_debugtrap()
#elif CARB_COMPILER_GNUC && CARB_X86_64
// clang-format off
# define CARB_BREAK_POINT() []{ __asm__ __volatile__ ("int3"); }()
// clang-format on
#elif CARB_POSIX
# include <csignal>
# define CARB_BREAK_POINT() ::raise(SIGTRAP)
#else
CARB_UNSUPPORTED_PLATFORM();
#endif
// Undefine temporaries
#undef CARBLOCAL_HAS_BUILTIN_DEBUGTRAP