Re: remote debugging with gdb on 10.6.2
Re: remote debugging with gdb on 10.6.2
- Subject: Re: remote debugging with gdb on 10.6.2
- From: mogambo <email@hidden>
- Date: Wed, 25 Nov 2009 12:24:52 -0800
Hi Brian,
This was very helpful. I can now single-step and see locals in my remote debugging session. This is what I do:
1. Build the kernel extension on the debugger machine.
2. Build the kernel extension on the taget machine.
3. Load the kext on the target.
4. start gdb session on the debugger: gdb -arch x86_64 /Volumes/KernelDebugKit/mach_kernel.
5. source /Volumes/KernelDebugKit/kgmacros.
6. target remote-kdp
7. attach <target_ip> and trigger NMI on the debugee.
8. Once the gdb connects, showallkmods and get the load address of the kext.
9. On the debugger, go to the kext build directory and run the following command. Provide the load address from step 8 when asked for it.
kextutil -z -n -s . -- fsd.kext
10. Back to the gdb session: add-kext <path_to_kext_build_directory> Gdb finds the symbols file created in step 9 and loads it.
11. Set my breakpoints and hit continue.
Now, I hit the problem that's talked about already on the forum, where the target machine locks when single stepping.
Thanks again for your help.
_______________________________________________
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