There are a couple of different ways.
First, there is the kernel panicing, and it'll just hangout and wait for the remote debugger connection (or a reboot) so the operator can figure out what went wrong. You generally don't need to do anything except write buggy code for this to happen. =)
In your code, you can call PE_enter_debugger and this will cause the kernel to stop and wait for the remote debugger connection. Calling the function looks like this:
#include <pexpert/pexpert.h> ... PE_enter_debugger("Debug"); ...
You can also set the debug argument to the kernel. There are several settings of this variable that will allow you to enter the debugger. The first, is to set bit 0 of the debug arg (0x1). This will cause an early breakpoint in the kernel, and will stop execution and wait for the debugger. The second, is to set bit 2 of the debug flag (0x4). This will let you enter the debugger by pressing Cmd-Power.