Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

gdb remote setup for kext debugging

Dear Apple Team

I am following below guideline for debugging kext remotely over gdb

https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KEXT Concept/KEXTConceptDebugger/debug_tutori…

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)

Posted on Dec 17, 2016 5:17 AM

Reply
1 reply

gdb remote setup for kext debugging

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.