summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBProcess.cpp
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2015-11-20 18:15:14 +0000
committerAdrian McCarthy <amccarth@google.com>2015-11-20 18:15:14 +0000
commitaf75dab3834f4afdc168df45b8bc93b44219c4ef (patch)
tree343559d9b73e59b76ba96086597a40046c338560 /lldb/source/API/SBProcess.cpp
parent4d5d1dd6d56b0fec5dee0270d4ee83bfae56d284 (diff)
downloadbcm5719-llvm-af75dab3834f4afdc168df45b8bc93b44219c4ef.tar.gz
bcm5719-llvm-af75dab3834f4afdc168df45b8bc93b44219c4ef.zip
FOO
llvm-svn: 253684
Diffstat (limited to 'lldb/source/API/SBProcess.cpp')
-rw-r--r--lldb/source/API/SBProcess.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 95deabc2823..afb4b6f17b3 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -19,6 +19,7 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
+#include "lldb/Core/PluginManager.h"
#include "lldb/Core/State.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamFile.h"
@@ -1425,3 +1426,27 @@ SBProcess::IsInstrumentationRuntimePresent(InstrumentationRuntimeType type)
return runtime_sp->IsActive();
}
+
+lldb::SBError
+SBProcess::SaveCore(const char *file_name)
+{
+ lldb::SBError error;
+ ProcessSP process_sp(GetSP());
+ if (!process_sp)
+ {
+ error.SetErrorString("SBProcess is invalid");
+ return error;
+ }
+
+ Mutex::Locker api_locker(process_sp->GetTarget().GetAPIMutex());
+
+ if (process_sp->GetState() != eStateStopped)
+ {
+ error.SetErrorString("the process is not stopped");
+ return error;
+ }
+
+ FileSpec core_file(file_name, false);
+ error.ref() = PluginManager::SaveCore(process_sp, core_file);
+ return error;
+}
OpenPOWER on IntegriCloud