From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116960 invoked by alias); 25 Apr 2019 15:02:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 116911 invoked by uid 89); 25 Apr 2019 15:02:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=executables X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 15:02:06 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJfsy-0003q0-JU; Thu, 25 Apr 2019 11:02:04 -0400 Received: from [176.228.60.248] (port=2452 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJfsx-0005T8-37; Thu, 25 Apr 2019 11:02:04 -0400 Date: Thu, 25 Apr 2019 15:02:00 -0000 Message-Id: <838svyyvql.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey CC: lrn1986@gmail.com, gdb-patches@sourceware.org In-reply-to: <87y33yci4w.fsf@tromey.com> (message from Tom Tromey on Thu, 25 Apr 2019 07:46:23 -0600) Subject: Re: Warning when using separate debug info file References: <83y348edoi.fsf@gnu.org> <20439f48-c0ff-e4b2-5cfc-6bb4b594d88c@gmail.com> <83h8aveape.fsf@gnu.org> <66d48dfd-23ac-7e05-3ad8-4e65b0c1c7f9@gmail.com> <834l6vdv4y.fsf@gnu.org> <87k1fjfbio.fsf@tromey.com> <83mukf19dl.fsf@gnu.org> <87y33yci4w.fsf@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00524.txt.bz2 > From: Tom Tromey > Cc: Tom Tromey , 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.