Skip to content

Commit 642303b

Browse files
authored
Use symbolic constants in implementation of stacktrace (#3292)
1 parent 1b7ab6e commit 642303b

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

stl/src/stacktrace.cpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// clang-format off
1313
#include <initguid.h> // should be before any header that includes <guiddef.h>
1414
#include <DbgEng.h>
15+
#include <DbgHelp.h>
1516
#include <Shlwapi.h>
1617
// clang-format on
1718

@@ -104,23 +105,15 @@ namespace {
104105
(void) debug_control->WaitForEvent(0, INFINITE);
105106
}
106107

107-
constexpr ULONG add_options = 0x1 /* SYMOPT_CASE_INSENSITIVE */
108-
| 0x2 /* SYMOPT_UNDNAME */
109-
| 0x4 /* SYMOPT_DEFERRED_LOADS */
110-
| 0x10 /* SYMOPT_LOAD_LINES */
111-
| 0x20 /* SYMOPT_OMAP_FIND_NEAREST */
112-
| 0x100 /* SYMOPT_FAIL_CRITICAL_ERRORS */
113-
| 0x10000 /* SYMOPT_AUTO_PUBLICS */
114-
| 0x80000 /* SYMOPT_NO_PROMPTS */;
115-
116-
constexpr ULONG remove_options = 0x8 /* SYMOPT_NO_CPP */
117-
| 0x40 /* SYMOPT_LOAD_ANYTHING */
118-
| 0x100 /* SYMOPT_NO_UNQUALIFIED_LOADS */
119-
| 0x400 /* SYMOPT_EXACT_SYMBOLS */
120-
| 0x1000 /* SYMOPT_IGNORE_NT_SYMPATH */
121-
| 0x4000 /* SYMOPT_PUBLICS_ONLY */
122-
| 0x8000 /* SYMOPT_NO_PUBLICS */
123-
| 0x20000 /* SYMOPT_NO_IMAGE_SEARCH */;
108+
constexpr ULONG add_options = SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS
109+
| SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST
110+
| SYMOPT_FAIL_CRITICAL_ERRORS | SYMOPT_AUTO_PUBLICS
111+
| SYMOPT_NO_PROMPTS;
112+
113+
constexpr ULONG remove_options = SYMOPT_NO_CPP | SYMOPT_LOAD_ANYTHING
114+
| SYMOPT_NO_UNQUALIFIED_LOADS | SYMOPT_EXACT_SYMBOLS
115+
| SYMOPT_IGNORE_NT_SYMPATH | SYMOPT_PUBLICS_ONLY
116+
| SYMOPT_NO_PUBLICS | SYMOPT_NO_IMAGE_SEARCH;
124117

125118
(void) debug_symbols->AddSymbolOptions(add_options);
126119
(void) debug_symbols->RemoveSymbolOptions(remove_options);

0 commit comments

Comments
 (0)