Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Tom Tromey <tom@tromey.com>,
	 lrn1986@gmail.com,  gdb-patches@sourceware.org
Subject: Re: Warning when using separate debug info file
Date: Thu, 25 Apr 2019 13:46:00 -0000	[thread overview]
Message-ID: <87y33yci4w.fsf@tromey.com> (raw)
In-Reply-To: <83mukf19dl.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Apr	2019 22:38:46 +0300")

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> So you are saying that if you create a separate debug info file with
Eli> .gnu_debuglink on GNU/Linux, then GDB will display the same warning
Eli> when debugging the stripped binary?  I think someone said this didn't
Eli> happen on GNU/Linux.

I tried and it doesn't give a warning.

I did this with a simple test program:

    gcc -g -o q q.c -Wl,--build-id=none
    objcopy --only-keep-debug q q.debug
    strip -g q
    objcopy --add-gnu-debuglink=q.debug q

Then in gdb:

    (gdb) file ./q
    Reading symbols from ./q...Reading symbols from /tmp/q.debug...done.
    done.

>> So I suppose this is just a bug but the cause remains unknown.

Eli> The place where this happens, addr_info_make_relative, maps addresses
Eli> to BFD addresses, and I wonder why .gnu_debuglink appears in the array
Eli> of sections the GDB looks up in the separate debug file.  Any ideas
Eli> why this happens?

Try looking at the section headers:

    $ objdump -h -j .gnu_debuglink q

    q:     file format elf64-x86-64

    Sections:
    Idx Name          Size      VMA               LMA               File off  Algn
     25 .gnu_debuglink 0000000c  0000000000000000  0000000000000000  000013cc  2**2
                      CONTENTS, READONLY

I don't recall which but probably the section is either loadable or
allocatable in your situation.

Tom


  reply	other threads:[~2019-04-25 13:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83y348edoi.fsf@gnu.org>
2019-04-17 20:06 ` LRN
2019-04-18 12:53   ` Eli Zaretskii
2019-04-18 15:53     ` LRN
2019-04-18 18:30       ` Eli Zaretskii
2019-04-24 19:28         ` Tom Tromey
2019-04-24 19:39           ` Eli Zaretskii
2019-04-25 13:46             ` Tom Tromey [this message]
2019-04-25 15:02               ` Eli Zaretskii
2019-04-25 15:49                 ` Tom Tromey
2019-04-25 16:19                   ` Eli Zaretskii
2019-04-25 17:31                     ` Tom Tromey
2019-04-27 15:19                       ` Eli Zaretskii
2019-04-27 15:37                         ` Eli Zaretskii
2019-05-02 15:50                         ` Eli Zaretskii
2019-05-02 18:20                           ` Tom Tromey
2019-05-03  7:05                             ` Eli Zaretskii
2019-04-24 19:49           ` André Pönitz

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=87y33yci4w.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=lrn1986@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox