diff options
author | Greg Clayton <gclayton@apple.com> | 2012-02-13 23:10:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-02-13 23:10:39 +0000 |
commit | c859e2d52488ef1852e6489716ddf6147402ea64 (patch) | |
tree | 5639f72ea58d93f18e65eb6fb71f76062fbba9e6 /lldb/source/Target/Process.cpp | |
parent | 698452bc7e838e3a355029539d7f0be974d4d81d (diff) | |
download | bcm5719-llvm-c859e2d52488ef1852e6489716ddf6147402ea64.tar.gz bcm5719-llvm-c859e2d52488ef1852e6489716ddf6147402ea64.zip |
Full core file support has been added for mach-o core files.
Tracking modules down when you have a UUID and a path has been improved.
DynamicLoaderDarwinKernel no longer parses mach-o load commands and it
now uses the memory based modules now that we can load modules from memory.
Added a target setting named "target.exec-search-paths" which can be used
to supply a list of directories to use when trying to look for executables.
This allows one or more directories to be used when searching for modules
that may not exist in the SDK/PDK. The target automatically adds the directory
for the main executable to this list so this should help us in tracking down
shared libraries and other binaries.
llvm-svn: 150426
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 6ed2b2ac040..10922feb7db 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2193,14 +2193,23 @@ Process::DeallocateMemory (addr_t ptr) } ModuleSP -Process::ReadModuleFromMemory (const FileSpec& file_spec, lldb::addr_t header_addr) +Process::ReadModuleFromMemory (const FileSpec& file_spec, + lldb::addr_t header_addr, + bool add_image_to_target, + bool load_sections_in_target) { ModuleSP module_sp (new Module (file_spec, shared_from_this(), header_addr)); if (module_sp) { - m_target.GetImages().Append(module_sp); - bool changed = false; - module_sp->SetLoadAddress (m_target, 0, changed); + if (add_image_to_target) + { + m_target.GetImages().Append(module_sp); + if (load_sections_in_target) + { + bool changed = false; + module_sp->SetLoadAddress (m_target, 0, changed); + } + } } return module_sp; } @@ -2306,9 +2315,9 @@ Process::Launch (const ProcessLaunchInfo &launch_info) DidLaunch (); - m_dyld_ap.reset (DynamicLoader::FindPlugin (this, NULL)); - if (m_dyld_ap.get()) - m_dyld_ap->DidLaunch(); + DynamicLoader *dyld = GetDynamicLoader (); + if (dyld) + dyld->DidLaunch(); m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL)); // This delays passing the stopped event to listeners till DidLaunch gets @@ -2349,7 +2358,11 @@ Process::LoadCore () else StartPrivateStateThread (); - CompleteAttach (); + DynamicLoader *dyld = GetDynamicLoader (); + if (dyld) + dyld->DidAttach(); + + m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL)); // We successfully loaded a core file, now pretend we stopped so we can // show all of the threads in the core file and explore the crashed // state. @@ -2359,6 +2372,13 @@ Process::LoadCore () return error; } +DynamicLoader * +Process::GetDynamicLoader () +{ + if (m_dyld_ap.get() == NULL) + m_dyld_ap.reset (DynamicLoader::FindPlugin(this, NULL)); + return m_dyld_ap.get(); +} Process::NextEventAction::EventActionResult @@ -2622,9 +2642,9 @@ Process::CompleteAttach () // We have completed the attach, now it is time to find the dynamic loader // plug-in - m_dyld_ap.reset (DynamicLoader::FindPlugin(this, NULL)); - if (m_dyld_ap.get()) - m_dyld_ap->DidAttach(); + DynamicLoader *dyld = GetDynamicLoader (); + if (dyld) + dyld->DidAttach(); m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL)); // Figure out which one is the executable, and set that in our target: |