From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Coeurjoly Newsgroups: gmane.emacs.bugs Subject: bug#40279: 26.3; Error: you did not specify -i=mi on GDB's command line! Date: Mon, 26 Oct 2020 21:31:25 +0100 Message-ID: References: <87ft61134a.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000026b47b05b298d12b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29479"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40279@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 26 21:32:29 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kX9AL-0007WM-0t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 21:32:29 +0100 Original-Received: from localhost ([::1]:33612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX9AJ-0008N5-TS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 16:32:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX99u-0008MJ-Op for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 16:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kX99u-0001Ke-Fa for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 16:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kX99u-0004qs-Bw for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 16:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Roland Coeurjoly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Oct 2020 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 40279-submit@debbugs.gnu.org id=B40279.160374430717896 (code B ref 40279); Mon, 26 Oct 2020 20:32:02 +0000 Original-Received: (at 40279) by debbugs.gnu.org; 26 Oct 2020 20:31:47 +0000 Original-Received: from localhost ([127.0.0.1]:41570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX99d-0004dc-GS for submit@debbugs.gnu.org; Mon, 26 Oct 2020 16:31:46 -0400 Original-Received: from mail-ot1-f52.google.com ([209.85.210.52]:37930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX99b-0004Xa-Bc for 40279@debbugs.gnu.org; Mon, 26 Oct 2020 16:31:44 -0400 Original-Received: by mail-ot1-f52.google.com with SMTP id b2so8654046ots.5 for <40279@debbugs.gnu.org>; Mon, 26 Oct 2020 13:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UDvCs54pTOUiIeGMHj/FAcqnO2jdywQhiG7my/OpASg=; b=DPD4bhLhkGejjV8po+V1dGIK3IkwEbHtvrLucF8yyCfPalIuJJXU+yM0+Je0Qy4gbB +amWwVh9N6AKZs9oqu3U3tGJtJZooj3Xf7x9D6ayvsYNEMQhWI7CA9KChriyF+lEiFQ8 mHhWoGyBz3ozWvsKlu+OmKh8StQ1XIRw2j3EBXSohcDAdnUXFcOZGYXERApbuqUHeSyp airxf1QrAv2aPq35wyMyUIO1xQU6OcDYGkzTsx2OwiWwFY+nx4LK1WeAe2tuWgmgKus4 4TEi94+RvyxE/YQX9fEJ+OYwyj5uhuMT3MtftdR7Lk9mQacoJvNVcXLFNf3umg8GR7Ni jjPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UDvCs54pTOUiIeGMHj/FAcqnO2jdywQhiG7my/OpASg=; b=Cyuv87dn8EQaPgCLDU5XEFms/M3H3Hfjm+14NmNYDLbuK0b1SKlCdhjVOkAYG6mvlT Ze7XY9XqI9qAPeNSqADUV9qwvrChTMoLm39LNNfsdpemhcCGy2gKbJrG0S5idv74l8rQ 8yRxhSQtd/x9CVeqnI8a3TWy7aURY9gB6GOIy4YIxvwouOv4yGCO+WbtegaWapgw1n+5 zwnacozy4Z2ENy3qQGoQ7kRkcZQKv8r9K7D5WnUwhZL5m2qiNS4fdKqhmpB9s/GCa7MW XnLMGKaQWokZlhLsTXDGxJrn3ZHtxNl2LzWzXi0Ew6lFz6EVI7B1YMwZVbZeew06dt5v vaeg== X-Gm-Message-State: AOAM531KthW20Hd31I+4abQQvWMd8WOiki9HPosPdiYmyGHOtr2KS24X 41Zc8amZ619xmbH6VMGIxpd8wPfquo8mapgqrN0pi8DuUb4= X-Google-Smtp-Source: ABdhPJy8gTBWSmNlys0op5ClpmFLXCSDhO0mSggwgd/WzIWR6KNcJAl71BOHKmCvZcBxJaDMUM3Pnfa5tD4G/CxivNw= X-Received: by 2002:a9d:8d2:: with SMTP id 76mr12379069otf.270.1603744297299; Mon, 26 Oct 2020 13:31:37 -0700 (PDT) In-Reply-To: <87ft61134a.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191650 Archived-At: --00000000000026b47b05b298d12b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, the problem is that it doesn't split the frame in different windows, and nothing good happens. I need to run gdb inside Docker, and I have a strong preference for the interface provided by emacs. When doing M-x gdb, I enter "docker-compose -f ~/docker-services/dev/docker-compose.yml exec dev_rhel7 bash -c "gdb -i=3Dmi"", and then it shows me the following message. Current directory is /home/drcoeurjoly/docker-services/dev/ Error: you did not specify -i=3Dmi on GDB's command line! WARNING: The MY_U= ID variable is not set. Defaulting to a blank string. 1-inferior-tty-set /dev/pts/3 2-gdb-set height 0 3-gdb-set non-stop 1 4-enable-pretty-printing 5-file-list-exec-source-files 6-file-list-exec-source-file 7-gdb-show prompt 8-stack-info-frame 9-thread-info 10-break-list 11-thread-info 12-break-list =3Dthread-group-added,id=3D"i1" ~"GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7\n" ~"Copyright (C) 2013 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n" ~"This GDB was configured as \"x86_64-redhat-linux-gnu\".\nFor bug reporting instructions, please see:\n" ~"http://www.gnu.org/software/gdb/bugs/.\n" =3Dcmd-param-changed,param=3D"history save",value=3D"on" =3Dcmd-param-changed,param=3D"history filename",value=3D"/home/drcoeurjoly/dotfiles/gdb/.gdb_history" =3Dcmd-param-changed,param=3D"print pretty",value=3D"on" =3Dcmd-param-changed,param=3D"print object",value=3D"on" =3Dcmd-param-changed,param=3D"print vtbl",value=3D"on" =3Dcmd-param-changed,param=3D"demangle-style",value=3D"gnu-v3" =3Dcmd-param-changed,param=3D"follow-fork-mode",value=3D"child" =3Dcmd-param-changed,param=3D"detach-on-fork",value=3D"off" (gdb) 1^done (gdb) 2^done (gdb) 3^done (gdb) 4^done (gdb) 5^done,files=3D[] (gdb) 6^error,msg=3D"No symbol table is loaded. Use the \"file\" command." (gdb) 7^done,value=3D"(gdb) " (gdb) 8^error,msg=3D"No registers." (gdb) 9^done,threads=3D[] (gdb) 10^done,BreakpointTable=3D{nr_rows=3D"0",nr_cols=3D"6",hdr=3D[{width=3D"7",= alignment=3D"-1",col_name=3D"number",colhdr=3D"Num"},{width=3D"14",alignmen= t=3D"-1",col_name=3D"type",colhdr=3D"Type"},{width=3D"4",alignment=3D"-1",c= ol_name=3D"disp",colhdr=3D"Disp"},{width=3D"3",alignment=3D"-1",col_name=3D= "enabled",colhdr=3D"Enb"},{width=3D"10",alignment=3D"-1",col_name=3D"addr",= colhdr=3D"Address"},{width=3D"40",alignment=3D"2",col_name=3D"what",colhdr= =3D"What"}],body=3D[]} (gdb) 11^done,threads=3D[] (gdb) 12^done,BreakpointTable=3D{nr_rows=3D"0",nr_cols=3D"6",hdr=3D[{width=3D"7",= alignment=3D"-1",col_name=3D"number",colhdr=3D"Num"},{width=3D"14",alignmen= t=3D"-1",col_name=3D"type",colhdr=3D"Type"},{width=3D"4",alignment=3D"-1",c= ol_name=3D"disp",colhdr=3D"Disp"},{width=3D"3",alignment=3D"-1",col_name=3D= "enabled",colhdr=3D"Enb"},{width=3D"10",alignment=3D"-1",col_name=3D"addr",= colhdr=3D"Address"},{width=3D"40",alignment=3D"2",col_name=3D"what",colhdr= =3D"What"}],body=3D[]} (gdb) Note that I successfully enter gdb in Docker, since GDB says: "GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7\n" In my host operating system (Debian): gdb --version outputs: GNU gdb (Debian 8.2.1-2+b3) 8.2.1 In Debian, I execute the Docker command: docker-compose -f ~/docker-services/dev/docker-compose.yml exec dev_rhel7 bash -c "gdb -i=3Dm= i" and I get the machine-oriented text interface. >From the previous test I deduce that it is an issue of emacs, not Docker. When entering the path of a binary instead of the option -i=3Dmi, it reads the symbols just fine: M-x gdb RETURN docker-compose -f ~/docker-services/dev/docker-compose.yml exec dev_rhel7 bash -c "gdb ~/babel_sandbox/build/foo" which outputs: Current directory is /home/drcoeurjoly/docker-services/dev/ Error: you did not specify -i=3Dmi on GDB's command line! WARNING: The MY_UID variable is not set. Defaulting to a blank string. 1-inferior-tty-set /dev/pts/3 2-gdb-set height 0 3-gdb-set non-stop 1 4-enable-pretty-printing 5-file-list-exec-source-files 6-file-list-exec-source-file 7-gdb-show prompt 8-stack-info-frame 9-thread-info 10-break-list 11-thread-info 12-break-list GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/drcoeurjoly/babel_sandbox/build/foo...done. (gdb) 1-inferior-tty-set /dev/pts/3 Undefined command: "1-inferior-tty-set". Try "help". (gdb) 2-gdb-set height 0 Undefined command: "2-gdb-set". Try "help". (gdb) 3-gdb-set non-stop 1 Undefined command: "3-gdb-set". Try "help". (gdb) 4-enable-pretty-printing Undefined command: "4-enable-pretty-printing". Try "help". (gdb) 5-file-list-exec-source-files Undefined command: "5-file-list-exec-source-files". Try "help". (gdb) 6-file-list-exec-source-file Undefined command: "6-file-list-exec-source-file". Try "help". (gdb) 7-gdb-show prompt Undefined command: "7-gdb-show". Try "help". (gdb) 8-stack-info-frame Undefined command: "8-stack-info-frame". Try "help". (gdb) 9-thread-info Undefined command: "9-thread-info". Try "help". (gdb) 10-break-list Undefined command: "10-break-list". Try "help". (gdb) 11-thread-info Undefined command: "11-thread-info". Try "help". (gdb) 12-break-list Undefined command: "12-break-list". Try "help". (gdb) I also tried putting the gdb -i=3Dmi inside a script and calling that from emacs, to no avail. Calling directly from bash worked and not from emacs. Relevant information: - My spacemacs config - foo program used for testing argument passing to gdb in emacs. I don't know if the dockerfile and docker-compose yml are relevant. If so, I will create a repo. Versions: Host: uname -a Linux des26 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux Emacs in host: emacs --version GNU Emacs 26.3 GDB in host: gdb --version GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Docker in host: docker --version Docker version 18.09.1, build 4c52b90 Docker-compose in host: docker-compose --version docker-compose version 1.21.0, build unknown Docker container: cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) GDB in docker container: gdb --version GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7 This issue was reported by Robert Mecklenburg here and here as early as august 2017. On Mon, Oct 26, 2020 at 3:19 PM Lars Ingebrigtsen wrote: > Roland Coeurjoly writes: > > > When I try to run: > > M-x gdb docker-compose -f ~/docker-services/dev/docker-compose.ym= l > > exec dev_rhel7 bash -c "gdb -i=3Dmi" > > I get the following error: > > Error: you did not specify -i=3Dmi on GDB's command line! > > I don't know docker, but this is a message Emacs gives when gdb doesn't > start up and output the data that knows that it has been started > correctly. > > So the message may be slightly misleading, but the problem seems to be > that gdb isn't started properly? Here's the code: > > (defun gdb--check-interpreter (filter proc string) > (unless (zerop (length string)) > (remove-function (process-filter proc) #'gdb--check-interpreter) > (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=3D)) > ;; Apparently we're not running with -i=3Dmi. > (let ((msg "Error: you did not specify -i=3Dmi on GDB's command > line!")) > > So is there a problem with your gdb invocation via docker? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --00000000000026b47b05b298d12b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, the problem is that it doesn't split the fra= me in different windows, and nothing good happens.

=20

I need to run gdb inside Docker, and I have a strong preference for the = interface provided by emacs.

When doing M-x gdb, I enter "docker-compose -f=20 ~/docker-services/dev/docker-compose.yml exec dev_rhel7 bash -c "gdb= =20 -i=3Dmi"", and then it shows me the following message.

Current directory is /home/drcoeurjoly/docker-services/dev/

=20

Error: you did not specify -i=3Dmi on GDB's command line! WARNING: The MY_UID variable is not set. Defaulting to a blank string. =20

1-inferior-tty-set /dev/pts/3

=20

2-gdb-set height 0

=20

3-gdb-set non-stop 1

=20

4-enable-pretty-printing

=20

5-file-list-exec-source-files

=20

6-file-list-exec-source-file

=20

7-gdb-show prompt

=20

8-stack-info-frame

=20

9-thread-info

=20

10-break-list

=20

11-thread-info

=20

12-break-list

=20

=3Dthread-group-added,id=3D"i1"

=20

~"GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7\n" =20

~"Copyright (C) 2013 Free Software Foundation, Inc.\n"

=20

~"License GPLv3+: GNU GPL version 3 or later http://gnu.org/license= s/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show=20 copying\"\nand \"show warranty\" for details.\n"

=20

~"This GDB was configured as \"x86_64-redhat-linux-gnu\"= ;.\nFor bug reporting instructions, please see:\n"

=20

~"http://www.gnu.org/software/gdb/bugs/.\n"

=20

=3Dcmd-param-changed,param=3D"history save",value=3D"on= "

=20

=3Dcmd-param-changed,param=3D"history filename",value=3D&quo= t;/home/drcoeurjoly/dotfiles/gdb/.gdb_history"

=20

=3Dcmd-param-changed,param=3D"print pretty",value=3D"on= "

=20

=3Dcmd-param-changed,param=3D"print object",value=3D"on= "

=20

=3Dcmd-param-changed,param=3D"print vtbl",value=3D"on&q= uot;

=20

=3Dcmd-param-changed,param=3D"demangle-style",value=3D"= gnu-v3"

=20

=3Dcmd-param-changed,param=3D"follow-fork-mode",value=3D&quo= t;child"

=20

=3Dcmd-param-changed,param=3D"detach-on-fork",value=3D"= off"

=20

(gdb)

=20

1^done

=20

(gdb)

=20

2^done

=20

(gdb)

=20

3^done

=20

(gdb)

=20

4^done

=20

(gdb)

=20

5^done,files=3D[]

=20

(gdb)

=20

6^error,msg=3D"No symbol table is loaded. Use the \"file\&q= uot; command."

=20

(gdb)

=20

7^done,value=3D"(gdb) "

=20

(gdb)

=20

8^error,msg=3D"No registers."

=20

(gdb)

=20

9^done,threads=3D[]

=20

(gdb)

=20

10^done,BreakpointTable=3D{nr_rows=3D"0",nr_cols=3D"6&q= uot;,hdr=3D[{width=3D"7",alignment=3D"-1",col_name=3D&q= uot;number",colhdr=3D"Num"},{width=3D"14",alignmen= t=3D"-1",col_name=3D"type",colhdr=3D"Type"},{= width=3D"4",alignment=3D"-1",col_name=3D"disp"= ;,colhdr=3D"Disp"},{width=3D"3",alignment=3D"-1&qu= ot;,col_name=3D"enabled",colhdr=3D"Enb"},{width=3D"= ;10",alignment=3D"-1",col_name=3D"addr",colhdr=3D&= quot;Address"},{width=3D"40",alignment=3D"2",col_n= ame=3D"what",colhdr=3D"What"}],body=3D[]}

=20

(gdb)

=20

11^done,threads=3D[]

=20

(gdb)

=20

12^done,BreakpointTable=3D{nr_rows=3D"0",nr_cols=3D"6&q= uot;,hdr=3D[{width=3D"7",alignment=3D"-1",col_name=3D&q= uot;number",colhdr=3D"Num"},{width=3D"14",alignmen= t=3D"-1",col_name=3D"type",colhdr=3D"Type"},{= width=3D"4",alignment=3D"-1",col_name=3D"disp"= ;,colhdr=3D"Disp"},{width=3D"3",alignment=3D"-1&qu= ot;,col_name=3D"enabled",colhdr=3D"Enb"},{width=3D"= ;10",alignment=3D"-1",col_name=3D"addr",colhdr=3D&= quot;Address"},{width=3D"40",alignment=3D"2",col_n= ame=3D"what",colhdr=3D"What"}],body=3D[]}

=20

(gdb)

Note that I successfully enter gdb in Docker, since GDB says:

"GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7\n"

In my host operating system (Debian): gdb --version outputs:

GNU gdb (Debian 8.2.1-2+b3) 8.2.1

In Debian, I execute the Docker command: docker-compose -f ~/docker-services/dev/docker-compose.yml exec dev_r= hel7 bash -c "gdb -i=3Dmi" and I get the machine-oriented text interface.

From the previous test I deduce that it is an issue of emacs, not Docker= .

When entering the path of a binary instead of the option -i=3Dmi, it rea= ds the symbols just fine: M-x gdb RETURN docker-compose -f ~/docker-services/dev/docker-compose= .yml exec dev_rhel7 bash -c "gdb ~/babel_sandbox/build/foo" which outputs:

Current directory is /home/drcoeurjoly/docker-services/dev/

=20

Error: you did not specify -i=3Dmi on GDB's command line!

=20

WARNING: The MY_UID variable is not set. Defaulting to a blank string.=

=20

1-inferior-tty-set /dev/pts/3

=20

2-gdb-set height 0

=20

3-gdb-set non-stop 1

=20

4-enable-pretty-printing

=20

5-file-list-exec-source-files

=20

6-file-list-exec-source-file

=20

7-gdb-show prompt

=20

8-stack-info-frame

=20

9-thread-info

=20

10-break-list

=20

11-thread-info

=20

12-break-list

=20

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7

=20

Copyright (C) 2013 Free Software Foundation, Inc.

=20

License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.h= tml

=20

This is free software: you are free to change and redistribute it.

=20

There is NO WARRANTY, to the extent permitted by law. Type "show= copying"

=20

and "show warranty" for details.

=20

This GDB was configured as "x86_64-redhat-linux-gnu".

=20

For bug reporting instructions, please see:

=20

http://www.gnu.org/software/gdb/bugs/...

=20

Reading symbols from /home/drcoeurjoly/babel_sandbox/build/foo...done.=

=20

(gdb) 1-inferior-tty-set /dev/pts/3

=20

Undefined command: "1-inferior-tty-set". Try "help&quo= t;.

=20

(gdb) 2-gdb-set height 0

=20

Undefined command: "2-gdb-set". Try "help".

=20

(gdb) 3-gdb-set non-stop 1

=20

Undefined command: "3-gdb-set". Try "help".

=20

(gdb) 4-enable-pretty-printing

=20

Undefined command: "4-enable-pretty-printing". Try "he= lp".

=20

(gdb) 5-file-list-exec-source-files

=20

Undefined command: "5-file-list-exec-source-files". Try &qu= ot;help".

=20

(gdb) 6-file-list-exec-source-file

=20

Undefined command: "6-file-list-exec-source-file". Try &quo= t;help".

=20

(gdb) 7-gdb-show prompt

=20

Undefined command: "7-gdb-show". Try "help".

=20

(gdb) 8-stack-info-frame

=20

Undefined command: "8-stack-info-frame". Try "help&quo= t;.

=20

(gdb) 9-thread-info

=20

Undefined command: "9-thread-info". Try "help". =20

(gdb) 10-break-list

=20

Undefined command: "10-break-list". Try "help". =20

(gdb) 11-thread-info

=20

Undefined command: "11-thread-info". Try "help".<= /p> =20

(gdb) 12-break-list

=20

Undefined command: "12-break-list". Try "help". =20

(gdb)

I also tried putting the gdb -i=3Dmi inside a script and ca= lling that from emacs, to no avail. Calling directly from bash worked and n= ot from emacs.

Relevant information:

I don't know if the dockerfile and docker-compose yml are relevant. = If so, I will create a repo.

Versions:

Host: uname -a

Linux des26 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11= ) x86_64 GNU/Linux

Emacs in host: emacs --version

GNU Emacs 26.3

GDB in host: gdb --version

GNU gdb (Debian 8.2.1-2+b3) 8.2.1

Docker in host: docker --version

Docker version 18.09.1, build 4c52b90

Docker-compose in host: docker-compose --version

docker-compose version 1.21.0, build unknown

Docker container: cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

GDB in docker container: gdb --version

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7

This issue was reported by Robert Mecklenburg here and here as ear= ly as august 2017.


On Mon, Oct 26, 2020 at 3:19 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Roland Coeurjoly <rolandcoeurjoly@gmail.c= om> writes:

> When I try to run:
> M-x gdb <RET> docker-compose -f ~/docker-services/dev/docker-com= pose.yml
> exec dev_rhel7 bash -c "gdb -i=3Dmi" <RET>
> I get the following error:
> Error: you did not specify -i=3Dmi on GDB's command line!

I don't know docker, but this is a message Emacs gives when gdb doesn&#= 39;t
start up and output the data that knows that it has been started
correctly.

So the message may be slightly misleading, but the problem seems to be
that gdb isn't started properly?=C2=A0 Here's the code:

(defun gdb--check-interpreter (filter proc string)
=C2=A0 (unless (zerop (length string))
=C2=A0 =C2=A0 (remove-function (process-filter proc) #'gdb--check-inter= preter)
=C2=A0 =C2=A0 (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=3D))=
=C2=A0 =C2=A0 =C2=A0 ;; Apparently we're not running with -i=3Dmi.
=C2=A0 =C2=A0 =C2=A0 (let ((msg "Error: you did not specify -i=3Dmi on= GDB's command line!"))

So is there a problem with your gdb invocation via docker?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--00000000000026b47b05b298d12b--