[libcxx-commits] [libcxx] [libc++][docs] Clarify documentation for `is_debugger_present` (PR #229907)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 7 13:54:36 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: William Tran-Viet (smallp-o-p)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/229907.diff


1 Files Affected:

- (modified) libcxx/docs/ImplementationDefinedBehavior.md (+5-3) 


``````````diff
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.
 

``````````

</details>


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


More information about the libcxx-commits mailing list