Re: [hatari-devel] Hatari debug mode

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 30.7.2025 20.41, Christian Zietz wrote:
PS: I could potentially test it earlier if I get a (pipeline-provided) binary. Then again, I can imagine that you don't want to push untested changes to the repo so close to a new release...

Although, even without testing, I wonder if the patch is really doing what you (Eero) probably intended.

DebugUI_Init() is called unconditionally at the end of Main_Init():
https://framagit.org/hatari/hatari/-/ blob/7772819bc1191065b3ee9c055967b239eeab9d51/src/main.c#L855 ... not just when the user presses AltGr+Pause. Wouldn't the patch therefore *always* open a console on Windows?

Thanks, good catch!

Attached is a better patch.


	- Eero
From 0d28c24e3665e9316acc821b08df9d943f506d0f Mon Sep 17 00:00:00 2001
From: Eero Tamminen <oak@xxxxxxxxxxxxxx>
Date: Mon, 28 Jul 2025 02:30:58 +0300
Subject: [PATCH] Open Windows console automatically for Debugger

---
 src/debug/debugui.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/debug/debugui.c b/src/debug/debugui.c
index 563a87d4..7519188d 100644
--- a/src/debug/debugui.c
+++ b/src/debug/debugui.c
@@ -1231,6 +1231,10 @@ void DebugUI(debug_reason_t reason)
 
 	if (welcome)
 	{
+#ifdef WIN32
+		/* in case user forgot -W option */
+		Win_ForceCon();
+#endif
 		fputs(welcome, stderr);
 		welcome = NULL;
 	}
-- 
2.39.5



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/