Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 14:30:01 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        Warner Losh <wlosh@bsdimp.com>
Cc:        freebsd-arch@freebsd.org, Sean Bruno <sbruno@freebsd.org>
Subject:   Re: Retiring in-tree GDB
Message-ID:  <2386413.0UUCRd2KC2@ralph.baldwin.cx>
In-Reply-To: <B11C1EC4-B7D4-43DA-A291-5DDF0D1AC2B8@bsdimp.com>
References:  <2678091.es0AGJQ0Ou@ralph.baldwin.cx> <3871457.xzmrTRH8AM@ralph.baldwin.cx> <B11C1EC4-B7D4-43DA-A291-5DDF0D1AC2B8@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, July 20, 2016 02:39:55 PM Warner Losh wrote:
>=20
> > On Jul 20, 2016, at 2:19 PM, John Baldwin <jhb@freebsd.org> wrote:
> >=20
> > On Wednesday, July 20, 2016 01:20:34 PM Sean Bruno wrote:
> >>=20
> >> On 07/20/16 13:00, John Baldwin wrote:
> >>> On Tuesday, October 20, 2015 01:36:28 PM John Baldwin wrote:
> >>>> When this topic was last raised (by Warner I believe), the prima=
ry objection
> >>>> (certainly my main one) was that the in-tree kgdb was the only k=
ernel debugger
> >>>> available.  kgdb is now available via the devel/gdb port in port=
s (and as of
> >>>> last week was enabled by default, so 'pkg install gdb' will get =
you a kgdb
> >>>> binary).  The kgdb in ports is in general superior to the one in=
 the base
> >>>> system.  It is a cross debugger by default (and with my pending =
patches to
> >>>> libkvm it even supports cross debugging of vmcores).
> >>>>=20
> >>>> There are some issues still with devel/gdb: namely it does not c=
urrently
> >>>> support some of the platforms supported by our in tree gdb such =
as arm and
> >>>> mips.  For these platforms I think the in-tree gdb will need to =
remain until
> >>>> there is a suitable alternative.
> >>>>=20
> >>>> However, I would like to propose that we retire the in-tree GDB =
for some of
> >>>> our platforms (namely x86) for 11.  In particular, I think we sh=
ould default
> >>>> to enabling lldb and disabling gdb for platforms that meet the f=
ollowing
> >>>> criteria:
> >>>>=20
> >>>> 1) devel/gdb works including thread and kgdb support
> >>>> 2) lldb works
> >>>>=20
> >>>> We could perhaps be more aggressive and handle lldb and gdb togg=
les
> >>>> independently, but I think we want to ship some sort of userland=
 debugger
> >>>> out of the box on all of our platforms.  The question I think mi=
ght be if
> >>>> we end up with platforms where 1) is true but 2) is not (such as=
 powerpc).
> >>>>=20
> >>>> I believe that these conditions are only true for x86 currently.=

> >>>>=20
> >>>> Comments?
> >>>=20
> >>> I believe I've fixed the one last thing that was depending on /us=
r/bin/gdb
> >>> (crashinfo) to use devel/gdb if it is present.  I'd either like t=
o disable
> >>> the base gdb on amd64 in the next week or so on HEAD, or perhaps =
if people are
> >>> really gutsy, disable it for all platforms on HEAD.  We still don=
't have kgdb
> >>> in ports for non-x86 (though for ppc at least kgdb in ports and b=
ase is
> >>> equally dysfunctional).
> >>>=20
> >>> However, to start with:
> >>>=20
> >>> 1) Does anyone have a reason to keep /usr/bin/gdb on amd64?
> >>>=20
> >>> 2) Does anyone have a reason to keep /usr/bin/gdb on !amd64?
> >>>=20
> >>=20
> >> I don't have an immediate use case in the mips/mips64 case.  Shoul=
d
> >> ports "just work" here or do I need some kind of "cross gdb"?
> >=20
> > ports gdb does not yet work on mips.  Once it supports mips it will=
 work as
> > both a native and cross debugger, but it just doesn't know about Fr=
eeBSD/mips
> > at all.  Does /usr/bin/gdb work on mips?
>=20
> It does, kinda. there=E2=80=99s a lot of stuff it gets right, so it c=
an be useful. However,
> there=E2=80=99s enough wrong that it=E2=80=99s super frustrating. So =
there=E2=80=99s a low bar to
> replacement. If I can build a new /bin/cat and debug it with a ports =
gdb,
> even if things are broken that kinda work now, I=E2=80=99m all for re=
placement.
>=20
> If /usr/bin/gdb were super duper cool on mips, I=E2=80=99d have a dif=
ferent take, but
> gdb on mips has never been stellar.

Well, devel/gdb won't work at all on mips, so if we removed /usr/bin/gd=
b on all
platforms you'd be left with no debugger at all.  Starting with amd64 i=
s probably
the most prudent for now.  i386 is probably also a good candidate even =
without
working lldb.

--=20
John Baldwin



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