Re: kext debugging in Lion broken?
Re: kext debugging in Lion broken?
- Subject: Re: kext debugging in Lion broken?
- From: Jason Molenda <email@hidden>
- Date: Tue, 16 Aug 2011 18:18:41 -0700
David, as far as I know Ethernet kext debugging works correctly with Lion.
If you are running Xcode 4.1's gdb on your debugger machine, you don't need to generate a .sym file with kextload -s. Instead you can target remote-kdp in gdb (on your "remote computer") and do
(gdb) add-kext ~/XXXX.kext
and gdb will get the addresses of where your kext was loaded directly from the kernel of the Barolo system that's in kdp mode. (the kextload -s command that was used previously was the old way of telling gdb where everything got loaded)
Note that you must be building your kext with DWARF debug info (not stabs) - but I don't think you can build something with stabs in Xcode 4.1 any more. We changed our debug info format from stabs to DWARF 3-4 years ago.
There is an additional "maintenance" command in gdb which will list all kexts currently loaded in the system that's in kdp mode,
(gdb) maint list-kexts
Note that gdb will enforce a check of the binary's UUID (the Mach-O LC_UUID load command contents) -- you must be "add-kext"'ing the exact same binary that is running on the system that is in kdp mode or gdb will reject the add-kext command.
The intention is to make kext debugging a little bit easier than it used to be, we've gotten some positive feedback from kernel developers internally -- try this new arrangement, I think you'll like it.
J
On Aug 15, 2011, at 10:06 PM, David Tay wrote:
>
>
> Previously (Panther - Snow Leopard), I would do the following (ethernet based connection)
> 1. load the kext on the target machine kextload -l -s ~/ XXXX.kext
> 2. start gdb on the remote machine.
> 3. target remote kdp on the remote machine,
> 4. add-symbol-file YYYY copied from the target machine.
> 5. set break points in the code.
> 6. kextstat to make sure the kext was still loaded on the target machine.
> 7. Command -Power on target machine
> 8. connect <IP addr> from remote machine gdb session.
> 9. continue in gdb.
> 10. kextload -m on target machine.
>
> On Lion, none of the breakpoints (eg start, stop) are reached and the driver continues running. I'm using the Lion A511 kernel debug kit.
>
>
> What could be happening?
>
> Thanks,
>
> David _______________________________________________
> 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
_______________________________________________
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