From owner-freebsd-ports@freebsd.org Sun May 7 05:04:02 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60213D626B8 for ; Sun, 7 May 2017 05:04:02 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-78.reflexion.net [208.70.210.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB40E1469 for ; Sun, 7 May 2017 05:04:00 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 24623 invoked from network); 7 May 2017 05:03:59 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 7 May 2017 05:03:59 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sun, 07 May 2017 01:03:59 -0400 (EDT) Received: (qmail 6106 invoked from network); 7 May 2017 05:03:59 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 7 May 2017 05:03:59 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6FC5FEC8F8E; Sat, 6 May 2017 22:03:58 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) 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" From: Mark Millard In-Reply-To: Date: Sat, 6 May 2017 22:03:57 -0700 Cc: FreeBSD Ports , andreast@FreeBSD.org, John Baldwin Content-Transfer-Encoding: quoted-printable Message-Id: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> References: To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2017 05:04:02 -0000 On 2017-May-6, at 5:21 PM, Mark Millard 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