summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp19
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp24
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h22
3 files changed, 24 insertions, 41 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 2bb7a1033a4..759f20dafb4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -46,6 +46,8 @@
#include "ProcessGDBRemoteLog.h"
#include "ThreadGDBRemote.h"
#include "MacOSXLibunwindCallbacks.h"
+#include "StopInfoMachException.h"
+
#define DEBUGSERVER_BASENAME "debugserver"
@@ -1021,21 +1023,24 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet)
gdb_thread->SetThreadDispatchQAddr (thread_dispatch_qaddr);
gdb_thread->SetName (thread_name.empty() ? thread_name.c_str() : NULL);
- Thread::StopInfo& stop_info = gdb_thread->GetStopInfoRef();
- gdb_thread->SetStopInfoStopID (GetStopID());
if (exc_type != 0)
{
- stop_info.SetStopReasonWithMachException (exc_type,
- exc_data.size(),
- &exc_data[0]);
+ const size_t exc_data_count = exc_data.size();
+
+ gdb_thread->SetStopInfo (StopInfoMachException::CreateStopReasonWithMachException (*thread_sp,
+ exc_type,
+ exc_data_count,
+ exc_data_count >= 1 ? exc_data[0] : 0,
+ exc_data_count >= 2 ? exc_data[1] : 0));
}
else if (signo)
{
- stop_info.SetStopReasonWithSignal (signo);
+ gdb_thread->SetStopInfo (StopInfo::CreateStopReasonWithSignal (*thread_sp, signo));
}
else
{
- stop_info.SetStopReasonToNone ();
+ StopInfoSP invalid_stop_info_sp;
+ gdb_thread->SetStopInfo (invalid_stop_info_sp);
}
}
return eStateStopped;
diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
index 4eae1e6d41b..6f7cf7bc4fd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -15,6 +15,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Unwind.h"
#include "lldb/Breakpoint/WatchpointLocation.h"
@@ -35,8 +36,6 @@ using namespace lldb_private;
ThreadGDBRemote::ThreadGDBRemote (ProcessGDBRemote &process, lldb::tid_t tid) :
Thread(process, tid),
- m_stop_info_stop_id (0),
- m_stop_info (this),
m_thread_name (),
m_dispatch_queue_name (),
m_thread_dispatch_qaddr (LLDB_INVALID_ADDRESS),
@@ -83,7 +82,7 @@ ThreadGDBRemote::WillResume (StateType resume_state)
// TODO: cache for next time in case we can match things up??
ClearStackFrames();
int signo = GetResumeSignal();
- m_stop_info.Clear();
+
switch (resume_state)
{
case eStateSuspended:
@@ -269,11 +268,13 @@ ThreadGDBRemote::RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint)
return false;
}
-bool
-ThreadGDBRemote::GetRawStopReason (StopInfo *stop_info)
+lldb::StopInfoSP
+ThreadGDBRemote::GetPrivateStopReason ()
{
- if (m_stop_info_stop_id != m_process.GetStopID())
+ if (m_actual_stop_info_sp.get() == NULL || m_actual_stop_info_sp->IsValid() == false)
{
+ m_actual_stop_info_sp.reset();
+
char packet[256];
::snprintf(packet, sizeof(packet), "qThreadStopInfo%x", GetID());
StringExtractorGDBRemote stop_packet;
@@ -281,18 +282,9 @@ ThreadGDBRemote::GetRawStopReason (StopInfo *stop_info)
{
std::string copy(stop_packet.GetStringRef());
GetGDBProcess().SetThreadStopInfo (stop_packet);
- // The process should have set the stop info stop ID and also
- // filled this thread in with valid stop info
- if (m_stop_info_stop_id != m_process.GetStopID())
- {
- //ProcessGDBRemoteLog::LogIf(GDBR_LOG_THREAD, "warning: qThreadStopInfo problem: '%s' => '%s'", packet, stop_packet.GetStringRef().c_str());
- printf("warning: qThreadStopInfo problem: '%s' => '%s'\n\torig '%s'\n", packet, stop_packet.GetStringRef().c_str(), copy.c_str()); /// REMOVE THIS
- return false;
- }
}
}
- *stop_info = m_stop_info;
- return true;
+ return m_actual_stop_info_sp;
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
index d40c2e1f6ab..01c37d8b5df 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
@@ -87,22 +87,10 @@ public:
const char *
GetBasicInfoAsString ();
- lldb_private::Thread::StopInfo &
- GetStopInfoRef ()
- {
- return m_stop_info;
- }
-
- uint32_t
- GetStopInfoStopID()
- {
- return m_stop_info_stop_id;
- }
-
void
- SetStopInfoStopID (uint32_t stop_id)
+ SetStopInfo (const lldb::StopInfoSP &stop_info)
{
- m_stop_info_stop_id = stop_id;
+ m_actual_stop_info_sp = stop_info;
}
void
@@ -130,8 +118,6 @@ protected:
//------------------------------------------------------------------
// Member variables.
//------------------------------------------------------------------
- uint32_t m_stop_info_stop_id;
- lldb_private::Thread::StopInfo m_stop_info;
std::string m_thread_name;
std::string m_dispatch_queue_name;
lldb::addr_t m_thread_dispatch_qaddr;
@@ -146,8 +132,8 @@ protected:
void
SetStopInfoFromPacket (StringExtractor &stop_packet, uint32_t stop_id);
- virtual bool
- GetRawStopReason (StopInfo *stop_info);
+ virtual lldb::StopInfoSP
+ GetPrivateStopReason ();
};
OpenPOWER on IntegriCloud