unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: William Xu <william.xwl@gmail.com>
To: 40279@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <m2ft5qclxi.fsf@gmail.com> (raw)
In-Reply-To: <CAMdauZrfOZk+dOTfu2-cqYs0g1Rbn5=BL6stLfeBuFniBa_vKQ@mail.gmail.com>

Roland Coeurjoly <rolandcoeurjoly@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






      parent reply	other threads:[~2020-11-03 18:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29  7:21 bug#40279: 26.3; Error: you did not specify -i=mi on GDB's command line! Roland Coeurjoly
2020-10-26 14:19 ` Lars Ingebrigtsen
2020-10-26 20:31   ` Roland Coeurjoly
2020-10-26 21:01     ` Lars Ingebrigtsen
2020-10-26 21:07       ` Roland Coeurjoly
2020-10-27  7:46         ` Lars Ingebrigtsen
2020-10-27 18:36     ` William Xu
2020-10-27 19:14       ` Lars Ingebrigtsen
2020-10-27 20:04         ` William Xu
2020-10-27 20:11           ` Lars Ingebrigtsen
2020-10-28 19:48             ` William Xu
2020-10-30 12:19               ` Lars Ingebrigtsen
2020-10-30 16:29                 ` William Xu
2020-10-27 20:20           ` Eli Zaretskii
2020-10-27 20:09         ` Eli Zaretskii
2020-11-03 18:52     ` William Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ft5qclxi.fsf@gmail.com \
    --to=william.xwl@gmail.com \
    --cc=40279@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).