diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-04-05 01:03:25 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-04-05 01:03:25 +0000 |
commit | 1c627543f18df53ccab437a372c362aadadc2779 (patch) | |
tree | e41149c0d23d8ff603d8f476637a7e7e9c7ede83 /lldb/source/Target/Platform.cpp | |
parent | ece622ab4682fc484bbc652d15a96ab50fd348aa (diff) | |
download | bcm5719-llvm-1c627543f18df53ccab437a372c362aadadc2779.tar.gz bcm5719-llvm-1c627543f18df53ccab437a372c362aadadc2779.zip |
Add a new PlatformDarwinKernel for kernel debugging. This Platform
plugin will index the kext bundles on the local filesystem when
created. During a kernel debug session, when the DynamicLoader
plugin needs to locate a kext by name like
"com.apple.com.apple.filesystems.autofs", the Platform can quickly
look for a UUID match in those kernel debug kit directories it
previously indexed.
I'm still working on profiling the performance impact of the inital
kext bundle scan; there will likely need to be a switch to enable
or disable this plugin's scan.
This only affects Mac kernel debugging and the code is only built
on Apple systems because of some use of low-level CoreFoundation
to parse plists.
<rdar://problem/13503583>
llvm-svn: 178827
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r-- | lldb/source/Target/Platform.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index dddccad07bf..bc365603774 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -95,6 +95,37 @@ Platform::LocateExecutableScriptingResources (Target *target, Module &module) return FileSpecList(); } +Platform* +Platform::FindPlugin (Process *process, const char *plugin_name) +{ + PlatformCreateInstance create_callback = NULL; + if (plugin_name) + { + create_callback = PluginManager::GetPlatformCreateCallbackForPluginName (plugin_name); + if (create_callback) + { + ArchSpec arch; + if (process) + { + arch = process->GetTarget().GetArchitecture(); + } + std::auto_ptr<Platform> instance_ap(create_callback(process, &arch)); + if (instance_ap.get()) + return instance_ap.release(); + } + } + else + { + for (uint32_t idx = 0; (create_callback = PluginManager::GetPlatformCreateCallbackAtIndex(idx)) != NULL; ++idx) + { + std::auto_ptr<Platform> instance_ap(create_callback(process, false)); + if (instance_ap.get()) + return instance_ap.release(); + } + } + return NULL; +} + Error Platform::GetSharedModule (const ModuleSpec &module_spec, ModuleSP &module_sp, |