From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 12 07:08:17 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85B8E385; Tue, 12 Nov 2013 07:08:17 +0000 (UTC) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 45B892488; Tue, 12 Nov 2013 07:08:17 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 616517A10F; Tue, 12 Nov 2013 08:08:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 2E2A78EE54F; Tue, 12 Nov 2013 08:08:48 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lcwndRzOlnym; Tue, 12 Nov 2013 08:08:47 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 4CCE78EB95B; Tue, 12 Nov 2013 08:08:47 +0100 (CET) Message-ID: <5281D42A.6050904@bitfrost.no> Date: Tue, 12 Nov 2013 08:09:30 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Boris Astardzhiev , freebsd-arm@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: ARM kgdb remote debugging over USB serial References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Nov 2013 07:08:17 -0000 On 11/09/13 19:05, Boris Astardzhiev wrote: > Hi, > > I have a question regarding the FreeBSD kernel debugging facilities. > Has anyone succeeded in using kgdb with a target ARM machine over a USB > serial. > I've managed to build kgdb-arm > > http://bsdimp.blogspot.com/2007/10/cross-debugger.html > (This tutorial also applies to building kgdb-arm in binutils) > > So on the arm machine I enter kdb: > db> gdb > db> s > .. > > On the debugging machine I easily get into kgdb: > kgdb-arm ${KERNEL_PATH}/kernel.debug > kgdb> set remotebaud 115200 > kgdb> target remote /dev/cuaU0 (the USB interface) > > So far so good but.. It seems to connect to the ARM device but it stops on > an address kgdb has no > reference about. I thought I was missing some symbols and.. > kgdb> set solib-search-path ${KERNEL_PATH} > > This seems to load lots of symbols but still I can't backtrace or do > anything. Attempting to do a 'bt' it tells me I got a SIGTRAP. I don't seem > to understand. > > Any ideas or materials? > > Greetings, > Boris Hi, Maybe there are some bits missing in the USB serial glue part? You can try making the USB serial port the console by setting the sysctls listed below correctly. Will also work in the panic prompt: hw.usb.ucom.cons_baud: 9600 hw.usb.ucom.cons_subunit: 0 hw.usb.ucom.cons_unit: -1 --HPS