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

Mark Millard markmi at dsl-only.net
Sun May 7 05:04:02 UTC 2017


On 2017-May-6, at 5:21 PM, Mark Millard <markmi at dsl-only.net> wrote:

> On:
> 
> # uname -apKU
> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT  r317820M  powerpc powerpc 1200030 1200030
> 
> When I attempt to use:
> 
> # which kgdb
> /usr/local/bin/kgdb
> 
> that was from building devel/gdb for:
> 
> # svnlite info /usr/ports | grep "Re[plv]"
> Relative URL: ^/head
> Repository Root: https://svn.freebsd.org/ports
> Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
> Revision: 440115
> Last Changed Rev: 440115
> 
> (built via gcc 4.2.1: not via clang: I
> experiment with clang for powerpc and
> powerpc64 so I'm being explicit)
> 
> I end up getting the following sort of result:
> 
> # kgdb /usr/lib/debug/boot/kernel/kernel.debug /var/crash/vmcore.4 
> . . .
> Reading symbols from /usr/lib/debug/boot/kernel/kernel.debug...done.
> ABI doesn't support a vmcore target
> 
> That message is from: /usr/ports/devel/gdb/files/kgdb/fbsd-kvm.c . . .
> 
> static void
> kgdb_trgt_open(const char *arg, int from_tty)
> {
>        struct fbsd_vmcore_ops *ops = (struct fbsd_vmcore_ops *)
>            gdbarch_data (target_gdbarch(), fbsd_vmcore_data);
> . . .
>        if (ops == NULL || ops->supply_pcb == NULL || ops->cpu_pcb_addr == NULL)
>                error ("ABI doesn't support a vmcore target");
> . . .
> 
> It appears that there is no kernel debugging
> supported for TARGET_ARCH=powerpc currently.
> (The system no longer has its own gdb related
> materials.)

I've discovered more context and have found
a few of issues in how things are currently
set up.

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.


THING #1:

Another oddity is for the combination:

${MK_GDB} == no && ${MK_GDB_LIBEXEC} == yes

where the tools/build/mk/OptionalObsoleteFiles.inc
logic then adds the libexec gdb and kgdb to
OLD_FILES :

.if ${MK_GDB} == no || ${MK_GDB_LIBEXEC} == no
OLD_FILES+=usr/libexec/gdb
OLD_FILES+=usr/libexec/kgdb
.endif

so doing a delete-old removes the only system
gdb and kgdb that are installed for such a
context. It does this because of:

${MK_GDB} == no

(And that explains why I thought gdb and kgdb
were not in the system.)


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



===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ports mailing list