[libcxx-commits] [libcxx] [libc++][docs] Clarify documentation for `is_debugger_present` (PR #229907)
William Tran-Viet via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 7 13:53:51 PDT 2026
https://github.com/smallp-o-p created https://github.com/llvm/llvm-project/pull/229907
None
>From aa195ecedd1b67730cb82a6f932060474e0fee77 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Wed, 7 Oct 2026 16:52:26 -0400
Subject: [PATCH] Clarify some documentation regarding `is_debugger_present`
---
libcxx/docs/ImplementationDefinedBehavior.md | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libcxx/docs/ImplementationDefinedBehavior.md b/libcxx/docs/ImplementationDefinedBehavior.md
index e14a45ee75fbf..16c76dd5d2023 100644
--- a/libcxx/docs/ImplementationDefinedBehavior.md
+++ b/libcxx/docs/ImplementationDefinedBehavior.md
@@ -66,10 +66,10 @@ to its capacity and uses that size. This means the SSO buffer of
Libc++ implements `std::is_debugger_present()` differently depending on the host platform:
-- Linux: `/proc/self/status` is read for the `TracerPid` entry and returns true if it is not equal to 0.
+- Linux: `/proc/self/status` is read for the `TracerPid` entry and if it is equal to 0, returns `false`.
Otherwise, the command name of the tracer PID is looked up, and a best effort is made to identify whether
- its process name is a recognized debugger: "gdb", "gdbserver" or "lldb-server". False is returned if the process'
- name is not in this list.
+ the tracer process' name is a recognized debugger: "gdb", "gdbserver" or "lldb-server". False is returned
+ if it is not in this list.
- Darwin & FreeBSD: `sysctl` is called to retrieve the current process information and check if the `P_TRACED`
flag is set in the returned info.
@@ -81,6 +81,8 @@ Libc++ implements `std::is_debugger_present()` differently depending on the host
- Windows: Calls `IsDebuggerPresent()`.
+- Default: Returns `false`.
+
It is also defined as a weak symbol in the library to allow it to be replaceable, as per the standard, so a user may
redefine it with their own implementation.
More information about the libcxx-commits
mailing list