diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index edc91379bc4..5be015e7c71 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -43,6 +43,7 @@ Portable File Dialogs wpigui/src/main/native/include/portable-file-dialogs.h V8 export-template wpiutil/src/main/native/include/wpi/SymbolExports.h GCEM wpimath/src/main/native/thirdparty/gcem/include/ Sleipnir wpimath/src/main/native/thirdparty/sleipnir +Debugging wpiutil/src/main/native/thirdparty/debugging ============================================================================== Google Test License @@ -1224,3 +1225,29 @@ Redistribution and use in source and binary forms, with or without modification, 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================= +Debugging License +================= +MIT License + +Copyright (c) 2021-2022 René Ferdinand Rivera Morell +Copyright (c) 2018 Isabella Muerte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/upstream_utils/debugging.py b/upstream_utils/debugging.py new file mode 100755 index 00000000000..117cf900482 --- /dev/null +++ b/upstream_utils/debugging.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +import os +import shutil + +from upstream_utils import Lib, walk_cwd_and_copy_if + + +def copy_upstream_src(wpilib_root): + wpiutil = os.path.join(wpilib_root, "wpiutil") + + # Delete old install + for d in [ + "src/main/native/thirdparty/debugging/src", + "src/main/native/thirdparty/debugging/include", + ]: + shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True) + + # Copy debugging files into allwpilib + filenames = walk_cwd_and_copy_if( + lambda dp, f: dp.startswith(os.path.join(".", "src")) + or dp.startswith(os.path.join(".", "include")), + os.path.join(wpiutil, "src/main/native/thirdparty/debugging"), + ) + + for filename in filenames: + with open(filename) as f: + content = f.read() + + # Rename namespace from stdx to wpi + content = content.replace("namespace stdx", "namespace wpi") + + with open(filename, "w") as f: + f.write(content) + + +def main(): + name = "debugging" + url = "https://github.com/grafikrobot/debugging" + # master on 2024-11-21 + tag = "c510133c44894b93afbb5be55275bfb88163a2cb" + + expected = Lib(name, url, tag, copy_upstream_src) + expected.main() + + +if __name__ == "__main__": + main() diff --git a/upstream_utils/debugging_patches/0001-Guard-gnu-flatten-attribute.patch b/upstream_utils/debugging_patches/0001-Guard-gnu-flatten-attribute.patch new file mode 100644 index 00000000000..114b51ae77a --- /dev/null +++ b/upstream_utils/debugging_patches/0001-Guard-gnu-flatten-attribute.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Thu, 21 Nov 2024 17:51:15 -0800 +Subject: [PATCH 1/4] Guard [[gnu::flatten]] attribute + +--- + include/debugging.hpp | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/include/debugging.hpp b/include/debugging.hpp +index 70ba724a2b6522a774931af7d7be2cee9408567a..25014a9fc65d06052089058feea7566462c01d60 100644 +--- a/include/debugging.hpp ++++ b/include/debugging.hpp +@@ -7,13 +7,19 @@ namespace stdx { + + bool is_debugger_present() noexcept; + +-[[gnu::flatten]] inline void breakpoint() noexcept ++#if defined(__GNUC__) && !defined(__clang__) ++[[gnu::flatten]] ++#endif ++inline void breakpoint() noexcept + { + psnip_trap(); + } + + +-[[gnu::flatten]] inline void breakpoint_if_debugging() noexcept ++#if defined(__GNUC__) && !defined(__clang__) ++[[gnu::flatten]] ++#endif ++inline void breakpoint_if_debugging() noexcept + { + if (is_debugger_present()) breakpoint(); + } diff --git a/upstream_utils/debugging_patches/0002-Remove-debugger_query-argument-from-Windows-and-macO.patch b/upstream_utils/debugging_patches/0002-Remove-debugger_query-argument-from-Windows-and-macO.patch new file mode 100644 index 00000000000..94f5bd0f458 --- /dev/null +++ b/upstream_utils/debugging_patches/0002-Remove-debugger_query-argument-from-Windows-and-macO.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Thu, 21 Nov 2024 17:23:48 -0800 +Subject: [PATCH 2/4] Remove debugger_query argument from Windows and macOS + +--- + src/macos.cxx | 2 +- + src/windows.cxx | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/macos.cxx b/src/macos.cxx +index bbcf6f2eec9ea479a2bea0ff06b454dc81b5d356..85dbb5f45d89680e39b4847a9aa2d5472c824f2a 100644 +--- a/src/macos.cxx ++++ b/src/macos.cxx +@@ -13,7 +13,7 @@ auto exc = std::array { {} }; + + namespace stdx { + +-bool is_debugger_present(debugger_query q) noexcept ++bool is_debugger_present() noexcept + { + mach_msg_type_number_t count {}; + auto masks = exc; +diff --git a/src/windows.cxx b/src/windows.cxx +index eec576f415d52f63d2658012546ead2e691d7415..45d98eb27c5182de7ad11291925275fb4fdb54fb 100644 +--- a/src/windows.cxx ++++ b/src/windows.cxx +@@ -9,7 +9,7 @@ + + namespace stdx { + +-bool is_debugger_present(debugger_query q) noexcept ++bool is_debugger_present() noexcept + { + return ::IsDebuggerPresent(); + } diff --git a/upstream_utils/debugging_patches/0003-Fix-exception-mask-type-typo-on-macOS.patch b/upstream_utils/debugging_patches/0003-Fix-exception-mask-type-typo-on-macOS.patch new file mode 100644 index 00000000000..d4e5b65970a --- /dev/null +++ b/upstream_utils/debugging_patches/0003-Fix-exception-mask-type-typo-on-macOS.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Thu, 21 Nov 2024 18:09:37 -0800 +Subject: [PATCH 3/4] Fix exception mask type typo on macOS + +--- + src/macos.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/macos.cxx b/src/macos.cxx +index 85dbb5f45d89680e39b4847a9aa2d5472c824f2a..2c68064742bc7883a08551b88cd5dbb9a1f38100 100644 +--- a/src/macos.cxx ++++ b/src/macos.cxx +@@ -20,7 +20,7 @@ bool is_debugger_present() noexcept + auto ports = exc; + auto behaviors = exc; + auto flavors = exc; +- exception_mast_t mask ++ exception_mask_t mask + = EXC_MASK_ALL & ~(EXC_MASK_RESOURCE | EXC_MASK_GUARD); + kern_return_t result = task_get_exception_ports(mach_task_self(), mask, + masks.data(), &count, ports.data(), behaviors.data(), flavors.data()); diff --git a/upstream_utils/debugging_patches/0004-Remove-NOMINMAX-macro-from-Windows.patch b/upstream_utils/debugging_patches/0004-Remove-NOMINMAX-macro-from-Windows.patch new file mode 100644 index 00000000000..0e4281e4bae --- /dev/null +++ b/upstream_utils/debugging_patches/0004-Remove-NOMINMAX-macro-from-Windows.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Thu, 21 Nov 2024 18:49:53 -0800 +Subject: [PATCH 4/4] Remove NOMINMAX macro from Windows + +--- + src/windows.cxx | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/windows.cxx b/src/windows.cxx +index 45d98eb27c5182de7ad11291925275fb4fdb54fb..d20ae438ef9b2de8830c6df099f0476aba395de5 100644 +--- a/src/windows.cxx ++++ b/src/windows.cxx +@@ -4,7 +4,6 @@ + # include + + # define WIN32_LEAN_AND_MEAN +-# define NOMINMAX + # include + + namespace stdx { diff --git a/upstream_utils/upstream_utils.py b/upstream_utils/upstream_utils.py index 68ee239f734..bb5e901ae93 100644 --- a/upstream_utils/upstream_utils.py +++ b/upstream_utils/upstream_utils.py @@ -55,9 +55,10 @@ def copy_to(files, root, rename_c_to_cpp=False): for f in files: dest_file = os.path.join(root, f) - # Rename .cc file to .cpp - if dest_file.endswith(".cc"): + # Rename .cc or .cxx file to .cpp + if dest_file.endswith(".cc") or dest_file.endswith(".cxx"): dest_file = os.path.splitext(dest_file)[0] + ".cpp" + if rename_c_to_cpp and dest_file.endswith(".c"): dest_file = os.path.splitext(dest_file)[0] + ".cpp" diff --git a/wpiutil/BUILD.bazel b/wpiutil/BUILD.bazel index e92f58c99da..6e9318bedff 100644 --- a/wpiutil/BUILD.bazel +++ b/wpiutil/BUILD.bazel @@ -13,6 +13,22 @@ cc_library( visibility = ["//wpiutil:__subpackages__"], ) +cc_library( + name = "debugging-headers", + hdrs = glob([ + "src/main/native/thirdparty/debugging/include/**/*", + ]), + includes = ["src/main/native/thirdparty/debugging/include"], + strip_include_prefix = "src/main/native/thirdparty/debugging/include", + visibility = ["//wpiutil:__subpackages__"], +) + +filegroup( + name = "debugging-srcs", + srcs = glob(["src/main/native/thirdparty/debugging/src/**"]), + visibility = ["//wpiutil:__subpackages__"], +) + cc_library( name = "expected-headers", hdrs = glob([ @@ -175,6 +191,7 @@ cc_library( ["src/main/native/cpp/**"], exclude = ["src/main/native/cpp/jni/**"], ) + [ + ":debugging-srcs", ":fmtlib-srcs", ":generate-resources", ":llvm-srcs", @@ -191,6 +208,7 @@ cc_library( deps = [ ":argparse-headers", ":concurrentqueue-headers", + ":debugging-headers", ":expected-headers", ":fmtlib-headers", ":json-headers", diff --git a/wpiutil/CMakeLists.txt b/wpiutil/CMakeLists.txt index 3d6344f7d47..62d517495da 100644 --- a/wpiutil/CMakeLists.txt +++ b/wpiutil/CMakeLists.txt @@ -116,6 +116,7 @@ generate_resources(src/main/native/resources generated/main/cpp WPI wpi wpiutil_ file( GLOB_RECURSE wpiutil_native_src src/main/native/cpp/*.cpp + src/main/native/thirdparty/debugging/src/*.cpp src/main/native/thirdparty/json/cpp/*.cpp src/main/native/thirdparty/llvm/cpp/*.cpp src/main/native/thirdparty/mpack/src/*.cpp @@ -198,6 +199,7 @@ install( DIRECTORY src/main/native/include/ src/main/native/thirdparty/argparse/include/ + src/main/native/thirdparty/debugging/include/ src/main/native/thirdparty/expected/include/ src/main/native/thirdparty/json/include/ src/main/native/thirdparty/llvm/include/ @@ -212,6 +214,7 @@ target_include_directories( PUBLIC $ $ + $ $ $ $ diff --git a/wpiutil/build.gradle b/wpiutil/build.gradle index 78d93792846..5191e17e56e 100644 --- a/wpiutil/build.gradle +++ b/wpiutil/build.gradle @@ -17,6 +17,15 @@ ext { dependsOn generateTask } it.sources { + debuggingCpp(CppSourceSet) { + source { + srcDirs 'src/main/native/thirdparty/debugging/src' + include '*.cpp' + } + exportedHeaders { + srcDirs 'src/main/native/thirdparty/debugging/include' + } + } fmtlibCpp(CppSourceSet) { source { srcDirs 'src/main/native/thirdparty/fmtlib/src' @@ -178,6 +187,7 @@ nativeUtils.exportsConfigs { cppHeadersZip { def thirdpartyIncDirs = [ 'src/main/native/thirdparty/argparse/include', + 'src/main/native/thirdparty/debugging/include', 'src/main/native/thirdparty/expected/include', 'src/main/native/thirdparty/fmtlib/include', 'src/main/native/thirdparty/json/include', @@ -229,7 +239,7 @@ model { all { it.sources.each { it.exportedHeaders { - srcDirs 'src/main/native/include', 'src/main/native/thirdparty/argparse/include/', 'src/main/native/thirdparty/expected/include', 'src/main/native/thirdparty/fmtlib/include', 'src/main/native/thirdparty/llvm/include', 'src/main/native/thirdparty/sigslot/include', 'src/main/native/thirdparty/json/include', 'src/main/native/thirdparty/memory/include', 'src/main/native/thirdparty/mpack/include', 'src/main/native/thirdparty/protobuf/include', 'src/main/native/thirdparty/nanopb/include' + srcDirs 'src/main/native/include', 'src/main/native/thirdparty/argparse/include/', 'src/main/native/thirdparty/debugging/include', 'src/main/native/thirdparty/expected/include', 'src/main/native/thirdparty/fmtlib/include', 'src/main/native/thirdparty/llvm/include', 'src/main/native/thirdparty/sigslot/include', 'src/main/native/thirdparty/json/include', 'src/main/native/thirdparty/memory/include', 'src/main/native/thirdparty/mpack/include', 'src/main/native/thirdparty/protobuf/include', 'src/main/native/thirdparty/nanopb/include' } } } diff --git a/wpiutil/src/main/native/thirdparty/debugging/include/debugging.hpp b/wpiutil/src/main/native/thirdparty/debugging/include/debugging.hpp new file mode 100644 index 00000000000..291d4c723ed --- /dev/null +++ b/wpiutil/src/main/native/thirdparty/debugging/include/debugging.hpp @@ -0,0 +1,29 @@ +#ifndef IXM_BREAKPOINT_HPP +#define IXM_BREAKPOINT_HPP + +#include + +namespace wpi { + +bool is_debugger_present() noexcept; + +#if defined(__GNUC__) && !defined(__clang__) +[[gnu::flatten]] +#endif +inline void breakpoint() noexcept +{ + psnip_trap(); +} + + +#if defined(__GNUC__) && !defined(__clang__) +[[gnu::flatten]] +#endif +inline void breakpoint_if_debugging() noexcept +{ + if (is_debugger_present()) breakpoint(); +} + +} // namespace wpi + +#endif diff --git a/wpiutil/src/main/native/thirdparty/debugging/include/debugging/detail/psnip_debug_trap.h b/wpiutil/src/main/native/thirdparty/debugging/include/debugging/detail/psnip_debug_trap.h new file mode 100644 index 00000000000..2436245a7e6 --- /dev/null +++ b/wpiutil/src/main/native/thirdparty/debugging/include/debugging/detail/psnip_debug_trap.h @@ -0,0 +1,83 @@ +/* Debugging assertions and traps + * Portable Snippets - https://github.com/nemequ/portable-snippets + * Created by Evan Nemerson + * + * To the extent possible under law, the authors have waived all + * copyright and related or neighboring rights to this code. For + * details, see the Creative Commons Zero 1.0 Universal license at + * https://creativecommons.org/publicdomain/zero/1.0/ + */ + +#if !defined(PSNIP_DEBUG_TRAP_H) +#define PSNIP_DEBUG_TRAP_H + +#if !defined(PSNIP_NDEBUG) && defined(NDEBUG) && !defined(PSNIP_DEBUG) +# define PSNIP_NDEBUG 1 +#endif + +#if defined(__has_builtin) && !defined(__ibmxl__) +# if __has_builtin(__builtin_debugtrap) +# define psnip_trap() __builtin_debugtrap() +# elif __has_builtin(__debugbreak) +# define psnip_trap() __debugbreak() +# endif +#endif +#if !defined(psnip_trap) +# if defined(_MSC_VER) || defined(__INTEL_COMPILER) +# define psnip_trap() __debugbreak() +# elif defined(__ARMCC_VERSION) +# define psnip_trap() __breakpoint(42) +# elif defined(__ibmxl__) || defined(__xlC__) +# include +# define psnip_trap() __trap(42) +# elif defined(__DMC__) && defined(_M_IX86) + static inline void psnip_trap(void) { __asm int 3h; } +# elif defined(__i386__) || defined(__x86_64__) + static inline void psnip_trap(void) { __asm__ __volatile__("int3"); } +# elif defined(__thumb__) + static inline void psnip_trap(void) { __asm__ __volatile__(".inst 0xde01"); } +# elif defined(__aarch64__) + static inline void psnip_trap(void) { __asm__ __volatile__(".inst 0xd4200000"); } +# elif defined(__arm__) + static inline void psnip_trap(void) { __asm__ __volatile__(".inst 0xe7f001f0"); } +# elif defined (__alpha__) && !defined(__osf__) + static inline void psnip_trap(void) { __asm__ __volatile__("bpt"); } +# elif defined(_54_) + static inline void psnip_trap(void) { __asm__ __volatile__("ESTOP"); } +# elif defined(_55_) + static inline void psnip_trap(void) { __asm__ __volatile__(";\n .if (.MNEMONIC)\n ESTOP_1\n .else\n ESTOP_1()\n .endif\n NOP"); } +# elif defined(_64P_) + static inline void psnip_trap(void) { __asm__ __volatile__("SWBP 0"); } +# elif defined(_6x_) + static inline void psnip_trap(void) { __asm__ __volatile__("NOP\n .word 0x10000000"); } +# elif defined(__STDC_HOSTED__) && (__STDC_HOSTED__ == 0) && defined(__GNUC__) +# define psnip_trap() __builtin_trap() +# else +# include +# if defined(SIGTRAP) +# define psnip_trap() raise(SIGTRAP) +# else +# define psnip_trap() raise(SIGABRT) +# endif +# endif +#endif + +#if defined(HEDLEY_LIKELY) +# define PSNIP_DBG_LIKELY(expr) HEDLEY_LIKELY(expr) +#elif defined(__GNUC__) && (__GNUC__ >= 3) +# define PSNIP_DBG_LIKELY(expr) __builtin_expect(!!(expr), 1) +#else +# define PSNIP_DBG_LIKELY(expr) (!!(expr)) +#endif + +#if !defined(PSNIP_NDEBUG) || (PSNIP_NDEBUG == 0) +# define psnip_dbg_assert(expr) do { \ + if (!PSNIP_DBG_LIKELY(expr)) { \ + psnip_trap(); \ + } \ + } while (0) +#else +# define psnip_dbg_assert(expr) +#endif + +#endif /* !defined(PSNIP_DEBUG_TRAP_H) */ diff --git a/wpiutil/src/main/native/thirdparty/debugging/src/linux.cpp b/wpiutil/src/main/native/thirdparty/debugging/src/linux.cpp new file mode 100644 index 00000000000..40402a50f86 --- /dev/null +++ b/wpiutil/src/main/native/thirdparty/debugging/src/linux.cpp @@ -0,0 +1,25 @@ +#if defined(linux) || defined(__linux) || defined(__linux__) \ + || defined(__gnu_linux__) + +# include + +# include +# include +# include + +namespace wpi { + +bool is_debugger_present() noexcept +{ + std::ifstream proc_self_status_f("/proc/self/status"); + if (!proc_self_status_f) return false; + std::string buffer(256, '\0'); + proc_self_status_f.read(&buffer[0], 256); + auto index = buffer.find("TracerPid:\t"); + if (index == buffer.npos) return false; + return buffer[index + 11] != '0'; +} + +} // namespace wpi + +#endif diff --git a/wpiutil/src/main/native/thirdparty/debugging/src/macos.cpp b/wpiutil/src/main/native/thirdparty/debugging/src/macos.cpp new file mode 100644 index 00000000000..0e90a952d2c --- /dev/null +++ b/wpiutil/src/main/native/thirdparty/debugging/src/macos.cpp @@ -0,0 +1,36 @@ +#if defined(__APPLE__) && defined(__MACH__) + +# include + +# include +# include + +# include +# include + +template +auto exc = std::array { {} }; + +namespace wpi { + +bool is_debugger_present() noexcept +{ + mach_msg_type_number_t count {}; + auto masks = exc; + auto ports = exc; + auto behaviors = exc; + auto flavors = exc; + exception_mask_t mask + = EXC_MASK_ALL & ~(EXC_MASK_RESOURCE | EXC_MASK_GUARD); + kern_return_t result = task_get_exception_ports(mach_task_self(), mask, + masks.data(), &count, ports.data(), behaviors.data(), flavors.data()); + if (result != KERN_SUCCESS) return false; + auto valid = [](auto port) { return MACH_PORT_VALID(port); }; + auto begin = std::begin(ports); + auto end = begin + count; + return end != std::find_if(begin, end, valid); +} + +} // namespace wpi + +#endif diff --git a/wpiutil/src/main/native/thirdparty/debugging/src/windows.cpp b/wpiutil/src/main/native/thirdparty/debugging/src/windows.cpp new file mode 100644 index 00000000000..465c92fbd6a --- /dev/null +++ b/wpiutil/src/main/native/thirdparty/debugging/src/windows.cpp @@ -0,0 +1,18 @@ +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) \ + || defined(__TOS_WIN__) || defined(__WINDOWS__) + +# include + +# define WIN32_LEAN_AND_MEAN +# include + +namespace wpi { + +bool is_debugger_present() noexcept +{ + return ::IsDebuggerPresent(); +} + +} // namespace wpi + +#endif diff --git a/wpiutil/src/test/native/cpp/debugging/DebuggingTest.cpp b/wpiutil/src/test/native/cpp/debugging/DebuggingTest.cpp new file mode 100644 index 00000000000..76d7d47cfb6 --- /dev/null +++ b/wpiutil/src/test/native/cpp/debugging/DebuggingTest.cpp @@ -0,0 +1,10 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include +#include + +TEST(DebuggingTest, IsDebuggerPresent) { + EXPECT_FALSE(wpi::is_debugger_present()); +}