Debugging kext in lldb. Reading cpu_data_t offset 0x18 using %gs base address.
Debugging kext in lldb. Reading cpu_data_t offset 0x18 using %gs base address.
- Subject: Debugging kext in lldb. Reading cpu_data_t offset 0x18 using %gs base address.
- From: Zohar Cabeli <email@hidden>
- Date: Thu, 14 Jun 2018 11:14:22 +0300
Hi,
I was wondering if you could give me some direction in lldb issue I'm
currently struggling with ...
I've got a kext that produce panic for "preemption level -1" in macOS
Mojave (10.14), and I'd like to further investigate the issue.
It looks like preemption_level is read from the per-cpu data which that be
parsed using cpu_data_t struct (defined in xnu cpu_data.h).
However, it seems like the memory is inaccessible using memory read of
%gs+0x18:
register read gs
gs = 0x000000009da40000
memory read 0x000000009da40018
error: kdp read memory failed (error 4)
perhaps there is another way of reading the cpu data ?
I also tried another approach by looking how could the preemption level be
negative. I guess that when using spin lock, it blocks the preemption of
the cpu... however, I've tried to look for such locks in all threads (using
`showallstacks` lldb command) but couldn't find any.
Perhaps do you know better way to checking in lldb if spin lock is
currently active on any cpu ?
Thanks,
Zohar
_______________________________________________
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