[libcxx-commits] [libcxx] WIP - [libc++][debugging] P2546R5: Debugging support & P2810R4: `is_debugger_present` `is_replaceable` (PR #81447)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 28 08:54:38 PDT 2024


================
@@ -0,0 +1,160 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <debugging>
+
+#if defined(_LIBCPP_WIN32API)
+#  define WIN32_LEAN_AND_MEAN
+#  define NOMINMAX
+#  include <windows.h>
+#elif defined(__APPLE__) || defined(__FreeBSD__)
+#  if defined(__FreeBSD__)
+#    include <libutil.h>
+#    include <sys/param.h>
+#    include <sys/proc.h>
+#    include <sys/user.h>
+#  endif // defined(__FreeBSD__)
+#  include <array>
+#  include <csignal>
+#  include <sys/sysctl.h>
+#  include <sys/types.h>
+#  include <unistd.h>
+#elif defined(__linux__)
+#  include <csignal>
+#  include <fstream>
+#  include <string>
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(_LIBCPP_HAS_DEBUGGING)
+
+// `breakpoint()` implementation
+
+#  if defined(_LIBCPP_WIN32API)
+
+void __breakpoint() noexcept { DebugBreak(); }
----------------
H-G-Hristov wrote:

thanks!

https://github.com/llvm/llvm-project/pull/81447


More information about the libcxx-commits mailing list