summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-07-04 01:02:43 +0000
committeremaste <emaste@FreeBSD.org>2015-07-04 01:02:43 +0000
commitcea4c167517a0678c7dbf92a0324088dcbac1035 (patch)
tree02de7f7c9d5a08ae1c4d3b4c98a565ff96cd52e6 /contrib/llvm/tools/lldb/source/API/SBProcess.cpp
parent1756896fd2b99ede7ebeb8019d4004bdfeed3bbe (diff)
parent8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (diff)
downloadFreeBSD-src-cea4c167517a0678c7dbf92a0324088dcbac1035.zip
FreeBSD-src-cea4c167517a0678c7dbf92a0324088dcbac1035.tar.gz
Update LLDB snapshot to upstream r241361
Notable upstream commits (upstream revision in parens): - Add a JSON producer to LLDB (228636) - Don't crash on bad DWARF expression (228729) - Add support of DWARFv3 DW_OP_form_tls_address (231342) - Assembly profiler for MIPS64 (232619) - Handle FreeBSD/arm64 core files (233273) - Read/Write register for MIPS64 (233685) - Rework LLDB system initialization (233758) - SysV ABI for aarch64 (236098) - MIPS software single stepping (236696) - FreeBSD/arm live debugging support (237303) - Assembly profiler for mips32 (237420) - Parse function name from DWARF DW_AT_abstract_origin (238307) - Improve LLDB prompt handling (238313) - Add real time signals support to FreeBSDSignals (238316) - Fix race in IOHandlerProcessSTDIO (238423) - MIPS64 Branch instruction emulation for SW single stepping (238820) - Improve OSType initialization in elf object file's arch_spec (239148) - Emulation of MIPS64 floating-point branch instructions (239996) - ABI Plugin for MIPS32 (239997) - ABI Plugin for MIPS64 (240123) - MIPS32 branch emulation and single stepping (240373) - Improve instruction emulation based stack unwinding on ARM (240533) - Add branch emulation to aarch64 instruction emulator (240769)
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBProcess.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/API/SBProcess.cpp52
1 files changed, 40 insertions, 12 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBProcess.cpp b/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
index 9a0b23b..a1dbf68 100644
--- a/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
+++ b/contrib/llvm/tools/lldb/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
OpenPOWER on IntegriCloud