Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 May 2017 12:21:35 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>, andreast@FreeBSD.org, John Baldwin <jhb@freebsd.org>
Subject:   Re: Lack of TARGET_ARCH=powerpc support in kgdb from devel/gdb (e.g.,  -r440115 of /usr/ports): "ABI doesn't support a vmcore target"
Message-ID:  <540903B2-A752-49D9-9833-42C7AC87089F@dsl-only.net>
In-Reply-To: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net>
References:  <CC5B5B39-A4FE-4C30-B936-E368863F512F@dsl-only.net> <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[This update just notes that it appears that combination
${MK_GDB} =3D=3D no && ${MK_GDB_LIBEXEC} =3D=3D yes is not intended
to be used, effectively eliminating "THING #1" of 0-2.]

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

> On 2017-May-6, at 5:21 PM, Mark Millard <markmi at dsl-only.net> =
wrote:
>=20
>> On:
>>=20
>> # uname -apKU
>> FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT  r317820M  powerpc =
powerpc 1200030 1200030
>>=20
>> When I attempt to use:
>>=20
>> # which kgdb
>> /usr/local/bin/kgdb
>>=20
>> that was from building devel/gdb for:
>>=20
>> # 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
>>=20
>> (built via gcc 4.2.1: not via clang: I
>> experiment with clang for powerpc and
>> powerpc64 so I'm being explicit)
>>=20
>> I end up getting the following sort of result:
>>=20
>> # kgdb /usr/lib/debug/boot/kernel/kernel.debug /var/crash/vmcore.4=20
>> . . .
>> Reading symbols from /usr/lib/debug/boot/kernel/kernel.debug...done.
>> ABI doesn't support a vmcore target
>>=20
>> That message is from: /usr/ports/devel/gdb/files/kgdb/fbsd-kvm.c . . =
.
>>=20
>> static void
>> kgdb_trgt_open(const char *arg, int from_tty)
>> {
>>       struct fbsd_vmcore_ops *ops =3D (struct fbsd_vmcore_ops *)
>>           gdbarch_data (target_gdbarch(), fbsd_vmcore_data);
>> . . .
>>       if (ops =3D=3D NULL || ops->supply_pcb =3D=3D NULL || =
ops->cpu_pcb_addr =3D=3D NULL)
>>               error ("ABI doesn't support a vmcore target");
>> . . .
>>=20
>> It appears that there is no kernel debugging
>> supported for TARGET_ARCH=3Dpowerpc currently.
>> (The system no longer has its own gdb related
>> materials.)
>=20
> I've discovered more context and have found
> a few of issues in how things are currently
> set up.
>=20
> THING #0:
>=20
> 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:
>=20
> find_gdb()
> {
>        local binary
>=20
>        for binary in /usr/local/bin/gdb /usr/libexec/gdb /usr/bin/gdb; =
do
>                if [ -x ${binary} ]; then
>                        GDB=3D${binary}
>                        return
>                fi
>        done
> }
>=20
> But it appears that on powerpc /usr/local/bin/gdb and
> /usr/local/bin/kgdb do not support TARGET_ARCH=3Dpowerpc
> at all for such activity.
>=20
>=20
> THING #1:
>=20
> Another oddity is for the combination:
>=20
> ${MK_GDB} =3D=3D no && ${MK_GDB_LIBEXEC} =3D=3D yes
>=20
> where the tools/build/mk/OptionalObsoleteFiles.inc
> logic then adds the libexec gdb and kgdb to
> OLD_FILES :
>=20
> .if ${MK_GDB} =3D=3D no || ${MK_GDB_LIBEXEC} =3D=3D no
> OLD_FILES+=3Dusr/libexec/gdb
> OLD_FILES+=3Dusr/libexec/kgdb
> .endif
>=20
> so doing a delete-old removes the only system
> gdb and kgdb that are installed for such a
> context. It does this because of:
>=20
> ${MK_GDB} =3D=3D no
>=20
> (And that explains why I thought gdb and kgdb
> were not in the system.)

Looking around at how WITH_GDB and WITH_GDB_LIBEXEC
and the MK_ variants are used it appears that the:

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

combination is not intended to be used.

> THING #2:
>=20
> /usr/libexec/kgdb (when present) does not support the
> powerpc architecture for head either . . .
>=20
> On a head -r317820 powerpc I attempted:
>=20
> # /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



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?540903B2-A752-49D9-9833-42C7AC87089F>