-
Notifications
You must be signed in to change notification settings - Fork 14.9k
WIP - [libc++][debugging] P2546R5: Debugging support & P2810R4: is_debugger_present
is_replaceable
#81447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP - [libc++][debugging] P2546R5: Debugging support & P2810R4: is_debugger_present
is_replaceable
#81447
Changes from 73 commits
f7afcf0
a515dfe
0b234ca
edb16ed
4edac79
e3d3961
0b2f4d6
3e26e97
64a1388
5800288
1359120
0941ab6
18599db
017f36d
b9b74f6
fc8dc5f
c0b10dc
d6ed5c8
509c777
7d9be28
c6e1684
1845333
8d0dc6f
3d5a02e
f9104b4
a090ef6
3e5a846
84bdcaf
002e5a0
579557f
60a35be
fbda08b
44a3e47
cadf300
154b0d4
70d6b51
108ca69
6807b1f
6d6d49b
8f1c1ce
d6216c5
3516d18
49f2cd4
729a608
caa3f7b
0c75f9d
8cc720d
c609239
738062a
679a3e3
37fe2db
44a5913
2504803
97a0d81
68bdcd6
4ccec04
4ce6d08
d2beb6d
00ccdc9
068ea09
3f73a5f
6c20ab0
c052213
eefea95
9aba1d5
64d2ca4
de52af4
22d859c
ca3f0df
e530005
60bb941
ac1a048
e0443bb
67264be
b9d83ef
a3059ff
cbd0f8c
b65ca20
989cbfe
7975d7b
59f5746
0ff4b5f
edd94d3
341640f
f065621
9495bb4
8d64955
ad96846
e248654
9b7146d
bbd3339
5da1919
cddde4a
3f1297c
6bcdb6e
c70e05c
514d934
d2783a1
fb147de
ebc626e
b8352d2
db11c96
bba40e3
e1eef5a
c85ee58
38a59b7
413c867
625268c
7e72a48
42b0086
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -918,6 +918,7 @@ set(files | |
cuchar | ||
cwchar | ||
cwctype | ||
debugging | ||
deque | ||
errno.h | ||
exception | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,6 +409,7 @@ _LIBCPP_HARDENING_MODE_DEBUG | |
# define _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN | ||
# define _LIBCPP_HAS_NO_EXPERIMENTAL_TZDB | ||
# define _LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM | ||
# define _LIBCPP_HAS_NO_INCOMPLETE_DEBUGGING | ||
# endif | ||
|
||
// Need to detect which libc we're using if we're on Linux. | ||
|
@@ -1460,6 +1461,11 @@ typedef __char32_t char32_t; | |
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER | ||
# endif | ||
|
||
# if (defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__) || defined(_LIBCPP_WIN32API) || defined(_AIX)) && \ | ||
!defined(__PICOLIBC__) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_DEBUGGING) | ||
# define _LIBCPP_HAS_DEBUGGING | ||
# endif | ||
|
||
|
||
#endif // __cplusplus | ||
|
||
#endif // _LIBCPP___CONFIG |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// -*- 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_AVAILABILITY_DEBUGGING _LIBCPP_EXPORTED_FROM_ABI void __breakpoint() noexcept; | ||
|
||
_LIBCPP_AVAILABILITY_DEBUGGING _LIBCPP_HIDE_FROM_ABI inline void breakpoint() noexcept { | ||
|
||
# if __has_builtin(__builtin_debugtrap) | ||
__builtin_debugtrap(); | ||
# elif defined(_MSC_VER) | ||
__debugbreak(); | ||
|
||
# else | ||
__breakpoint(); | ||
# endif | ||
} | ||
|
||
_LIBCPP_AVAILABILITY_DEBUGGING _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_OVERRIDABLE_FUNC_VIS bool | ||
is_debugger_present() noexcept; | ||
|
||
_LIBCPP_AVAILABILITY_DEBUGGING _LIBCPP_HIDE_FROM_ABI inline void breakpoint_if_debugging() noexcept { | ||
if (is_debugger_present()) | ||
breakpoint(); | ||
} | ||
|
||
#endif | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP_DEBUGGING |
Uh oh!
There was an error while loading. Please reload this page.