GNU bug report logs - #69327
29.2.50; Emacs crashes when running gdb with comint-prompt-read-only

Previous Next

Package: emacs;

Reported by: Knut Anders Hatlen <knut.hatlen <at> oracle.com>

Date: Fri, 23 Feb 2024 13:41:01 UTC

Severity: normal

Found in version 29.2.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Knut Anders Hatlen <kahatlen <at> gmail.com>
Cc: 69327 <at> debbugs.gnu.org
Subject: bug#69327: 29.2.50; Emacs crashes when running gdb with comint-prompt-read-only
Date: Sat, 24 Feb 2024 10:40:35 +0200
> From: Knut Anders Hatlen <kahatlen <at> gmail.com>
> Cc: 69327 <at> debbugs.gnu.org
> Date: Fri, 23 Feb 2024 21:16:50 +0100
> 
> It apparently tries to report "error in process filter: Text is
> read-only" in all of the read_process_output_error_handler() frames that
> I looked at. error_val contains the same in all of them:
> 
> (gdb) pp error_val
> (text-read-only)

OK, so please try this change, it seems to fix the problem for me:

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index d119eeb..312b71b 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1849,7 +1849,8 @@ gdb-io-eof
 
 (defun gdb-clear-inferior-io ()
   (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
-    (erase-buffer)))
+    (let ((inhibit-read-only t))
+      (erase-buffer))))
 
 
 (defconst breakpoint-xpm-data
@@ -2819,7 +2820,8 @@ gdb-append-to-partial-output
 
 (defun gdb-clear-partial-output ()
   (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-    (erase-buffer)))
+    (let ((inhibit-read-only t))
+      (erase-buffer))))
 
 ;; Parse GDB/MI result records: this process converts
 ;;  list      [...]      ->  list




This bug report was last modified 1 year and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.