svn commit: r354239 - head/contrib/gdb/gdb

luporl luporl at freebsd.org
Fri Nov 1 19:26:41 UTC 2019


Well, after evaluating remote kernel debugging through serial port, on
amd64, I've run into several issues while using latest ports gdb/kgdb.
I don't remember all of them, but were things like step/next not always
working, connection being lost, and similar things.
OTOH, /usr/libexec/kgdb worked fine and reliably, although older and more
limited.
This is probably due to some incompatibility in GDB Remote Serial Protocol,
between the kernel backend and newer GDB from ports.

So, that's why I chose to use /usr/libexec/kgdb while fixing/enabling
remote debugging on PPC64, because it works reasonably well, and I could
focus on testing/fixing other parts first.
With only this change on gdb, it is now possible to use it to test some
basic functionality, like remote debugger attach, backtrace and data
inspection.

My goal is not to fix every issue in /usr/libexec/kgdb, but just to get the
basics working, to then move on and switch to ports' GDB.

- Leandro

On Fri, Nov 1, 2019 at 1:06 PM John Baldwin <jhb at freebsd.org> wrote:

> On 11/1/19 4:28 AM, Leandro Lupori wrote:
> > Author: luporl
> > Date: Fri Nov  1 11:28:43 2019
> > New Revision: 354239
> > URL: https://svnweb.freebsd.org/changeset/base/354239
> >
> > Log:
> >   [PPC64] Fix GDB sigtramp detection
> >
> >   Current implementation of ppcfbsd_pc_in_sigtramp() seems to take only
> 32-bit
> >   PowerPC in account, as on 64-bit PowerPC most kernel instruction
> addresses will
> >   be wrongly reported as in sigtramp.
> >
> >   This change adds proper sigtramp detection for PPC64.
>
> It's probably not worth fixing this in /usr/bin/gdb?  At this point gdb is
> only
> installed for the kgdb in /usr/libexec on all platforms but sparc64 to
> serve as
> a fall-back for the crashinfo script in case the ports gdb isn't
> installed.  The
> ports gdb should handle signal trampolines fine on ppc.  It uses
> instruction
> matching patterns to detect trampolines on all supported platforms instead
> of
> static sigtramp locations.
>
> --
> John Baldwin
>


More information about the svn-src-all mailing list