aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-02-25 14:47:27 +0100
committerPavel Labath <pavel@labath.sk>2022-04-13 14:41:13 +0200
commitaf921006d3792fa28d1070f015dcfd145e082ed2 (patch)
treecef66cd21a920de4d0e7596f9a53da2756740f91 /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
parentba4537b22796a561dbcd7cd4e666bb5039510b21 (diff)
downloadllvm-af921006d3792fa28d1070f015dcfd145e082ed2.zip
llvm-af921006d3792fa28d1070f015dcfd145e082ed2.tar.gz
llvm-af921006d3792fa28d1070f015dcfd145e082ed2.tar.bz2
[lldb] Remove the global platform list
This patch moves the platform creation and selection logic into the per-debugger platform lists. I've tried to keep functional changes to a minimum -- the main (only) observable difference in this change is that APIs, which select a platform by name (e.g., Debugger::SetCurrentPlatform) will not automatically pick up a platform associated with another debugger (or no debugger at all). I've also added several tests for this functionality -- one of the pleasant consequences of the debugger isolation is that it is now possible to test the platform selection and creation logic. This is a product of the discussion at <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>. Differential Revision: https://reviews.llvm.org/D120810
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 036450b..1b699f2 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -511,8 +511,9 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process,
m_kext_summary_header(), m_known_kexts(), m_mutex(),
m_break_id(LLDB_INVALID_BREAK_ID) {
Status error;
- PlatformSP platform_sp(Platform::Create(
- ConstString(PlatformDarwinKernel::GetPluginNameStatic()), error));
+ PlatformSP platform_sp =
+ process->GetTarget().GetDebugger().GetPlatformList().Create(
+ PlatformDarwinKernel::GetPluginNameStatic());
if (platform_sp.get())
process->GetTarget().SetPlatform(platform_sp);
}