diff options
| author | Sean Callanan <scallanan@apple.com> | 2012-02-10 20:22:35 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2012-02-10 20:22:35 +0000 |
| commit | 49bce8ecdbf84c44b84b405bc54cd76df22702f8 (patch) | |
| tree | 0548ef5c651a5f3165d36714ef6e435ec8e9e7b5 /lldb/source/Plugins/DynamicLoader | |
| parent | 1ada7bc09d041fae4353fb6a34aa32a61dfd05d5 (diff) | |
| download | bcm5719-llvm-49bce8ecdbf84c44b84b405bc54cd76df22702f8.tar.gz bcm5719-llvm-49bce8ecdbf84c44b84b405bc54cd76df22702f8.zip | |
Improved detection of object file types, moving
detection of kernels into the object file and
adding a new category for raw binary images.
Fixed all clients who previously searched for
sections manually, making them use the object
file's facilities instead.
llvm-svn: 150272
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
3 files changed, 15 insertions, 18 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 8225d3decf0..b82d6869edf 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -58,15 +58,7 @@ DynamicLoaderDarwinKernel::CreateInstance (Process* process, bool force) ObjectFile *object_file = exe_module->GetObjectFile(); if (object_file) { - SectionList *section_list = object_file->GetSectionList(); - if (section_list) - { - static ConstString g_kld_section_name ("__KLD"); - if (section_list->FindSectionByName (g_kld_section_name)) - { - create = true; - } - } + create = (object_file->GetStrata() == ObjectFile::eStrataKernel); } } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index d6094b439ab..f929ce13466 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -98,15 +98,7 @@ DynamicLoaderMacOSXDYLD::CreateInstance (Process* process, bool force) ObjectFile *object_file = exe_module->GetObjectFile(); if (object_file) { - SectionList *section_list = object_file->GetSectionList(); - if (section_list) - { - static ConstString g_kld_section_name ("__KLD"); - if (section_list->FindSectionByName (g_kld_section_name)) - { - create = false; - } - } + create = (object_file->GetStrata() == ObjectFile::eStrataUser); } } diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp index 4d5ae558a5b..a1d64422e60 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -33,6 +33,19 @@ DynamicLoaderStatic::CreateInstance (Process* process, bool force) create = true; } + if (!create) + { + Module *exe_module = process->GetTarget().GetExecutableModulePointer(); + if (exe_module) + { + ObjectFile *object_file = exe_module->GetObjectFile(); + if (object_file) + { + create = (object_file->GetStrata() == ObjectFile::eStrataRawImage); + } + } + } + if (create) return new DynamicLoaderStatic (process); return NULL; |

