| 231 | static bool g_symInitialized = false; |
| 232 | |
| 233 | static void init_symbols() { |
| 234 | if (g_symInitialized) return; |
| 235 | // FAIL_CRITICAL_ERRORS + NO_PROMPTS: never pop dialogs. |
| 236 | // OMAP_FIND_NEAREST: BBT-optimized binaries. |
| 237 | // fInvadeProcess=TRUE + DEFERRED_LOADS: enumerate now, map PDBs on first use. |
| 238 | SymSetOptions(SYMOPT_LOAD_LINES | SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | |
| 239 | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_FAIL_CRITICAL_ERRORS | |
| 240 | SYMOPT_NO_PROMPTS | SYMOPT_INCLUDE_32BIT_MODULES); |
| 241 | if (SymInitialize(GetCurrentProcess(), nullptr, TRUE)) { |
| 242 | g_symInitialized = true; |
| 243 | SymRefreshModuleList(GetCurrentProcess()); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | // Suppress symbol name when SymFromAddr falls back to a distant match — |
| 248 | // 64KB is generous for one function; typical codegen funcs are under 4KB. |