From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33071 invoked by alias); 18 Apr 2019 09:17:13 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 33062 invoked by uid 89); 18 Apr 2019 09:17:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=facilities, HContent-Transfer-Encoding:8bit X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Apr 2019 09:17:12 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36AAB3086224; Thu, 18 Apr 2019 09:17:11 +0000 (UTC) Received: from [10.36.117.224] (ovpn-117-224.ams2.redhat.com [10.36.117.224]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8733E1001E8D; Thu, 18 Apr 2019 09:17:10 +0000 (UTC) To: Artem Razin References: From: Nick Clifton Openpgp: preference=signencrypt Cc: gdb@sourceware.org Subject: Re: Reading DWARF debug information from a PE executable Message-ID: Date: Thu, 18 Apr 2019 09:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00015.txt.bz2 Hi Artem, > This is my first question here and I hope it is suitable for this list. Actually you might find it more helpful ask this question on the elfutils mailing list (elfutils-devel@sourceware.org) since libdwarf is part of that project. Or you could try the binutils mailing list (binutils@sourceware.org) as the facilities that you are asking for are available in the BFD library, which is part of the binutils project. > I've tried to adopt libdwarf but it seems to be able to read files in > ELF format only. At the same time mingw places debug information to > several PE sections. One possible solution - albeit rather of a hack - is to extract the debug sections from the PE file and then insert them into an ELF file and the use libdwarf to examine them. > Or probably there are other ways to work with DWARF in case of PE executables... Check out the BFD library from the binutils project. It has the ability to read PE format files, and to traverse the debug information in them. For example the objdump utility from the binutils project supports a -w command line option to display debug information which works even on PE format files. Cheers Nick