From owner-freebsd-toolchain@freebsd.org Tue Oct 20 18:32:39 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 19629A1A2E9 for ; Tue, 20 Oct 2015 18:32:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C2B1B84; Tue, 20 Oct 2015 18:32:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E140CB976; Tue, 20 Oct 2015 14:32:37 -0400 (EDT) From: John Baldwin To: Andriy Gapon Cc: freebsd-toolchain@freebsd.org Subject: Re: clang confuses kgdb on static symbols Date: Tue, 20 Oct 2015 10:27:37 -0700 Message-ID: <2309223.qpHU2DNGVF@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <562627C8.5060108@FreeBSD.org> References: <562627C8.5060108@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Oct 2015 14:32:38 -0400 (EDT) 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 18:32:39 -0000 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