Date: Mon, 27 Jul 2020 21:37:34 +0200 From: Paul Floyd <pjfloyd@wanadoo.fr> To: toolchain@freebsd.org Subject: Re: Getting started with clang debuginfo Message-ID: <620939C4-27B3-498C-AD9B-D1645F7C869B@wanadoo.fr> In-Reply-To: <20200727153913.GC2551@kib.kiev.ua> References: <1139268534.2282.1595842060133.JavaMail.www@wwinf1m22> <20200727143753.GA59953@raichu> <20200727153913.GC2551@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 27 Jul 2020, at 17:39, Konstantin Belousov <kostikbel@gmail.com> = wrote: >=20 > 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 >>> =20 >>> 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. >>> =20 >>> I'm not familiar (yet) with the debuginfo code in Valgrind. >>> =20 >>> 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/ The site seems to be down ATM. =46rom what I=E2=80=99ve read, DWARF is somewhat flexible and allows for = vendor extensions. For instance I=E2=80=99ve already seen = DW_AT_GNU_all_call_sites and DW_GNU_all_tail_call_sites. >=20 >>> - 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. >=20 > 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-<version> switch. >=20 > Different versions of the same compiler might default to different=20 > version of DWARF as well. >=20 No, I don=E2=80=99t think that is the problem. Valgrind can read DWARF = up to version 4 (not 5). If it encounters a version it does not know = about it says so directly =3D=3D1602=3D=3D Command: ./leak_dwarf5 =3D=3D1602=3D=3D=20 --1602-- WARNING: Serious error when reading debug info --1602-- When reading debug info from = /usr/home/paulf/scratch/vg_examples/leak_dwarf5: --1602-- Ignoring non-Dwarf2/3/4 block in .debug_info --1602-- WARNING: Serious error when reading debug info --1602-- When reading debug info from = /usr/home/paulf/scratch/vg_examples/leak_dwarf5: --1602-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4 =3D=3D1602=3D=3D=20 So I suspect that this is a question of dialect rather than version. A+ Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?620939C4-27B3-498C-AD9B-D1645F7C869B>