remote kernel debugging

Manuel Stühn freebsdnewbie at freenet.de
Sat Mar 21 20:43:04 UTC 2015


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 at 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 at 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.


More information about the freebsd-arm mailing list