# Is there any friendly debug method other than DDB



## redriver (Nov 16, 2015)

I installed FreeBSD 10.2 on Windows 10's Hyper-V, and found there are many disk devices under /dev folder, for example, /dev/da0 ~ /dev/da15. But in fact only /dev/da0 can be used.

I'm trying to debug the storvsc during kernel boot by following "10.4. On-Line Kernel Debugging Using DDB" of developer handbook. But the DDB cannot show source code and it cannot print variable value. It is unfriendly for me to debug assembly code.

Is it possible to debug the source code with similar user experience as GDB?


----------



## tetragir (Nov 16, 2015)

Hi,
although I've never used debug solutions, I know dtrace(1), which supposed to be a debugging tool. I hope it helps.


----------



## redriver (Nov 17, 2015)

dtrace(1) can provide dynamic tracing information. It looks to be a profiler. I found some people also have the similar requirement as me. See https://forums.freebsd.org/threads/remote-kernel-debugging.29668.


----------



## Oko (Nov 17, 2015)

ktrace(1), kdump(1), devel/valgrind


----------



## redriver (Nov 17, 2015)

ktrace(1) and kdump(1) are used to trace a separate process, they are suitable to debug kernel during boot. I'm investigating remote debug through /dev/cuau0 (the serial port), which is said to support GDB. In addition, I also read Kernel Debug through "Dcons over FireWire®". I don't know what FireWire is. It looks like something similar to serial port.


----------



## SirDice (Nov 17, 2015)

Not sure how up to date it is but you might want to read the Developer's Handbook (yes, there's another handbook): Chapter 10. Kernel Debugging

As for FireWire, you never heard of that? Really? It's been around for quite some time. It was never as popular as USB but it has some nice features. I think it even predates USB. A lot of digital video cameras have FireWire. Most Macs do too.

https://en.wikipedia.org/wiki/IEEE_1394


----------

