From ac521a8f601672b7d8edea045b7d62c5eed21d63 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 18 Jan 2024 10:36:15 -0800 Subject: [PATCH] do not use graphical error reporting in auto-launched conversion instances of the debugger; will fix repeated debug info conversion fatal error exception message boxes --- src/dbgi/dbgi.c | 1 + src/raddbg/raddbg_main.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dbgi/dbgi.c b/src/dbgi/dbgi.c index 5941248e..af061764 100644 --- a/src/dbgi/dbgi.c +++ b/src/dbgi/dbgi.c @@ -657,6 +657,7 @@ dbgi_parse_thread_entry_point(void *p) opts.consoleless = 1; str8_list_pushf(scratch.arena, &opts.cmd_line, "raddbg"); str8_list_pushf(scratch.arena, &opts.cmd_line, "--convert"); + str8_list_pushf(scratch.arena, &opts.cmd_line, "--quiet"); //str8_list_pushf(scratch.arena, &opts.cmd_line, "--capture"); str8_list_pushf(scratch.arena, &opts.cmd_line, "--exe:%S", exe_path); str8_list_pushf(scratch.arena, &opts.cmd_line, "--pdb:%S", og_dbg_path); diff --git a/src/raddbg/raddbg_main.cpp b/src/raddbg/raddbg_main.cpp index 8c7e2618..fc67c632 100644 --- a/src/raddbg/raddbg_main.cpp +++ b/src/raddbg/raddbg_main.cpp @@ -142,10 +142,15 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int n int argc; WCHAR **argv_16 = CommandLineToArgvW(command_line, &argc); char **argv = push_array(perm_arena, char *, argc); + B32 is_quiet = 0; for(int i = 0; i < argc; i += 1) { String16 arg16 = str16_cstring((U16 *)argv_16[i]); String8 arg8 = str8_from_16(perm_arena, arg16); + if(str8_match(arg8, str8_lit("--quiet"), StringMatchFlag_CaseInsensitive)) + { + is_quiet = 1; + } argv[i] = (char *)arg8.str; } __try @@ -154,9 +159,12 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int n } __except(win32_exception_filter(GetExceptionCode())) { - char buffer[256] = {0}; - raddbg_snprintf(buffer, sizeof(buffer), "A fatal exception (code 0x%x) occurred. The process is terminating.", (U32)g_saved_exception_code); - os_graphical_message(1, str8_lit("Fatal Exception"), str8_cstring(buffer)); + if(!is_quiet) + { + char buffer[256] = {0}; + raddbg_snprintf(buffer, sizeof(buffer), "A fatal exception (code 0x%x) occurred. The process is terminating.", (U32)g_saved_exception_code); + os_graphical_message(1, str8_lit("Fatal Exception"), str8_cstring(buffer)); + } ExitProcess(1); } return 0;