From owner-freebsd-arm@FreeBSD.ORG Sun Mar 22 01:11:28 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B974B5 for ; Sun, 22 Mar 2015 01:11:28 +0000 (UTC) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "raven.bwct.de", Issuer "BWCT" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FAB73DC for ; Sun, 22 Mar 2015 01:11:27 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id t2M1AvJX038896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 22 Mar 2015 02:10:57 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.5/8.14.4) with ESMTP id t2M1AtL3032104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 22 Mar 2015 02:10:55 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id t2M1AsZ2088973; Sun, 22 Mar 2015 02:10:54 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id t2M1AsT7088972; Sun, 22 Mar 2015 02:10:54 +0100 (CET) (envelope-from ticso) Date: Sun, 22 Mar 2015 02:10:54 +0100 From: Bernd Walter To: Manuel =?iso-8859-1?Q?St=FChn?= Subject: Re: remote kernel debugging Message-ID: <20150322011054.GA81780@cicely7.cicely.de> Reply-To: ticso@cicely.de References: <550DD740.2070608@freenet.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <550DD740.2070608@freenet.de> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, DNS_FROM_AHBL_RHSBL=2.699, T_RP_MATCHES_RCVD=-0.01 autolearn=no version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 01:11:28 -0000 On Sat, Mar 21, 2015 at 09:40:32PM +0100, Manuel Stühn wrote: > Hi, > is it possible to debug the freebsd-kernel remotely on BBB? I'm > following the developers-handbook, but I do not get it working: > > root@beaglebone:~ # sysctl debug.kdb.enter=1 > debug.kdb.enter: 0KDB: enter: sysctl debug.kdb.enter > [ thread pid 655 tid 100087 ] > Stopped at $d.11: ldrb r15, [r15, r15, ror r15]! > db> gdb > The remote GDB backend could not be selected. > > root@beaglebone:~ # dmesg > GDB: no debug ports present > KDB: debugger backends: ddb > KDB: current backend: ddb > Copyright (c) 1992-2015 The FreeBSD Project. > [...] > > > On the remote host: > > /usr/obj/usr/src/sys/BBB # kgdb -v -r /dev/cuaU0 -b 115200 kernel.debug > kgdb: device file: /dev/cuaU0 > kgdb: kernel image: kernel.debug > 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 "armv6hf-marcel-freebsd"...Switching to > remote protocol > Couldn't establish connection to remote target > Malformed response to offset query, qOffsets > > > Kernel-Configuration BBB: > > # Debugging for use in -current > makeoptions DEBUG=-g > options BREAK_TO_DEBUGGER > #options VERBOSE_SYSINIT > options KDB > # For minimum debugger support (stable branch) use: > #options KDB_TRACE > # For full debugger support use this instead: > options DDB > #options INVARIANTS > #options INVARIANT_SUPPORT > #options WITNESS > #options WITNESS_SKIPSPIN > #options DIAGNOSTIC > options GDB > > I'm finding in the web that it is necessary to set someting like > > hint.uart.0.flags"0x90" > > but i do not find any flag like this in sysctl on BBB. The flags are documented in the uart manpage. 0x10 flag sets the console uart and 0x80 the gdb uart. 0x90 sets both. But it assumes /boot/device.hints to be used, which to my knowledge isn't true on the BBB. The console is setup via stdin/stdout in sys/boot/fdt/dts/arm/beaglebone.dts No idea how gdb or any of the other flags can be entered in the DTS files. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.