Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2015 21:40:32 +0100
From:      =?UTF-8?B?TWFudWVsIFN0w7xobg==?= <freebsdnewbie@freenet.de>
To:        freebsd-arm@freebsd.org
Subject:   remote kernel debugging
Message-ID:  <550DD740.2070608@freenet.de>

next in thread | raw e-mail | index | archive | help
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.

Any hints what I'm doing wrong?

Thanks.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?550DD740.2070608>