Skip to content

Commit 220cb74

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

File tree

2 files changed

+97
-97
lines changed

2 files changed

+97
-97
lines changed

source/diagnostics.tex

+95-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
\ref{assertions} & Assertions & \tcode{<cassert>} \\ \rowsep
2121
\ref{errno} & Error numbers & \tcode{<cerrno>} \\ \rowsep
2222
\ref{syserr} & System error support & \tcode{<system_error>} \\ \rowsep
23-
\ref{stacktrace} & Stacktrace & \tcode{<stacktrace>} \\
23+
\ref{stacktrace} & Stacktrace & \tcode{<stacktrace>} \\ \rowsep
24+
\ref{debugging} & Debugging & \tcode{<debugging>} \\
2425
\end{libsumtab}
2526

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

source/utilities.tex

+2-96
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
\begin{libsumtab}{General utilities library summary}{utilities.summary}
1313
\ref{utility} & Utility components & \tcode{<utility>} \\
14-
\ref{pairs} & Pairs & \\ \rowsep
14+
\ref{pairs} & Pairs & \\ \rowsep
1515
\ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
1616
\ref{optional} & Optional objects & \tcode{<optional>} \\ \rowsep
1717
\ref{variant} & Variants & \tcode{<variant>} \\ \rowsep
@@ -23,8 +23,7 @@
2323
\ref{execpol} & Execution policies & \tcode{<execution>} \\ \rowsep
2424
\ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
2525
\ref{format} & Formatting & \tcode{<format>} \\ \rowsep
26-
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
27-
\ref{debugging} & Debugging & \tcode{<debugging>} \\
26+
\ref{bit} & Bit manipulation & \tcode{<bit>} \\
2827
\end{libsumtab}
2928

3029
\rSec1[utility]{Utility components}
@@ -19433,96 +19432,3 @@
1943319432
Otherwise, \tcode{endian::native} is not equal
1943419433
to either \tcode{endian::big} or \tcode{endian::little}.
1943519434
\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)