all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vladimir Nikishkin <lockywolf@gmail.com>
Cc: 40271@debbugs.gnu.org
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	[thread overview]
Message-ID: <83eetc7hdd.fsf@gnu.org> (raw)
In-Reply-To: <CA+A2iZYfyhxWyJmNdGVm-4rxhVGXZD3zCU3kvCzU7uynxXxKQQ@mail.gmail.com> (message from Vladimir Nikishkin on Sat, 28 Mar 2020 20:38:50 +0800)

[Please keep the bug address on the CC line, so that this discussion
gets recorded by the Emacs issue tracker.]

> From: Vladimir Nikishkin <lockywolf@gmail.com>
> 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
> <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."
> ~"\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"
> ~"<http://www.gnu.org/software/gdb/bugs/>.\n"
> ~"Find the GDB manual and other documentation resources online at:\n
>  <http://www.gnu.org/software/gdb/documentation/>."
> ~"\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?





  parent reply	other threads:[~2020-03-28 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 11:51 bug#40271: 26.3; gdb-mode fails to initialize if the target executable is built without symbols Vladimir Nikishkin
2020-03-28 12:11 ` Eli Zaretskii
2020-03-28 12:30   ` Eli Zaretskii
     [not found]     ` <CA+A2iZYfyhxWyJmNdGVm-4rxhVGXZD3zCU3kvCzU7uynxXxKQQ@mail.gmail.com>
2020-03-28 12:39       ` bug#40271: Fwd: " Vladimir Nikishkin
2020-03-28 13:12       ` Eli Zaretskii [this message]
2020-03-28 13:26         ` Vladimir Nikishkin
2020-03-28 13:27           ` Vladimir Nikishkin
2020-03-28 13:53           ` Eli Zaretskii
2022-01-31 18:43             ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=83eetc7hdd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=40271@debbugs.gnu.org \
    --cc=lockywolf@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.