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

Previous Next

Package: emacs;

Reported by: Roland Coeurjoly <rolandcoeurjoly <at> gmail.com>

Date: Sun, 29 Mar 2020 17:12:02 UTC

Severity: normal

Tags: moreinfo

Merged with 28309

Found in version 26.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #56 received at submit <at> debbugs.gnu.org (full text, mbox):

From: William Xu <william.xwl <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#40279: 26.3;
 Error: you did not specify -i=mi on GDB's command line!
Date: Tue, 03 Nov 2020 19:52:41 +0100
Roland Coeurjoly <rolandcoeurjoly <at> gmail.com> writes:

> When doing M-x gdb, I enter "docker-compose -f ~/docker-services/dev/docker-compose.yml exec dev_rhel7 bash -c "gdb -i=mi"", and then
> it shows me the following message.
>
>  Current directory is /home/drcoeurjoly/docker-services/dev/
>
>  Error: you did not specify -i=mi on GDB's command line! WARNING: The MY_UID variable is not set. Defaulting to a blank string.

Is "WARNING: The MY_UID variable is not set. Defaulting to a blank
string." coming from your docker or bash? 

The check of gdb--check-interpreter looks pretty weak, as long as there
is anything that will be written to stdout before the gdb cmd itself, it
will fail with below check:

#+begin_src emacs-lisp
    (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=))
#+end_src

which will further set below filter. The filter below seems preventing
the gdb-mi to work: 

#+begin_src emacs-lisp
      (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)
#+end_src

One can easily reproduce similar error, by wrapping around gdb with
"echo hi" at the front: 

#+begin_src shell-script
#!/bin/sh

arg="$@"
echo hi
gdb -i=mi ${arg}
#+end_src

IMO, in the above cases, we should not immediately fall back to gud-gdb
filter. The user should at least get a chance (like yes-or-no-p) to
continue with gdb-mi, regardless of the sometimes-false-positive error.

-- 
William





This bug report was last modified 4 years and 202 days ago.

Previous Next


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