Skip to content

Commit ff96113

Browse files
committed
[debugging] Move [debugging] to the end of Clause [diagnostics]
Part of the C++26 clause restructuring (#5315).
1 parent fb34daf commit ff96113

File tree

2 files changed

+93
-93
lines changed

2 files changed

+93
-93
lines changed

source/diagnostics.tex

+93
Original file line numberDiff line numberDiff line change
@@ -2485,3 +2485,96 @@
24852485
\pnum
24862486
The specializations are enabled\iref{unord.hash}.
24872487
\end{itemdescr}
2488+
2489+
\rSec1[debugging]{Debugging}
2490+
2491+
\rSec2[debugging.general]{General}
2492+
2493+
\pnum
2494+
Subclause \ref{debugging} describes functionality to introspect and
2495+
interact with the execution of the program.
2496+
2497+
\begin{note}
2498+
The facilities provided by the debugging functionality interact with a program
2499+
that could be tracing the execution of a \Cpp{} program, such as a debugger.
2500+
\end{note}
2501+
2502+
\rSec2[debugging.syn]{Header \tcode{<debugging>} synopsis}
2503+
2504+
\indexheader{debugging}%
2505+
\begin{codeblock}
2506+
// all freestanding
2507+
namespace std {
2508+
// \ref{debugging.utility}, utility
2509+
void breakpoint() noexcept;
2510+
void breakpoint_if_debugging() noexcept;
2511+
bool is_debugger_present() noexcept;
2512+
}
2513+
\end{codeblock}
2514+
2515+
\rSec2[debugging.utility]{Utility}
2516+
2517+
\indexlibraryglobal{breakpoint}%
2518+
\begin{itemdecl}
2519+
void breakpoint() noexcept;
2520+
\end{itemdecl}
2521+
2522+
\begin{itemdescr}
2523+
2524+
\pnum
2525+
The semantics of this function are \impldef{semantics of \tcode{breakpoint}}.
2526+
2527+
\begin{note}
2528+
When invoked, the execution of the program temporarily halts and execution is
2529+
handed to the debugger until such a time as: The program is terminated by the
2530+
debugger, or the debugger resumes execution of the program as if the function
2531+
was not invoked.
2532+
\end{note}
2533+
2534+
\end{itemdescr}
2535+
2536+
\indexlibraryglobal{breakpoint_if_debugging}%
2537+
\begin{itemdecl}
2538+
void breakpoint_if_debugging() noexcept;
2539+
\end{itemdecl}
2540+
2541+
\begin{itemdescr}
2542+
2543+
\pnum
2544+
\effects
2545+
Equivalent to:
2546+
\begin{codeblock}
2547+
if (is_debugger_present()) breakpoint();
2548+
\end{codeblock}
2549+
2550+
\end{itemdescr}
2551+
2552+
\indexlibraryglobal{is_debugger_present}%
2553+
\begin{itemdecl}
2554+
bool is_debugger_present() noexcept;
2555+
\end{itemdecl}
2556+
2557+
\begin{itemdescr}
2558+
\pnum
2559+
\replaceable
2560+
A \Cpp{} program may define a function with this function signature, and
2561+
thereby displace the default version defined by the \Cpp{} standard library.
2562+
2563+
\pnum
2564+
\required
2565+
This function has no preconditions.
2566+
2567+
\pnum
2568+
\default
2569+
\impldef{default semantics of \tcode{is_debugger_present}}.
2570+
2571+
\begin{note}
2572+
When tracing the execution of a program with a debugger, an implementation
2573+
returns \tcode{true}. An implementation performs an immediate query, as needed,
2574+
to determine if the program is traced by a debugger. On Windows or equivalent
2575+
systems, this can be achieved by calling the \tcode{::IsDebuggerPresent()} Win32
2576+
function. On POSIX, this can be achieved by checking for a tracer parent process,
2577+
with best effort determination that such a tracer parent process is a debugger.
2578+
\end{note}
2579+
2580+
\end{itemdescr}

source/utilities.tex

-93
Original file line numberDiff line numberDiff line change
@@ -19433,96 +19433,3 @@
1943319433
Otherwise, \tcode{endian::native} is not equal
1943419434
to either \tcode{endian::big} or \tcode{endian::little}.
1943519435
\end{itemdescr}
19436-
19437-
\rSec1[debugging]{Debugging}
19438-
19439-
\rSec2[debugging.general]{General}
19440-
19441-
\pnum
19442-
Subclause \ref{debugging} describes functionality to introspect and
19443-
interact with the execution of the program.
19444-
19445-
\begin{note}
19446-
The facilities provided by the debugging functionality interact with a program
19447-
that could be tracing the execution of a \Cpp{} program, such as a debugger.
19448-
\end{note}
19449-
19450-
\rSec2[debugging.syn]{Header \tcode{<debugging>} synopsis}
19451-
19452-
\indexheader{debugging}%
19453-
\begin{codeblock}
19454-
// all freestanding
19455-
namespace std {
19456-
// \ref{debugging.utility}, utility
19457-
void breakpoint() noexcept;
19458-
void breakpoint_if_debugging() noexcept;
19459-
bool is_debugger_present() noexcept;
19460-
}
19461-
\end{codeblock}
19462-
19463-
\rSec2[debugging.utility]{Utility}
19464-
19465-
\indexlibraryglobal{breakpoint}%
19466-
\begin{itemdecl}
19467-
void breakpoint() noexcept;
19468-
\end{itemdecl}
19469-
19470-
\begin{itemdescr}
19471-
19472-
\pnum
19473-
The semantics of this function are \impldef{semantics of \tcode{breakpoint}}.
19474-
19475-
\begin{note}
19476-
When invoked, the execution of the program temporarily halts and execution is
19477-
handed to the debugger until such a time as: The program is terminated by the
19478-
debugger, or the debugger resumes execution of the program as if the function
19479-
was not invoked.
19480-
\end{note}
19481-
19482-
\end{itemdescr}
19483-
19484-
\indexlibraryglobal{breakpoint_if_debugging}%
19485-
\begin{itemdecl}
19486-
void breakpoint_if_debugging() noexcept;
19487-
\end{itemdecl}
19488-
19489-
\begin{itemdescr}
19490-
19491-
\pnum
19492-
\effects
19493-
Equivalent to:
19494-
\begin{codeblock}
19495-
if (is_debugger_present()) breakpoint();
19496-
\end{codeblock}
19497-
19498-
\end{itemdescr}
19499-
19500-
\indexlibraryglobal{is_debugger_present}%
19501-
\begin{itemdecl}
19502-
bool is_debugger_present() noexcept;
19503-
\end{itemdecl}
19504-
19505-
\begin{itemdescr}
19506-
\pnum
19507-
\replaceable
19508-
A \Cpp{} program may define a function with this function signature, and
19509-
thereby displace the default version defined by the \Cpp{} standard library.
19510-
19511-
\pnum
19512-
\required
19513-
This function has no preconditions.
19514-
19515-
\pnum
19516-
\default
19517-
\impldef{default semantics of \tcode{is_debugger_present}}.
19518-
19519-
\begin{note}
19520-
When tracing the execution of a program with a debugger, an implementation
19521-
returns \tcode{true}. An implementation performs an immediate query, as needed,
19522-
to determine if the program is traced by a debugger. On Windows or equivalent
19523-
systems, this can be achieved by calling the \tcode{::IsDebuggerPresent()} Win32
19524-
function. On POSIX, this can be achieved by checking for a tracer parent process,
19525-
with best effort determination that such a tracer parent process is a debugger.
19526-
\end{note}
19527-
19528-
\end{itemdescr}

0 commit comments

Comments
 (0)