Re: Debuggin XNU build
Re: Debuggin XNU build
- Subject: Re: Debuggin XNU build
- From: Prokash Sinha <email@hidden>
- Date: Tue, 21 Apr 2015 09:22:07 -0700
First, I’m using lldb, since gdb is not being supported anymore. In the debugger, hitting Cntl+C would not work. AFAIRC, gdb does not work that way either when do the kernel debugging ( I could be wrong), but in freebsd it does not work. So in kgdb, the kludge is to make a kernel variable like Kernel.Debug field to have a trap when we toggle or try to write from the target. And that trap is captured in the debugger.
There got to be a way to Break in to the running kernel directly ( either with key combination on the host debugger) or toggling some variable — I just don’t know.
Prokash
On Apr 21, 2015, at 5:43 AM, Regis Duchesne <email@hidden> wrote:
>> one more question (though different ) is that - Is there any kernel variable that we can toggle on the target using sysctl to trigger a break into the debugger. Or if there is any key-combination that would do that. This is when kernel debugger connection is fine, and I let the target to boot completely, then I want to break in. Assume I don’t have any component running where I can set BP before letting the target go on running.
>
> I can think of two ways to do this:
>
> 1) Use nvram to add flag 0x1 to debug= in boot-args.
>
> DB_HALT
> 0x01
> Halt at boot-time and wait for debugger attach (gdb).
>
> Then after the OS X guest boots, it will wait for your debugger to connect. Then just run "c" (continue) and your guest will run normally until it either hits a breakpoint, or you hit Ctrl-C at the gdb prompt.
>
> 2) Write a trivial kernel module which simply calls Debugger(<some string>); in its start method. Then load that module in the guest every time you need to drop to the debugger.
>
> Cheers,
> --
> hpreg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden