From: Toni Wilen Date: Wed, 27 Mar 2024 18:19:22 +0000 (+0200) Subject: Do not open console window automatically when debugger message is logged. X-Git-Tag: 5300~62 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6beb1bb00211ba9da5cb219ea8f163b0a98f90e5;p=francis%2Fwinuae.git Do not open console window automatically when debugger message is logged. --- diff --git a/debug.cpp b/debug.cpp index efc7125d..4a7e4e65 100644 --- a/debug.cpp +++ b/debug.cpp @@ -118,6 +118,7 @@ void activate_debugger (void) return; debugger_load_libraries(); + open_console(); debugger_used = 1; inside_debugger = 1; @@ -7169,6 +7170,7 @@ static TCHAR input[MAX_LINEWIDTH]; static void debug_1 (void) { + open_console(); custom_dumpstate(0); m68k_dumpstate(&nextpc, debug_pc); debug_pc = 0xffffffff; diff --git a/include/sysdeps.h b/include/sysdeps.h index 5508440a..97f24335 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -456,7 +456,8 @@ extern int read_log(void); extern void flush_log (void); extern TCHAR *setconsolemode (TCHAR *buffer, int maxlen); extern void close_console (void); -extern void reopen_console (void); +extern void open_console(void); +extern void reopen_console(void); extern void activate_console (void); extern void console_out (const TCHAR *); extern void console_out_f (const TCHAR *, ...); diff --git a/od-win32/writelog.cpp b/od-win32/writelog.cpp index 8add362c..415eaa9f 100644 --- a/od-win32/writelog.cpp +++ b/od-win32/writelog.cpp @@ -197,6 +197,13 @@ void debugger_change (int mode) openconsole (); } +void open_console(void) +{ + if (!consoleopen) { + openconsole(); + } +} + void reopen_console (void) { HWND hwnd; @@ -363,7 +370,7 @@ static void console_put (const TCHAR *buffer) if (console_buffer) { if (_tcslen (console_buffer) + _tcslen (buffer) < console_buffer_size) _tcscat (console_buffer, buffer); - } else { + } else if (consoleopen) { openconsole (); writeconsole (buffer); } @@ -632,7 +639,7 @@ void write_logx(const TCHAR *format, ...) break; } bufp[bufsize - 1] = 0; - if (1) { + if (consoleopen) { writeconsole (bufp); } if (debugfile) { @@ -732,7 +739,7 @@ void f_out (void *f, const TCHAR *format, ...) va_list parms; va_start (parms, format); - if (f == NULL) + if (f == NULL || !consoleopen) return; count = _vsntprintf (buffer, WRITE_LOG_BUF_SIZE - 1, format, parms); openconsole ();