# Placing Breakpoints in FreeBSD Kernel



## Shehbaz (Oct 25, 2013)

Hello,

My first post in FreeBSD forum. I wanted to understand the FreeBSD code by following the execution sequence starting from booting the kernel.

To be more specific:

 I am running FreeBSD code on VM Player. 
 I have compiled my custom kernel after enabling the options ::

```
options KDB, KDB_UNATTENDED, KDB_TRACE 
options ALT_BREAK_TO_DEBUGGER
```

Now, I want to stop the kernel code and go step by step through the FreeBSD kernel. So, using GDB comes to mind. How can I place breakpoints in FreeBSD kernel through VM Player, or is this even possible using VM Player to understand FreeBSD kernel and the sequence of steps that take place during FreeBSD kernel boot?

Please let me know if I am going in the right direction to understand FreeBSD kernel, or there is some better approach for the same.

Thanks,
Shehbaz


----------



## SirDice (Oct 25, 2013)

Developers' Handbook: Chapter 10. Kernel Debugging


----------

