Skip to content

Have kernel binary scanner load dSYMs as binary+dSYM if best thing found #1896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jasonmolenda
Copy link

Have kernel binary scanner load dSYMs as binary+dSYM if best thing found

lldb's PlatforDarwinKernel scans the local filesystem (well known
locations, plus user-specified directories) for kernels and kexts
when doing kernel debugging, and loads them automatically. Sometimes
kernel developers want to debug with only a dSYM, in which case they
give lldb the DWARF binary + the dSYM as a binary and symbol file.
This patch adds code to lldb to do this automatically if that's the
best thing lldb can find.

A few other bits of cleanup in PlatformDarwinKernel that I undertook
at the same time:

  1. Remove the 'platform.plugin.darwin-kernel.search-locally-for-kexts'
    setting. When I added the local filesystem index at start of kernel
    debugging, I thought people might object to the cost of the search
    and want a way to disable it. No one has.

  2. Change the behavior of
    'plugin.dynamic-loader.darwin-kernel.load-kexts' setting so it does
    not disable the local filesystem scan, or use of the local filesystem
    binaries.

  3. PlatformDarwinKernel::GetSharedModule into GetSharedModuleKext and
    GetSharedModuleKernel for easier readability & maintenance.

  4. Added accounting of .dSYM.yaa files (an archive format akin to tar)
    that I come across during the scan. I'm not using these for now; it
    would be very expensive to expand the archives & see if the UUID matches
    what I'm searching for.

rdar://problem/69774993
Differential Revision: https://reviews.llvm.org/D88632

(cherry picked from commit a1e9792)

lldb's PlatforDarwinKernel scans the local filesystem (well known
locations, plus user-specified directories) for kernels and kexts
when doing kernel debugging, and loads them automatically.  Sometimes
kernel developers want to debug with *only* a dSYM, in which case they
give lldb the DWARF binary + the dSYM as a binary and symbol file.
This patch adds code to lldb to do this automatically if that's the
best thing lldb can find.

A few other bits of cleanup in PlatformDarwinKernel that I undertook
at the same time:

1. Remove the 'platform.plugin.darwin-kernel.search-locally-for-kexts'
setting.  When I added the local filesystem index at start of kernel
debugging, I thought people might object to the cost of the search
and want a way to disable it.  No one has.

2. Change the behavior of
'plugin.dynamic-loader.darwin-kernel.load-kexts' setting so it does
not disable the local filesystem scan, or use of the local filesystem
binaries.

3. PlatformDarwinKernel::GetSharedModule into GetSharedModuleKext and
GetSharedModuleKernel for easier readability & maintenance.

4. Added accounting of .dSYM.yaa files (an archive format akin to tar)
that I come across during the scan.  I'm not using these for now; it
would be very expensive to expand the archives & see if the UUID matches
what I'm searching for.

<rdar://problem/69774993>
Differential Revision: https://reviews.llvm.org/D88632

(cherry picked from commit a1e9792)
@jasonmolenda
Copy link
Author

@swift-ci please test

@jasonmolenda jasonmolenda merged commit a511a88 into swiftlang:apple/stable/20200714 Oct 2, 2020
@jasonmolenda jasonmolenda deleted the kernel-debug-auto-load-kernel-binary-from-dsym branch October 2, 2020 08:13
compnerd pushed a commit to dabrahams/llvm-project that referenced this pull request Oct 2, 2020
…ft/tensorflow-stage

* 'swift/master' of github.com:apple/llvm-project:
  Have kernel binary scanner load dSYMs as binary+dSYM if best thing found (swiftlang#1896)
  Update lldb for ModuleInterfaceChecker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant