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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On 20 Oct 2015, at 13:38, Andriy Gapon <avg@FreeBSD.org> wrote: > > 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 = 0xf > > 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 [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlYmtf8ACgkQsF6jCi4glqPYWACdGPQpk/XEDFdofRSO1y1cdryP Qj8An0HuR4Khmy8kh36zrbEBuUA2Sa0F =pJ6J -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BE1B1A24-EEA9-4359-9C6D-DD43E01904B4>
