Skip to content

Commit ec10aae

Browse files
[debugging.utility] Clarify wording in notes
The previous wording in the notes in `breakpoint` and `is_debugger_present` read as statements of fact about the implementation-defined behaviour. The statements are actually ones of intent. The specific claim in `breakpoint` that the debugger resumes execution of the program as if the function was not invoked is confusing considering that the debugger may effect side-effects or cause execution to resume from a different evaluation. Instead, the idea is that `breakpoint` is not responsible for causing the translation process to make special accomodations for resumption of execution other than in cases where the debugger was strictly used for observation only. In `is_debugger_present`, the functionality ascribed to POSIX by the wording ("ptrace") is not present in POSIX. Update to reference the LSB and to use the corresponding terminology ("tracing process"). The wording implies a preference to return `true` in case it is unknown whether a debugger is present. Add a critical "only" to fix that.
1 parent 4552a92 commit ec10aae

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

source/diagnostics.tex

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,10 +2447,13 @@
24472447
The semantics of this function are \impldef{semantics of \tcode{breakpoint}}.
24482448

24492449
\begin{note}
2450-
When invoked, the execution of the program temporarily halts and execution is
2451-
handed to the debugger until such a time as: The program is terminated by the
2452-
debugger, or the debugger resumes execution of the program as if the function
2453-
was not invoked.
2450+
It is intended that, when invoked with a debugger present, the execution of the
2451+
program temporarily halts and execution is handed to the debugger until the
2452+
program is either terminated by the debugger or the debugger resumes execution
2453+
of the program as if the function was not invoked. In particular, there is no
2454+
intent for a call to this function to accomodate resumption of the program in a
2455+
different manner. If there is no debugger present, execution of the program can
2456+
end abnormally.
24542457
\end{note}
24552458

24562459
\end{itemdescr}
@@ -2486,12 +2489,13 @@
24862489
\impldef{default semantics of \tcode{is_debugger_present}}.
24872490

24882491
\begin{note}
2489-
When tracing the execution of a program with a debugger, an implementation
2490-
returns \tcode{true}. An implementation performs an immediate query, as needed,
2491-
to determine if the program is traced by a debugger. On Windows or equivalent
2492-
systems, this can be achieved by calling the \tcode{::IsDebuggerPresent()} Win32
2493-
function. On POSIX, this can be achieved by checking for a tracer parent process,
2494-
with best effort determination that such a tracer parent process is a debugger.
2492+
It is intended that, using an immediate (uncached) query to determine if the
2493+
program is being traced by a debugger, an implementation returns \tcode{true}
2494+
only when tracing the execution of the program with a debugger. On Windows or
2495+
equivalent systems, this can be achieved by calling the
2496+
\tcode{::IsDebuggerPresent()} Win32 function. For systems compatible with
2497+
ISO/IEC 23360:2021, this can be achieved by checking for a tracing process, with
2498+
a best-effort determination that such a tracing process is a debugger.
24952499
\end{note}
24962500

24972501
\pnum

0 commit comments

Comments
 (0)