ARM kgdb remote debugging over USB serial

Hans Petter Selasky hps at bitfrost.no
Tue Nov 12 07:08:17 UTC 2013


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


More information about the freebsd-hackers mailing list