From owner-freebsd-ports@freebsd.org Sun May 7 19:21:45 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 3C3C1D6278B for ; Sun, 7 May 2017 19:21:45 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (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 C066C15F3 for ; Sun, 7 May 2017 19:21:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26514 invoked from network); 7 May 2017 19:21:37 -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 19:21:37 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Sun, 07 May 2017 15:21:37 -0400 (EDT) Received: (qmail 20447 invoked from network); 7 May 2017 19:21:37 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 7 May 2017 19:21:37 -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 3452AEC8809; Sun, 7 May 2017 12:21:36 -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: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> Date: Sun, 7 May 2017 12:21:35 -0700 Cc: FreeBSD Ports , andreast@FreeBSD.org, John Baldwin Content-Transfer-Encoding: quoted-printable Message-Id: <540903B2-A752-49D9-9833-42C7AC87089F@dsl-only.net> References: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> 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 19:21:45 -0000 [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 wrote: > On 2017-May-6, at 5:21 PM, Mark Millard = 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