From owner-freebsd-toolchain@freebsd.org Mon Jul 27 15:39:27 2020 Return-Path: Delivered-To: freebsd-toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D5EF366A28 for ; Mon, 27 Jul 2020 15:39:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFkWM0dHDz3g4S for ; Mon, 27 Jul 2020 15:39:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 13A0E366C93; Mon, 27 Jul 2020 15:39:27 +0000 (UTC) Delivered-To: toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 136393664C8 for ; Mon, 27 Jul 2020 15:39:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFkWL3Hc9z3fwq; Mon, 27 Jul 2020 15:39:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 06RFdDbp062309 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 Jul 2020 18:39:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 06RFdDbp062309 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 06RFdDtY062308; Mon, 27 Jul 2020 18:39:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 Jul 2020 18:39:13 +0300 From: Konstantin Belousov To: Mark Johnston Cc: Paul FLOYD , toolchain@freebsd.org Subject: Re: Getting started with clang debuginfo Message-ID: <20200727153913.GC2551@kib.kiev.ua> References: <1139268534.2282.1595842060133.JavaMail.www@wwinf1m22> <20200727143753.GA59953@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200727143753.GA59953@raichu> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4BFkWL3Hc9z3fwq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 15:39:27 -0000 On Mon, Jul 27, 2020 at 10:37:53AM -0400, Mark Johnston wrote: > On Mon, Jul 27, 2020 at 11:27:40AM +0200, Paul FLOYD wrote: > > Hi > >   > > I'm investigating some of the remaining issues with Valgrind on FreeBSD. One of the two remaining major issues that I'm aware of is with Valgrind reading dwarf  debuginfo from clang compiled binaries. The problem isn't too bad with clang 8 on FreeBSD 12.1. On 13-CURRENT with clang 10 things are noticeably worse. For GCC built binaries I'm not aware of any issues. > >   > > I'm not familiar (yet) with the debuginfo code in Valgrind. > >   > > To get me going, does anyone have any pointers to > > - documentation on clang debuginfo Clang generates DWARF which is documented by the DWARF standard(s), available at http://dwarfstd.org/ > > - any info on differences wrt GCC (I have seen that GCC does have some debuginfo extensions) Gcc also generates DWARF. It is up to the compiler to interpret the standard and provide compliant metadata according to it. But I would expect that the practical difference or troubles in parsing the compiler' output is due to different versions of the used standard. Both gcc and clang allow to specify which level of standard should be used, see the description of the -gdwarf- switch. Different versions of the same compiler might default to different version of DWARF as well. > > - any tools that would be useful like ascii dumps > > Are you asking about tools to dump DWARF info? I've used dwarfdump > (from ports) quite a bit in the past. readelf -w is similar and > available in the base system.