aboutsummaryrefslogtreecommitdiff
path: root/source/API/SBProcess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/API/SBProcess.cpp')
-rw-r--r--source/API/SBProcess.cpp52
1 files changed, 40 insertions, 12 deletions
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 9a0b23bc93d2..a1dbf686da03 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/lldb-python.h"
-
#include "lldb/API/SBProcess.h"
// C Includes
@@ -169,11 +167,11 @@ SBProcess::RemoteLaunch (char const **argv,
{
if (stop_at_entry)
launch_flags |= eLaunchFlagStopAtEntry;
- ProcessLaunchInfo launch_info (stdin_path,
- stdout_path,
- stderr_path,
- working_directory,
- launch_flags);
+ ProcessLaunchInfo launch_info(FileSpec{stdin_path, false},
+ FileSpec{stdout_path, false},
+ FileSpec{stderr_path, false},
+ FileSpec{working_directory, false},
+ launch_flags);
Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer();
if (exe_module)
launch_info.SetExecutableFile(exe_module->GetPlatformFileSpec(), true);
@@ -603,6 +601,30 @@ SBProcess::GetStopID(bool include_expression_stops)
return 0;
}
+SBEvent
+SBProcess::GetStopEventForStopID(uint32_t stop_id)
+{
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ SBEvent sb_event;
+ EventSP event_sp;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+ event_sp = process_sp->GetStopEventForStopID(stop_id);
+ sb_event.reset(event_sp);
+ }
+
+ if (log)
+ log->Printf ("SBProcess(%p)::GetStopEventForStopID (stop_id=%" PRIu32 ") => SBEvent(%p)",
+ static_cast<void*>(process_sp.get()),
+ stop_id,
+ static_cast<void*>(event_sp.get()));
+
+ return sb_event;
+}
+
StateType
SBProcess::GetState ()
{
@@ -768,7 +790,7 @@ SBProcess::Destroy ()
if (process_sp)
{
Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
- sb_error.SetError(process_sp->Destroy());
+ sb_error.SetError(process_sp->Destroy(false));
}
else
sb_error.SetErrorString ("SBProcess is invalid");
@@ -821,7 +843,7 @@ SBProcess::Kill ()
if (process_sp)
{
Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
- sb_error.SetError (process_sp->Destroy());
+ sb_error.SetError (process_sp->Destroy(true));
}
else
sb_error.SetErrorString ("SBProcess is invalid");
@@ -918,9 +940,9 @@ SBProcess::GetThreadByID (tid_t tid)
ProcessSP process_sp(GetSP());
if (process_sp)
{
- Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
Process::StopLocker stop_locker;
const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
thread_sp = process_sp->GetThreadList().FindThreadByID (tid, can_update);
sb_thread.SetThread (thread_sp);
}
@@ -942,9 +964,9 @@ SBProcess::GetThreadByIndexID (uint32_t index_id)
ProcessSP process_sp(GetSP());
if (process_sp)
{
- Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
Process::StopLocker stop_locker;
const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
thread_sp = process_sp->GetThreadList().FindThreadByIndexID (index_id, can_update);
sb_thread.SetThread (thread_sp);
}
@@ -999,9 +1021,15 @@ SBProcess::GetProcessFromEvent (const SBEvent &event)
}
bool
+SBProcess::GetInterruptedFromEvent (const SBEvent &event)
+{
+ return Process::ProcessEventData::GetInterruptedFromEvent(event.get());
+}
+
+bool
SBProcess::EventIsProcessEvent (const SBEvent &event)
{
- return strcmp (event.GetBroadcasterClass(), SBProcess::GetBroadcasterClass()) == 0;
+ return event.GetBroadcasterClass() == SBProcess::GetBroadcasterClass();
}
SBBroadcaster