Lack of TARGET_ARCH=powerpc support in kgdb from devel/gdb (e.g., -r440115 of /usr/ports): "ABI doesn't support a vmcore target"

John Baldwin jhb at freebsd.org
Mon May 8 19:06:27 UTC 2017


On Saturday, May 06, 2017 10:03:57 PM Mark Millard wrote:
> THING #0:
> 
> It appears that usr.sbin/crashinfo/crashinfo.sh assumes
> that /usr/local/bin/gdb will work better for all architectures,
> including for kgdb types of activity:
> 
> find_gdb()
> {
>         local binary
> 
>         for binary in /usr/local/bin/gdb /usr/libexec/gdb /usr/bin/gdb; do
>                 if [ -x ${binary} ]; then
>                         GDB=${binary}
>                         return
>                 fi
>         done
> }
> 
> But it appears that on powerpc /usr/local/bin/gdb and
> /usr/local/bin/kgdb do not support TARGET_ARCH=powerpc
> at all for such activity.

Not really.  kgdb on powerpc doesn't work period as neither the base nor ports
kgdb can unwind a stack frame.  I spent some time last year trying to get the
unwind out of cpu_switch() to work to no avail.  The current hack attempts are
here:

https://github.com/bsdjhb/gdb/compare/freebsd-7.11-kgdb...kgdb-ppc

> THING #1:
> 
> Another oddity is for the combination:
> 
> ${MK_GDB} == no && ${MK_GDB_LIBEXEC} == yes

As I think you figured out, MK_GDB_LIBEXEC depends on MK_GDB=yes.
If WITHOUT_GDB=yes is set, then no "base" GDB is installed at all.
WITH_GDB_LIBEXEC is just to decide in the MK_GDB=yes case where
"base" GDB goes: /usr/bin vs /usr/libexec.

> THING #2:
> 
> /usr/libexec/kgdb (when present) does not support the
> powerpc architecture for head either . . .
> 
> On a head -r317820 powerpc I attempted:
> 
> # /usr/libexec/kgdb /usr/lib/debug/boot/kernel/kernel.debug /var/crash/vmcore.7
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "powerpc-marcel-freebsd"...
> Failed to open vmcore: unsupported architecture

This is a different problem with libkvm.  I would start with 'ps -M' and use
a debugger to step through the _powerpc_probe and _powerpc64_probe routines in
libkvm to see why the appropriate probe routine isn't claiming the core.

-- 
John Baldwin


More information about the freebsd-ports mailing list