From owner-freebsd-toolchain@freebsd.org Mon May 8 19:06:27 2017 Return-Path: Delivered-To: freebsd-toolchain@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 2E9DCD63A11; Mon, 8 May 2017 19:06:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5D017A2; Mon, 8 May 2017 19:06:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5BE7A10A7B9; Mon, 8 May 2017 15:06:18 -0400 (EDT) From: John Baldwin To: Mark Millard Cc: FreeBSD Toolchain , FreeBSD PowerPC ML , FreeBSD Ports , andreast@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" Date: Mon, 08 May 2017 11:30:53 -0700 Message-ID: <2567165.qjEVz8HF8R@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> References: <568491A5-0BDC-41CD-945C-E42B53EC2393@dsl-only.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 08 May 2017 15:06:18 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 19:06:27 -0000 On Saturday, May 06, 2017 10:03:57 PM Mark Millard wrote: > 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. Not really. kgdb on powerpc doesn't work period as neither the base nor ports kgdb can unwind a stack frame. I spent some time last year trying to get the unwind out of cpu_switch() to work to no avail. The current hack attempts are here: https://github.com/bsdjhb/gdb/compare/freebsd-7.11-kgdb...kgdb-ppc > THING #1: > > Another oddity is for the combination: > > ${MK_GDB} == no && ${MK_GDB_LIBEXEC} == yes As I think you figured out, MK_GDB_LIBEXEC depends on MK_GDB=yes. If WITHOUT_GDB=yes is set, then no "base" GDB is installed at all. WITH_GDB_LIBEXEC is just to decide in the MK_GDB=yes case where "base" GDB goes: /usr/bin vs /usr/libexec. > 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 This is a different problem with libkvm. I would start with 'ps -M' and use a debugger to step through the _powerpc_probe and _powerpc64_probe routines in libkvm to see why the appropriate probe routine isn't claiming the core. -- John Baldwin