forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 343
Kernel fileset live debugging support #5272
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
Merged
jasonmolenda
merged 8 commits into
swiftlang:stable/20220421
from
jasonmolenda:kernel-fileset-live-debugging-support
Sep 10, 2022
Merged
Kernel fileset live debugging support #5272
jasonmolenda
merged 8 commits into
swiftlang:stable/20220421
from
jasonmolenda:kernel-fileset-live-debugging-support
Sep 10, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fixes llvm#50114 where lldb/mac can't load object files from thin archives. This patch allows lldb to identify thin archives, and load object files contained in them. Differential Revision: https://reviews.llvm.org/D126464 (cherry picked from commit dc46ae6)
(cherry picked from commit f012087)
This patch teaches LLDB about Mach-O filesets. Filsets are Mach-O files that contain a bunch of other Mach-O files. Unlike universal binaries, which have a different header, Filesets use load commands to describe the different entries it contains. Differential revision: https://reviews.llvm.org/D132433 (cherry picked from commit 48506fb)
Computer the slide when and apply it to each entry's vm addr when reading from memory. Differential revision: https://reviews.llvm.org/D132710 (cherry picked from commit e360281)
Fix two small issues in the live-memory variant of ObjectContainerMachOFileset. Differential revision: https://reviews.llvm.org/D132973 (cherry picked from commit 0044cb4)
Complete support of the binary-addresses key in the qProcessInfo packet in ProcessGDBRemote, for detecting if one of the binaries needs to be handled by a Platform plugin, and can be used to set the Process' DynamicLoader plugin and the Target's Platform plugin. Implement this method in PlatformDarwinKernel to recognize a kernel fileset at that address, find the actual kernel address in the fileset, set DynamicLoaderDarwinKernel and PlatformDarwinKernel in the Process/Target; register the kernel address with the dynamic loader so it will be loaded later during attach. This patch only addresses the live debug scenario with a gdb remote serial protocol connection. I'll handle corefiles in a subsequent patch that builds on this. Differential Revision: https://reviews.llvm.org/D133534 rdar://98754861 (cherry picked from commit 1a608cf)
DynamicLoaderDarwinKernel calls in to PlatformDarwinKernel, and with my changes in https://reviews.llvm.org/D133534, PlatformDarwinKernel calls in to DynamicLoaderDarwinKernel. This results in a cmake dependency if accurately included in the link libraries list. lldbPluginDynamicLoaderDarwinKernel is specfically for kernel debugging and is uncommonly linked in to anything except a full lldb. lldbPluginPlatformMacOSX is any Darwin platform, including PlatformDarwinKernel, and is referenced a number of time in shell tests, for instance. I believe anything linking the darwin kernel DynamicLoader plugin will already have lldbPluginPlatformMacOSX in its dependency list, so not explicitly expressing this dependency is safe. (cherry picked from commit 30578c0)
Teach LLVM about filesets. Filesets were added in macOS 11 (Big Sur) to combine multiple Mach-O files. They introduce a new load command (LC_FILESET_ENTRY) consisting of a fileset_entry_command. struct fileset_entry_command { uint32_t cmd; /* LC_FILESET_ENTRY */ uint32_t cmdsize; /* includes entry_id string */ uint64_t vmaddr; /* memory address of the entry */ uint64_t fileoff; /* file offset of the entry */ union lc_str entry_id; /* contained entry id */ uint32_t reserved; /* reserved */ }; This patch teaches LLVM about the new load command and the corresponding data. Differential revision: https://reviews.llvm.org/D132432 (cherry picked from commit e854c17)
@swift-ci please test |
1 similar comment
@swift-ci please test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.