[Lldb-commits] [PATCH] D88632: A handful of fixes to lldb's "scan the local filesystem for kexts & kernels" feature

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 30 20:46:41 PDT 2020

jasonmolenda created this revision.
jasonmolenda added a project: LLDB.
Herald added subscribers: lldb-commits, JDevlieghere.
jasonmolenda requested review of this revision.

This started out with one small idea I had and then got a bit of PatchCreep while I was digging into  a subsystem I haven't touched in a year or two.  The patch is all isolated to darwin kernel debugging, it doesn't modify anything outside of that.  The things I changed here:

1. When looking on the local filesystem for a kernel binary + dSYM pair, if that fails, look through any dSYMs that we saw alone without a binary, and load those as a binary+dSYM pair all by itself.  It's not ideal, but it will mostly work.

2. Remove the 'platform.plugin.darwin-kernel.search-locally-for-kexts' setting.  I originally added this setting when I first added the local filesystem scan for kexts/kernels, fearing that people would ask for a way to disable it.  No one has ever asked.  I thought of making the setting a no-op and documenting it as obsoleted, but eventually it'll have to be removed and someone will get an error in their .lldbinit file if they're still using it.  Might as well make that now.

3. Change plugin.dynamic-loader.darwin-kernel.load-kexts so that it doesn't disable local kernel binary scanning.  It was a nonobvious interaction, I see kernel developers trip over this occasionally.

4. Split up PlatformDarwinKernel::GetSharedModule into GetSharedModuleKext and GetSharedModuleKernel.  This method was unnecessarily large and the blocks of code had no interaction with each other; splitting it out makes it easier to read and modify.

5. I keep track of possible kernel .dSYM.yaa (a file archive format) files that I come across during the scan, but I'm only reporting it in the statistics for now, I don't think I want to pay the cost of expanding these to see if they're a match.

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88632.295459.patch
Type: text/x-patch
Size: 26457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201001/f6c1a244/attachment-0001.bin>

More information about the lldb-commits mailing list