gdb remote setup for kext debugging
Dear Apple Team
I am following below guideline for debugging kext remotely over gdb
i found below line to set up gdb in it , but its giving some error , which i mentioned in Red.
(Development Machine) Start GDB
Start GDB with the following command, indicating the target machine’s architecture and the location of your debug kernel
gdb -arch i386 /Volumes/KernelDebugKit/mach_kernel
gdb: unrecognized option `-arch' . // and there is no mach_kernel inside Volumes/... after mounting kernel debug kit
(gdb) source /Volumes/KernelDebugKit/kgmacros
/Volumes/KernelDebugKit/kgmacros: No such file or directory.
(gdb) target remote-kdp
Undefined target command: "remote-kdp"
(gdb) kdp-reattach
Undefined command: "kdp-reattach". Try "help"
but same thing seems to be working with lldb
echo "settings set target.load-script-from-symbol-file true" >> ~/.lldbinit
$ lldb /Library/Developer/KDKs/KDK_10.12.2_16C67.kdk/System/Library/Kernels/kernel
(lldb) kdp-remote
System Details :- 10.12.2 (16C67)
xcode Version 8.1 (8B62)
please help me to set up gdb .
MacBook Pro, macOS Sierra (10.12.2)