From owner-freebsd-toolchain@freebsd.org Tue Oct 20 21:45:40 2015 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 726ADA1AB8E for ; Tue, 20 Oct 2015 21:45:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 303F11E71; Tue, 20 Oct 2015 21:45:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::addd:9ba1:b883:b22b] (unknown [IPv6:2001:7b8:3a7:0:addd:9ba1:b883:b22b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4742E1ECF5; Tue, 20 Oct 2015 23:45:36 +0200 (CEST) Subject: Re: clang confuses kgdb on static symbols Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1FEB7582-FEF7-42C2-8AA1-1A9489079978"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: <562627C8.5060108@FreeBSD.org> Date: Tue, 20 Oct 2015 23:45:29 +0200 Cc: freebsd-toolchain@FreeBSD.org, John Baldwin Message-Id: References: <562627C8.5060108@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3094) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 21:45:40 -0000 --Apple-Mail=_1FEB7582-FEF7-42C2-8AA1-1A9489079978 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Oct 2015, at 13:38, Andriy Gapon wrote: >=20 > I see exactly the same behavior both kgdb and kgdb710 (devel/gdb with = KGDB option): > (kgdb) p/x intr_cpus > No symbol "intr_cpus" in current context. > (kgdb) p/x 'intr_cpus.0' > $1 =3D 0xf >=20 > Not sure if clang should try to not produce that '.0' suffix = (especially given > that there are no other intr_cpus symbols) or if kgdb should somehow = figure out > the suffix. As far as I know, static symbols are candidates for shuffling around, completely optimizing away, et cetera, as long as the program still works according to the abstract model. (This is of course without taking e.g. __used attributes into account.) It appears that intr_cpus is a struct, and I have seen before that individual members of such static structs are sometimes assigned individual symbols, suffixed with .0, .1 and so on. This is likely what is happening in this case. -Dimitry --Apple-Mail=_1FEB7582-FEF7-42C2-8AA1-1A9489079978 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlYmtf8ACgkQsF6jCi4glqPYWACdGPQpk/XEDFdofRSO1y1cdryP Qj8An0HuR4Khmy8kh36zrbEBuUA2Sa0F =pJ6J -----END PGP SIGNATURE----- --Apple-Mail=_1FEB7582-FEF7-42C2-8AA1-1A9489079978--