This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Warning when using separate debug info file
> 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.