Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 23:45:29 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-toolchain@FreeBSD.org, John Baldwin <jhb@FreeBSD.org>
Subject:   Re: clang confuses kgdb on static symbols
Message-ID:  <BE1B1A24-EEA9-4359-9C6D-DD43E01904B4@FreeBSD.org>
In-Reply-To: <562627C8.5060108@FreeBSD.org>
References:  <562627C8.5060108@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <avg@FreeBSD.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BE1B1A24-EEA9-4359-9C6D-DD43E01904B4>