summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-04-03 04:18:47 +0000
committerJason Molenda <jmolenda@apple.com>2013-04-03 04:18:47 +0000
commitd5318c0c35354b22b9b676b9e2bc7076306a3d08 (patch)
treedec05fa440fc8f03ca7c1781c9532c87ebefa2c5 /lldb/tools/debugserver/source
parentb00fc87608d9494f72d7e59054444bd24ba68966 (diff)
downloadbcm5719-llvm-d5318c0c35354b22b9b676b9e2bc7076306a3d08.tar.gz
bcm5719-llvm-d5318c0c35354b22b9b676b9e2bc7076306a3d08.zip
Fix another old usage of GetCurrentThread() to get a mach port
number in RNBRemote::HandlePacket_qProcessInfo -- add a new GetCurrentThreadMachPort() so callers who need to make a mach thred_get_state() call at the RNBRemote level will have a way to get the port number. llvm-svn: 178619
Diffstat (limited to 'lldb/tools/debugserver/source')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp12
-rw-r--r--lldb/tools/debugserver/source/DNB.h1
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.cpp6
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.h1
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp2
5 files changed, 21 insertions, 1 deletions
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index ed19b097327..fb780c8ca35 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -1773,6 +1773,18 @@ DNBProcessGetCurrentThread (nub_process_t pid)
}
//----------------------------------------------------------------------
+// Get the mach port number of the current thread.
+//----------------------------------------------------------------------
+nub_thread_t
+DNBProcessGetCurrentThreadMachPort (nub_process_t pid)
+{
+ MachProcessSP procSP;
+ if (GetProcessSP (pid, procSP))
+ return procSP->GetCurrentThreadMachPort();
+ return 0;
+}
+
+//----------------------------------------------------------------------
// Change the current thread.
//----------------------------------------------------------------------
nub_thread_t
diff --git a/lldb/tools/debugserver/source/DNB.h b/lldb/tools/debugserver/source/DNB.h
index 83366dbf999..c6acf5bbf7d 100644
--- a/lldb/tools/debugserver/source/DNB.h
+++ b/lldb/tools/debugserver/source/DNB.h
@@ -75,6 +75,7 @@ nub_bool_t DNBProcessGetExitStatus (nub_process_t pid, int
nub_bool_t DNBProcessSetExitStatus (nub_process_t pid, int status) DNB_EXPORT;
nub_size_t DNBProcessGetNumThreads (nub_process_t pid) DNB_EXPORT;
nub_thread_t DNBProcessGetCurrentThread (nub_process_t pid) DNB_EXPORT;
+nub_thread_t DNBProcessGetCurrentThreadMachPort (nub_process_t pid) DNB_EXPORT;
nub_thread_t DNBProcessSetCurrentThread (nub_process_t pid, nub_thread_t tid) DNB_EXPORT;
nub_thread_t DNBProcessGetThreadAtIndex (nub_process_t pid, nub_size_t thread_idx) DNB_EXPORT;
nub_bool_t DNBProcessSyncThreadState (nub_process_t pid, nub_thread_t tid) DNB_EXPORT;
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
index de11cc8cecc..8176f10a1b4 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
@@ -186,6 +186,12 @@ MachProcess::GetCurrentThread ()
}
nub_thread_t
+MachProcess::GetCurrentThreadMachPort ()
+{
+ return m_thread_list.GetMachPortNumberByThreadID(m_thread_list.CurrentThreadID());
+}
+
+nub_thread_t
MachProcess::SetCurrentThread(nub_thread_t tid)
{
return m_thread_list.SetCurrentThread(tid);
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.h b/lldb/tools/debugserver/source/MacOSX/MachProcess.h
index 542c3dbc93a..eee40e469df 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.h
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.h
@@ -176,6 +176,7 @@ public:
nub_size_t GetNumThreads () const;
nub_thread_t GetThreadAtIndex (nub_size_t thread_idx) const;
nub_thread_t GetCurrentThread ();
+ nub_thread_t GetCurrentThreadMachPort ();
nub_thread_t SetCurrentThread (nub_thread_t tid);
MachThreadList & GetThreadList() { return m_thread_list; }
bool GetThreadStoppedReason(nub_thread_t tid, struct DNBThreadStopInfo *stop_info) const;
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 4c515f40365..35d960b8e3a 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -4099,7 +4099,7 @@ RNBRemote::HandlePacket_qProcessInfo (const char *p)
#endif
#if (defined (__x86_64__) || defined (__i386__)) && defined (x86_THREAD_STATE)
- nub_thread_t thread = DNBProcessGetCurrentThread (pid);
+ nub_thread_t thread = DNBProcessGetCurrentThreadMachPort (pid);
kern_return_t kr;
x86_thread_state_t gp_regs;
mach_msg_type_number_t gp_count = x86_THREAD_STATE_COUNT;
OpenPOWER on IntegriCloud