Subject: bug#40279: 26.3; Error: you did not specify -i=mi on GDB's command line!

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 27 Oct 2020 20:14:07 +0100

William Xu <[email-masked]> writes:

> This is the change I have to make: 
> https://lists.gnu.org/archive/html/help-gnu-emacs/2020-10/msg00369.html

For reference, your proposed patch is just:

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index f0262c2315..7df23a6f41 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1658,14 +1658,7 @@ gdb-display-io-buffer
 (defun gdb-inferior-io--init-proc (proc)
   ;; Set up inferior I/O.  Needs GDB 6.4 onwards.
   (set-process-filter proc 'gdb-inferior-filter)
-  (set-process-sentinel proc 'gdb-inferior-io-sentinel)
-  ;; The process can run on a remote host.
-  (let ((tty (or (process-get proc 'remote-tty)
-		 (process-tty-name proc))))
-    (unless (or (null tty)
-		(string= tty ""))
-      (gdb-input
-       (concat "-inferior-tty-set " tty) 'ignore))))
+  (set-process-sentinel proc 'gdb-inferior-io-sentinel))
 
 (defun gdb-inferior-io-sentinel (proc _str)
   (when (eq (process-status proc) 'failed)

I tried looking at the VC logs to see what the point of the
inferior-tty-set command was, but the only mention I found was:

     (gdb-inferior-io--init-proc): Don't send "-inferior-tty" command
     if the TTY name is nil or empty (which happens when communicating
     with the inferior via pipes, e.g. on MS-Windows).

Which just disables it on Windows?

Hm...  it was introduced below, but doesn't really say why.

commit f30d612a7a628828baa7c333629a10295605291b
Author:     Chong Yidong <[email-masked]>
AuthorDate: Fri Apr 20 14:39:29 2012 +0800

And as far as I can tell, gdb runs just fine without it, even on
GNU/Linux?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no