[libcxx-commits] [libcxx] WIP - [libc++][debugging] P2546R5: Debugging support (PR #81447)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 3 07:27:16 PST 2024


================
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_DEBUGGING
+#define _LIBCPP_DEBUGGING
+
+/*
+// all freestanding
+namespace std {
+  // [debugging.utility], utility
+  void breakpoint() noexcept;
+  void breakpoint_if_debugging() noexcept;
+  bool is_debugger_present() noexcept;
+}
+*/
+
+#include <__config>
+#include <version>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26 && defined(_LIBCPP_HAS_DEBUGGING)
+
+_LIBCPP_EXPORTED_FROM_ABI void breakpoint() noexcept;
----------------
mordante wrote:

You need to add availability macros for these exports. (Have a look at the header `<__availability>`.)

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


More information about the libcxx-commits mailing list