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.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150426 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index 6ea4486..5d8cb5b 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -211,31 +211,43 @@
debugger.GetTargetList().SetSelectedTarget(target_sp.get());
if (core_file)
{
- ProcessSP process_sp (target_sp->CreateProcess (m_interpreter.GetDebugger().GetListener(), NULL, &core_file));
char core_path[PATH_MAX];
core_file.GetPath(core_path, sizeof(core_path));
-
- if (process_sp)
+ if (core_file.Exists())
{
- // Seems wierd that we Launch a core file, but that is
- // what we do!
- error = process_sp->LoadCore();
+ FileSpec core_file_dir;
+ core_file_dir.GetDirectory() = core_file.GetDirectory();
+ target_sp->GetExecutableSearchPaths ().Append (core_file_dir);
- if (error.Fail())
+ ProcessSP process_sp (target_sp->CreateProcess (m_interpreter.GetDebugger().GetListener(), NULL, &core_file));
+
+ if (process_sp)
{
- result.AppendError(error.AsCString("can't find plug-in for core file"));
- result.SetStatus (eReturnStatusFailed);
- return false;
+ // Seems wierd that we Launch a core file, but that is
+ // what we do!
+ error = process_sp->LoadCore();
+
+ if (error.Fail())
+ {
+ result.AppendError(error.AsCString("can't find plug-in for core file"));
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
+ else
+ {
+ result.AppendMessageWithFormat ("Core file '%s' (%s) was loaded.\n", core_path, target_sp->GetArchitecture().GetArchitectureName());
+ result.SetStatus (eReturnStatusSuccessFinishNoResult);
+ }
}
else
{
- result.AppendMessageWithFormat ("Core file '%s' (%s) was loaded.\n", core_path, target_sp->GetArchitecture().GetArchitectureName());
- result.SetStatus (eReturnStatusSuccessFinishNoResult);
+ result.AppendErrorWithFormat ("Unable to find process plug-in for core file '%s'\n", core_path);
+ result.SetStatus (eReturnStatusFailed);
}
}
else
{
- result.AppendErrorWithFormat ("Unable to find process plug-in for core file '%s'\n", core_path);
+ result.AppendErrorWithFormat ("Core file '%s' does not exist\n", core_path);
result.SetStatus (eReturnStatusFailed);
}
}