22<feed xmlns =" http://www.w3.org/2005/Atom" >
33 <title >cpprefjp - C++日本語リファレンス</title >
44 <link href =" https://cpprefjp.github.io" />
5- <updated >2024-09-18T14:41:41.551737 </updated >
6- <id >cc0b59e3-7b51-43b7-b49b-34d3ec3a1786 </id >
5+ <updated >2024-09-19T13:53:45.717588 </updated >
6+ <id >d2379c90-01e7-4fb4-8ff8-a8ccdc48e85b </id >
77
88
9+ <entry >
10+ <title >debugging -- fix typo</title >
11+ <link href =" https://cpprefjp.github.io/reference/debugging.html" />
12+ <id >d9d9c67a6159d03bc09fd61e50d4b802a36aae64:reference/debugging.md</id >
13+ <updated >2024-09-19T22:47:18+09:00</updated >
14+
15+ <content type =" html" >< div class=" header">& lt;debugging& gt;< /div>< h1 itemprop=" name">< span class=" token"> debugging< /span>< span class=" cpp cpp26" title=" C++26で追加"> (C++26)< /span>< /h1>
16+ < div itemprop=" articleBody">< p>< code>& lt;debugging& gt;< /code> ヘッダでは、プログラムのデバッグ実行をサポートする機能を提供する。< /p>
17+ < table border=" 1" bordercolor=" #888" style=" border-collapse:collapse">
18+ < thead>
19+ < tr>
20+ < th> 名前< /th>
21+ < th> 説明< /th>
22+ < th> 対応バージョン< /th>
23+ < /tr>
24+ < /thead>
25+ < tbody>
26+ < tr>
27+ < td>< code>< a href=" debugging/breakpoint.html"> breakpoint< /a>< /code>< /td>
28+ < td> ブレークポイントを設置する (functional)< /td>
29+ < td> C++26< /td>
30+ < /tr>
31+ < tr>
32+ < td>< code>< a href=" debugging/breakpoint_if_debugging.html"> breakpoint_if_debugging< /a>< /code>< /td>
33+ < td> デバッガ実行時のみブレークポイントを設置する (functional)< /td>
34+ < td> C++26< /td>
35+ < /tr>
36+ < tr>
37+ < td>< code>< a href=" debugging/is_debugger_present.html"> is_debugger_present< /a>< /code>< /td>
38+ < td> デバッガ実行中か判定する (functional)< /td>
39+ < td> C++26< /td>
40+ < /tr>
41+ < /tbody>
42+ < /table>
43+ < h2> この機能が必要になった背景・経緯< /h2>
44+ < p> 開発プラットフォームによってデバッガやブレークポイントの機能は提供されているが、本ライブラリのようにプログラム中に明示的にブレークポイントを設置し、プログラムとデバッガを対話させることでデバッグ体験が向上することがある。< /p>
45+ < p> 実装経験としては以下のようなものがあり、これらをこのライブラリで標準化した:< /p>
46+ < table border=" 1" bordercolor=" #888" style=" border-collapse:collapse">
47+ < thead>
48+ < tr>
49+ < th> 開発環境< /th>
50+ < th> 機能< /th>
51+ < /tr>
52+ < /thead>
53+ < tbody>
54+ < tr>
55+ < td> Microsoft C/C++ Optimizing Compiler< /td>
56+ < td>< code> __debugbreak()< /code> 関数 (無条件ブレークポイント)< /td>
57+ < /tr>
58+ < tr>
59+ < td> Win32 API< /td>
60+ < td>< code> IsDebuggerPresent()< /code> 関数 (デバッガ実行中か判定)< /td>
61+ < /tr>
62+ < tr>
63+ < td> LLVM Clang< /td>
64+ < td>< code> __builtin_debugtrap()< /code> 組み込み関数 (無条件ブレークポイント)< /td>
65+ < /tr>
66+ < tr>
67+ < td> arm Keil, ARM Compiler< /td>
68+ < td>< code> __breakpoint()< /code> 関数 (無条件ブレークポイント)< /td>
69+ < /tr>
70+ < tr>
71+ < td> Portable Snippetsライブラリ< /td>
72+ < td>< code> psnip_trap()< /code> 関数 (無条件ブレークポイント)< /td>
73+ < /tr>
74+ < tr>
75+ < td> Debug Breakライブラリ< /td>
76+ < td>< code> debug_break()< /code> 関数 (無条件ブレークポイント)< /td>
77+ < /tr>
78+ < tr>
79+ < td> Boost.Testライブラリ< /td>
80+ < td>< code> debugger_break()< /code> 関数 (無条件ブレークポイント)< br /> < code> under_debugger()< /code> 関数 (デバッガ実行中か判定)< /td>
81+ < /tr>
82+ < tr>
83+ < td> EASTLライブラリ< /td>
84+ < td>< code> EASTL_DEBUG_BREAK()< /code> マクロ (無条件ブレークポイント)< /td>
85+ < /tr>
86+ < tr>
87+ < td> Catch2ライブラリ< /td>
88+ < td>< code> CATCH_TRAP< /code> マクロ (無条件ブレークポイント)< br /> < code> CATCH_BREAK_INTO_DEBUGGER< /code> マクロ (条件付きブレークポイント)< br /> < code> isDebuggerActive()< /code> 関数 (デバッガ実行中か判定)< /td>
89+ < /tr>
90+ < tr>
91+ < td> JUCEライブラリ< /td>
92+ < td>< code> JUCE_BREAK_IN_DEBUGGER< /code> マクロ (無条件ブレークポイント)< br /> < code> juce_isRunningUnderDebugger()< /code> 関数、< code> Process::isRunningUnderDebugger()< /code> 関数 (デバッガ実行中か判定)< /td>
93+ < /tr>
94+ < tr>
95+ < td> ImGuiライブラリ< /td>
96+ < td>< code> IM_DEBUG_BREAK()< /code> マクロ (無条件ブレークポイント)< /td>
97+ < /tr>
98+ < tr>
99+ < td> AWS C SDK< /td>
100+ < td>< code> aws_debug_break()< /code> 関数 (条件付きブレークポイント)< br /> < code> aws_is_debugger_present()< /code> 関数 (デバッガ実行中か判定)< /td>
101+ < /tr>
102+ < tr>
103+ < td> UnrealEngine< /td>
104+ < td>< code> UE_DEBUG_BREAK< /code> マクロ (条件付きブレークポイント)< br /> < code> IsDebuggerPresent()< /code> 関数 (デバッガ実行中か判定)< /td>
105+ < /tr>
106+ < /tbody>
107+ < /table>
108+ < h2> バージョン< /h2>
109+ < h3> 言語< /h3>
110+ < ul>
111+ < li> C++26< /li>
112+ < /ul>
113+ < h2> 参照< /h2>
114+ < ul>
115+ < li>< a href=" https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2546r5.html" target=" _blank"> P2546R5 Debugging Support< /a>< /li>
116+ < /ul>< /div> </content >
117+
118+ <author >
119+ <name >raclamusi</name >
120+ 121+ </author >
122+ </entry >
123+
9124 <entry >
10125 <title >breakpoint -- < debugging> : ユースケースを記載 #1232</title >
11126 <link href =" https://cpprefjp.github.io/reference/debugging/breakpoint.html" />
@@ -397,144 +512,4 @@ index 645a59e5c..fe1c0188b 100644
397512 </author >
398513 </entry >
399514
400- <entry >
401- <title >breakpoint -- < debugging> : コード例が間違ってたのを修正 #1232</title >
402- <link href =" https://cpprefjp.github.io/reference/debugging/breakpoint.html" />
403- <id >a4346b7d7da2873721b6dce28c8ce9811a6da22d:reference/debugging/breakpoint.md</id >
404- <updated >2024-09-18T13:13:25+09:00</updated >
405-
406- <summary type =" html" >< pre>< code> diff --git a/reference/debugging/breakpoint.md b/reference/debugging/breakpoint.md
407- index eca120ffc..62f370aef 100644
408- --- a/reference/debugging/breakpoint.md
409- +++ b/reference/debugging/breakpoint.md
410- @@ -47,11 +47,12 @@ double g(double a, double b) {
411-
412- double f(double a, double b) {
413- double ret = g(a, b);
414- - if (std::isnan(ret)) {
415- - // 演算結果でNaNが発生したらブレークし、
416- + if (std::isnan(ret) || std::isinf(ret)) {
417- + // 演算結果でNaNかinfが発生したらブレークし、
418- // デバッガでパラメータ (ローカル変数) などを確認する
419- std::breakpoint();
420- }
421- + return ret;
422- }
423-
424- int main() {
425- @@ -61,9 +62,11 @@ int main() {
426- ```
427- * std::breakpoint[color ff0000]
428- * std::isnan[link /reference/cmath/isnan.md]
429- +* std::isinf[link /reference/cmath/isinf.md]
430-
431- -### 出力
432- +### 出力例
433- ```
434- +inf
435- ```
436-
437-
438- < /code>< /pre> </summary >
439-
440- <author >
441- <name >Akira Takahashi</name >
442- 443- </author >
444- </entry >
445-
446- <entry >
447- <title >breakpoint_if_debugging -- < debugging> : コード例が間違ってたのを修正 #1232</title >
448- <link href =" https://cpprefjp.github.io/reference/debugging/breakpoint_if_debugging.html" />
449- <id >a4346b7d7da2873721b6dce28c8ce9811a6da22d:reference/debugging/breakpoint_if_debugging.md</id >
450- <updated >2024-09-18T13:13:25+09:00</updated >
451-
452- <summary type =" html" >< pre>< code> diff --git a/reference/debugging/breakpoint_if_debugging.md b/reference/debugging/breakpoint_if_debugging.md
453- index 742e93cb9..482559fa2 100644
454- --- a/reference/debugging/breakpoint_if_debugging.md
455- +++ b/reference/debugging/breakpoint_if_debugging.md
456- @@ -49,11 +49,12 @@ double g(double a, double b) {
457-
458- double f(double a, double b) {
459- double ret = g(a, b);
460- - if (std::isnan(ret)) {
461- - // 演算結果でNaNが発生したらブレークし、
462- + if (std::isnan(ret) || std::isinf(ret)) {
463- + // 演算結果でNaNかinfが発生したらブレークし、
464- // デバッガでパラメータ (ローカル変数) などを確認する
465- std::breakpoint_if_debugging();
466- }
467- + return ret;
468- }
469-
470- int main() {
471- @@ -63,9 +64,11 @@ int main() {
472- ```
473- * std::breakpoint_if_debugging[color ff0000]
474- * std::isnan[link /reference/cmath/isnan.md]
475- +* std::isinf[link /reference/cmath/isinf.md]
476-
477- -### 出力
478- +### 出力例
479- ```
480- +inf
481- ```
482-
483-
484- < /code>< /pre> </summary >
485-
486- <author >
487- <name >Akira Takahashi</name >
488- 489- </author >
490- </entry >
491-
492- <entry >
493- <title >is_debugger_present -- < debugging> : コード例が間違ってたのを修正 #1232</title >
494- <link href =" https://cpprefjp.github.io/reference/debugging/is_debugger_present.html" />
495- <id >a4346b7d7da2873721b6dce28c8ce9811a6da22d:reference/debugging/is_debugger_present.md</id >
496- <updated >2024-09-18T13:13:25+09:00</updated >
497-
498- <summary type =" html" >< pre>< code> diff --git a/reference/debugging/is_debugger_present.md b/reference/debugging/is_debugger_present.md
499- index 4cabd44f4..721f4f41e 100644
500- --- a/reference/debugging/is_debugger_present.md
501- +++ b/reference/debugging/is_debugger_present.md
502- @@ -55,13 +55,14 @@ double g(double a, double b) {
503-
504- double f(double a, double b) {
505- double ret = g(a, b);
506- - if (std::isnan(ret)) {
507- - // 演算結果でNaNが発生したらブレークし、
508- + if (std::isnan(ret) || std::isinf(ret)) {
509- + // 演算結果でNaNかinfが発生したらブレークし、
510- // デバッガでパラメータ (ローカル変数) などを確認する
511- if (std::is_debugger_present()) {
512- std::breakpoint();
513- }
514- }
515- + return ret;
516- }
517-
518- int main() {
519- @@ -72,9 +73,11 @@ int main() {
520- * std::is_debugger_present[color ff0000]
521- * std::breakpoint[link breakpoint.md]
522- * std::isnan[link /reference/cmath/isnan.md]
523- +* std::isinf[link /reference/cmath/isinf.md]
524-
525- -### 出力
526- +### 出力例
527- ```
528- +inf
529- ```
530-
531-
532- < /code>< /pre> </summary >
533-
534- <author >
535- <name >Akira Takahashi</name >
536- 537- </author >
538- </entry >
539-
540515</feed >
0 commit comments