Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: lrn1986@gmail.com, gdb-patches@sourceware.org
Subject: Re: Warning when using separate debug info file
Date: Thu, 25 Apr 2019 15:02:00 -0000	[thread overview]
Message-ID: <838svyyvql.fsf@gnu.org> (raw)
In-Reply-To: <87y33yci4w.fsf@tromey.com> (message from Tom Tromey on Thu, 25	Apr 2019 07:46:23 -0600)

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  lrn1986@gmail.com,  gdb-patches@sourceware.org
> Date: Thu, 25 Apr 2019 07:46:23 -0600
> 
> I tried and it doesn't give a warning.

That's what I thought.  So somehow this is specific to PE executables.
I'm at a loss as to why that would be a factor.

> 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.

Both, it looks:

  objdump -h -j .gnu_debuglink hello.exe

  hello.exe:     file format pei-i386

  Sections:
  Idx Name          Size      VMA       LMA       File off  Algn
   14 .gnu_debuglink 00000014  00416000  00416000  0000c600  2**2
		    CONTENTS, ALLOC, LOAD, READONLY, DATA

But the question is why GDB looks for this section in the hello.debug
file, not in hello.exe.  That's what the warning emitted by GDB is
about:

  (gdb) file ./hello.exe
  Reading symbols from ./hello.exe...Reading symbols from D:\usr\eli\data\hello.debug...warning: section .gnu_debuglink not found in D:\usr\eli\data\hello.debug

What do you get with the above objdump command on the separate debug
file?  I get an error message:

  objdump -h -j .gnu_debuglink hello.debug

  hello.debug:     file format pei-i386

  Sections:
  Idx Name          Size      VMA       LMA       File off  Algn
  objdump: section '.gnu_debuglink' mentioned in a -j option, but not found in any input file

Thanks.


  reply	other threads:[~2019-04-25 15:02 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
2019-04-25 15:02               ` Eli Zaretskii [this message]
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=838svyyvql.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=lrn1986@gmail.com \
    --cc=tom@tromey.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