From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40271: 26.3; gdb-mode fails to initialize if the target executable is built without symbols Date: Sat, 28 Mar 2020 16:12:46 +0300 Message-ID: <83eetc7hdd.fsf@gnu.org> References: <87mu80k88j.fsf@delllaptop.lockywolf.net> <83mu807k7k.fsf@gnu.org> <83k1347jc3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="62668"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40271@debbugs.gnu.org To: Vladimir Nikishkin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 28 14:13:11 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 1jIBGx-000GBb-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Mar 2020 14:13:11 +0100 Original-Received: from localhost ([::1]:53048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIBGw-00044N-GT for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Mar 2020 09:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIBGp-000445-8r for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 09:13:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIBGo-0006hi-2T for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 09:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIBGn-0006hQ-Vg for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 09:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jIBGn-0004Y5-R1 for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 09:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Mar 2020 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40271 X-GNU-PR-Package: emacs Original-Received: via spool by 40271-submit@debbugs.gnu.org id=B40271.158540117017467 (code B ref 40271); Sat, 28 Mar 2020 13:13:01 +0000 Original-Received: (at 40271) by debbugs.gnu.org; 28 Mar 2020 13:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:33752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIBGb-0004Xf-LQ for submit@debbugs.gnu.org; Sat, 28 Mar 2020 09:12:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIBGa-0004XT-DT for 40271@debbugs.gnu.org; Sat, 28 Mar 2020 09:12:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIBGV-0006Er-7u; Sat, 28 Mar 2020 09:12:43 -0400 Original-Received: from [176.228.60.248] (port=3711 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jIBGU-0004xB-9R; Sat, 28 Mar 2020 09:12:42 -0400 In-Reply-To: (message from Vladimir Nikishkin on Sat, 28 Mar 2020 20:38:50 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:177809 Archived-At: [Please keep the bug address on the CC line, so that this discussion gets recorded by the Emacs issue tracker.] > From: Vladimir Nikishkin > Date: Sat, 28 Mar 2020 20:38:50 +0800 > > I am not super sure how to debug this. > > Firsly, regarding your question: > > lockywolf@delllaptop:~/DevLinux/chibi-sicp$ gdb -i=mi a.out > =thread-group-added,id="i1" > ~"GNU gdb (GDB) 9.1\n" > ~"Copyright (C) 2020 Free Software Foundation, Inc.\n" > ~"License GPLv3+: GNU GPL version 3 or later > \nThis is free software: you are > free to change and redistribute it.\nThere is NO WARRANTY, to the > extent permitted by law." > ~"\nType \"show copying\" and \"show warranty\" for details.\n" > ~"This GDB was configured as \"x86_64-slackware-linux\".\n" > ~"Type \"show configuration\" for configuration details.\n" > ~"For bug reporting instructions, please see:\n" > ~".\n" > ~"Find the GDB manual and other documentation resources online at:\n > ." > ~"\n\n" > ~"For help, type \"help\".\n" > ~"Type \"apropos word\" to search for commands related to \"word\"...\n" > =cmd-param-changed,param="logging file",value="/home/lockywolf/gdb-log.log" > =cmd-param-changed,param="print pretty",value="on" > =cmd-param-changed,param="print array-indexes",value="on" > =cmd-param-changed,param="print array",value="on" > =cmd-param-changed,param="print symbol-filename",value="on" > =cmd-param-changed,param="print object",value="on" > =cmd-param-changed,param="print vtbl",value="on" > =cmd-param-changed,param="history save",value="on" > ~"Reading symbols from a.out...\n" > (gdb) > > Secondly: > The place where gdb-mode fail, IMO, is line 4688 in the gdb-mi.el, > function gdb-get-source-file > I inserted (write-file "/home/lockywolf/debugging-buffer.txt") right > after (goto-char (min-point)), and the contents of the file are: > lockywolf@delllaptop:~$ cat debugging-buffer.1.txt > line="1",file="../sysdeps/x86_64/start.S",fullname="/root/glibc-2a0c65c5167af50893952729ba38cc68/glibc-2.30/csu/../sysdeps/x86_64/start.S",macro-info="0" > > /root/glibc-* is the place where Slackware developers compile glibc. > Doesn't seem like the correct file. The correct file is called > "second.f90", and is in the same directory. That seems to be the problem: in my case I get an error message: (gdb) -file-list-exec-source-file ^error,msg="No symbol table is loaded. Use the \"file\" command." which is quite expected. So I guess the problem is that your program is stripped, but the standard C library isn't. What do you suggest Emacs should do in this case? How can it know that the source file it's been fed isn't the right one? More generally, what is the use case where you want to debug a stripped program in gdb-mi? why did you strip the program in the first place?