Date: Sat, 6 May 2017 22:03:57 -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: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> In-Reply-To: <CC5B5B39-A4FE-4C30-B936-E368863F512F@dsl-only.net> References: <CC5B5B39-A4FE-4C30-B936-E368863F512F@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2017-May-6, at 5:21 PM, Mark Millard <markmi@dsl-only.net> wrote: > 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.) 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=3D${binary} return fi done } 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. THING #1: Another oddity is for the combination: ${MK_GDB} =3D=3D no && ${MK_GDB_LIBEXEC} =3D=3D yes where the tools/build/mk/OptionalObsoleteFiles.inc logic then adds the libexec gdb and kgdb to OLD_FILES : .if ${MK_GDB} =3D=3D no || ${MK_GDB_LIBEXEC} =3D=3D no OLD_FILES+=3Dusr/libexec/gdb OLD_FILES+=3Dusr/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} =3D=3D 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 =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?568491A5-0BDC-41CD-945C-E42B53EC2393>