Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 10:27:37 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: clang confuses kgdb on static symbols
Message-ID:  <2309223.qpHU2DNGVF@ralph.baldwin.cx>
In-Reply-To: <562627C8.5060108@FreeBSD.org>
References:  <562627C8.5060108@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, October 20, 2015 02:38:48 PM Andriy Gapon 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.

What if you disable the hack in sys/conf/kern.mk to use dwarf-2?

If '-gdwarf-4' works then you can just set that in the DEBUG makeoptions as a
test, otherwise try hacking kern.mk to disable this bit:

#
# Add -gdwarf-2 when compiling -g. The default starting in clang v3.4
# and gcc 4.8 is to generate DWARF version 4. However, our tools don't
# cope well with DWARF 4, so force it to genereate DWARF2, which they
# understand. Do this unconditionally as it is harmless when not needed,
# but critical for these newer versions.
#
.if ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == ""
CFLAGS+=        -gdwarf-2
.endif


-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2309223.qpHU2DNGVF>