summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r--lldb/source/API/SBTarget.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 8ff8b33b083..a265e64ec07 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -203,6 +203,11 @@ SBStructuredData SBTarget::GetStatistics() {
}
SBProcess SBTarget::LoadCore(const char *core_file) {
+ lldb::SBError error; // Ignored
+ return LoadCore(core_file, error);
+}
+
+SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) {
SBProcess sb_process;
TargetSP target_sp(GetSP());
if (target_sp) {
@@ -210,9 +215,14 @@ SBProcess SBTarget::LoadCore(const char *core_file) {
ProcessSP process_sp(target_sp->CreateProcess(
target_sp->GetDebugger().GetListener(), "", &filespec));
if (process_sp) {
- process_sp->LoadCore();
- sb_process.SetSP(process_sp);
+ error.SetError(process_sp->LoadCore());
+ if (error.Success())
+ sb_process.SetSP(process_sp);
+ } else {
+ error.SetErrorString("Failed to create the process");
}
+ } else {
+ error.SetErrorString("SBTarget is invalid");
}
return sb_process;
}
OpenPOWER on IntegriCloud