From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 17:21:06 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A3121FA for ; Wed, 9 Apr 2014 17:21:06 +0000 (UTC) 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 733671526 for ; Wed, 9 Apr 2014 17:21:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 93CEBB95D; Wed, 9 Apr 2014 13:21:04 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Subject: Re: Time for turning off gdb by default? Or worse... Date: Wed, 9 Apr 2014 11:45:58 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201404091145.58792.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 09 Apr 2014 13:21:04 -0400 (EDT) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:21:06 -0000 On Tuesday, April 08, 2014 4:34:35 pm Warner Losh wrote: > Greetings, >=20 > The gdb in the tree seems to be of very limited usefulness these days. It > doesn=92t seem to work on clang-enabled architectures w/o building -gdwar= f-2, > it doesn=92t seem to work with threaded applications, and on some > architectures it doesn=92t seem to work at all (mips comes to mind, but i= t may > have been the two binaries I tried). >=20 > It seems like we=92d be doing our users a favor by applying: >=20 > diff -r 8bfca9de870e share/mk/bsd.own.mk > --- a/share/mk/bsd.own.mk > +++ b/share/mk/bsd.own.mk > @@ -266,7 +266,6 @@ WITH_HESIOD=3D > FREEBSD_UPDATE \ > GAMES \ > GCOV \ > - GDB \ > GNU \ > GNU_GREP_COMPAT \ > GPIB \ > @@ -355,6 +354,7 @@ WITH_HESIOD=3D > CLANG_EXTRAS \ > CTF \ > DEBUG_FILES \ > + GDB \ > HESIOD \ > INSTALL_AS_USER \ > LLDB \ >=20 > to the tree, which will turn gdb off by default. It may make more sense to > just remove it entirely, but I=92m not sure I want to go there just yet in > case there are things that I=92m missing. I believe that the port will be > adequate for all architectures we support, but haven=92t tested this dire= ctly > yet. I do know that on amd64, the port just worked, where the in-tree gdb > was an epic fail. kgdb is a must. I think it would be less work to forward port kgdb support into gdb7 from ports than to keep our ancient gdb alive. Some things I can think of for gdb7: 1) The threads patch could be greatly simplified if we fixed the ptrace backend to properly handle inferiors with tids. This would remove a lot of the threads patch where the thread inferior tries to invoke ptrace directly and convert registers, etc. The way it does this now is a total hack and requires much larger patches. This would also make it a lot easier to get thread debugging working on more architectures as the thread-db bits would become mostly MI (if not entirely) 2) Porting the kgdb frontend to work with gdb7. It would be nicer to have a more modern base for kgdb and the ability to use python scripting with kgdb, custom printers for in-kernel structures, etc. I think if we have a useful devel/kgdb that builds against devel/gdb we can probably think about retiring gdb, but it's premature right now. =2D-=20 John Baldwin