sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (58fee3dab5fa121232b78b2a66f660bd11f44f22)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (58fee3dab5fa121232b78b2a66f660bd11f44f22)
- Date: Fri, 2 Oct 2026 00:21:43 +0000
GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:
emulators/bochs/DETAILS
| 1
emulators/bochs/HISTORY
| 7 +
emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
| 2
emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
| 4
emulators/bochs/patches/0003-gui-term.cc-close-the-debugger-pty-after-curses-has-shut-down.patch
| 66 ++++++++++
5 files changed, 77 insertions(+), 3 deletions(-)
New commits:
commit 58fee3dab5fa121232b78b2a66f660bd11f44f22
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
bochs: Fix terminal cleanup with -dbg
commit 43adab376e59b8e3a0ad27c00a7da8c12f20a0e4
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
bochs: Update patch status
diff --git a/emulators/bochs/DETAILS b/emulators/bochs/DETAILS
index f72831d..83f256a 100755
--- a/emulators/bochs/DETAILS
+++ b/emulators/bochs/DETAILS
@@ -1,5 +1,6 @@
SPELL=bochs
VERSION=3.0
+ PATCHLEVEL=1
SOURCE_HASH=sha512:d7e67eff6193bdfa7f76821fbc6f69021348894eba230d88e22ee590eb7e2bf594ef6d13c0f343ae07905573205acfef2a0608d5db92ee411e7b9b1f033d6d70
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
diff --git a/emulators/bochs/HISTORY b/emulators/bochs/HISTORY
index a1f0a66..02f12b7 100644
--- a/emulators/bochs/HISTORY
+++ b/emulators/bochs/HISTORY
@@ -1,3 +1,10 @@
+2026-10-02 Ismael Luceno <ismael AT sourcemage.org>
+ * patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch:
+ updated upstream status
+ *
patches/0003-gui-term.cc-close-the-debugger-pty-after-curses-has-shut-down.patch:
+ fixed debugger terminal being left in a broken state on exit
+ * DETAILS: PATCHLEVEL++
+
2026-08-23 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 3.0
*
patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch,
diff --git
a/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
b/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
index 6de61da..5d982f6 100644
---
a/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
+++
b/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
@@ -1,7 +1,7 @@
From d0b480f3c537cc23570885bdfdbcfcf819938f10 Mon Sep 17 00:00:00 2001
From: Volker Ruppert <Volker.Ruppert AT t-online.de>
Date: Thu, 17 Jul 2025 14:02:00 +0200
-Subject: [PATCH] Renaming basename function to bx_basename should fix
+Subject: [PATCH 1/3] Renaming basename function to bx_basename should fix
compilation issues.
Upstream-Status: Backport [commit 2c4053709bbf]
diff --git
a/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
b/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
index d1ba926..fc95cac 100644
---
a/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
+++
b/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
@@ -1,7 +1,7 @@
From 38e26b4e88724d431e7ab4aa3997e563d5a7a0cb Mon Sep 17 00:00:00 2001
From: Ismael Luceno <iluceno AT suse.de>
Date: Sat, 22 Aug 2026 10:56:13 +0200
-Subject: [PATCH 2/2] Use newterm instead of reassigning stdin/stdout
+Subject: [PATCH 2/3] Use newterm instead of reassigning stdin/stdout
The BX_DEBUGGER_TERM path pointed curses at a freshly opened pty by
assigning to stdin/stdout. glibc happens to declare those as plain
@@ -18,7 +18,7 @@ standard streams.
The fdopen mode also had to change from "wr" to "w+": "wr" is not a
valid mode string.
-Upstream-Status: Pending
+Upstream-Status: Accepted [https://github.com/bochs-emu/Bochs/pull/882]
Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
---
bochs/gui/term.cc | 15 +++++++--------
diff --git
a/emulators/bochs/patches/0003-gui-term.cc-close-the-debugger-pty-after-curses-has-shut-down.patch
b/emulators/bochs/patches/0003-gui-term.cc-close-the-debugger-pty-after-curses-has-shut-down.patch
new file mode 100644
index 0000000..e59125e
--- /dev/null
+++
b/emulators/bochs/patches/0003-gui-term.cc-close-the-debugger-pty-after-curses-has-shut-down.patch
@@ -0,0 +1,66 @@
+From 373dd347a52282615b5a56c3b6b92183c07ffa8f Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <iluceno AT suse.de>
+Date: Fri, 2 Oct 2026 00:28:10 +0200
+Subject: [PATCH 3/3] gui/term.cc: close the debugger pty after curses has
+ shut down
+
+bx_term_gui_c::exit() closed the pty master before tearing curses down, so
+every sequence endwin() still wanted to send - the screen clear, the cursor
+restore and exit_ca_mode - was written to a closed descriptor and lost. The
+terminal attached to the pty was left with the last frame of the guest on
+screen and the cursor still hidden. The FILE* from fdopen() was never
+closed either.
+
+Keep the FILE* around and hand it to fclose() after endwin(), which flushes
+what is left and closes the descriptor with it. If fdopen() failed the pty
+is still ours, so close it directly.
+
+Upstream-Status: Submitted [https://github.com/bochs-emu/Bochs/pull/903]
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ gui/term.cc | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/gui/term.cc b/gui/term.cc
+index 281b5e23a..c34b90dee 100644
+--- a/gui/term.cc
++++ b/gui/term.cc
+@@ -58,6 +58,7 @@
+ static bx_term_gui_c *theGui = NULL;
+ #if BX_DEBUGGER_TERM
+ static int scr_fd = -1;
++static FILE *scr_fp = NULL;
+ #endif
+ IMPLEMENT_GUI_PLUGIN_CODE(term)
+
+@@ -188,7 +189,6 @@
+ BX_PANIC(("cannot log to stderr in term mode"));
+ initscr();
+ #else
+- FILE *scr_fp = NULL;
+ scr_fd = open("/dev/ptmx",O_RDWR);
+ if(scr_fd > 0){
+ scr_fp = fdopen(scr_fd,"w+");
+@@ -688,13 +688,18 @@
+ void bx_term_gui_c::exit(void)
+ {
+ if (!initialized) return;
+-#if BX_DEBUGGER_TERM
+- if(scr_fd > 0)
+- close(scr_fd);
+-#endif
+ clear();
+ flush();
+ endwin();
++#if BX_DEBUGGER_TERM
++ if (scr_fp != NULL) {
++ fclose(scr_fp); // also closes scr_fd
++ scr_fp = NULL;
++ } else if (scr_fd > 0) {
++ close(scr_fd); // fdopen() failed, the pty is ours alone
++ }
++ scr_fd = -1;
++#endif
+ BX_DEBUG(("exiting"));
+ }
+
- [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (58fee3dab5fa121232b78b2a66f660bd11f44f22), Ismael Luceno, 10/01/2026
Archive powered by MHonArc 2.6.24.