diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-10-18 05:55:24 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-10-18 05:55:24 +0000 |
commit | 3dc4f44e71bc9d5650b2cd134ca4733438acfbfb (patch) | |
tree | cebabb5909032f4f2100b2f12c575cfdfc445048 /lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | |
parent | 19bff32e093de869aaf7fe2161ed23718d62e437 (diff) | |
download | bcm5719-llvm-3dc4f44e71bc9d5650b2cd134ca4733438acfbfb.tar.gz bcm5719-llvm-3dc4f44e71bc9d5650b2cd134ca4733438acfbfb.zip |
Move the code which translates a dispatch_qaddr into a
queue name out of ProcessGDBRemote and in to the Platform
plugin, specifically PlatformDarwin.
Also add a Platform method to translate a dispatch_quaddr
to a QueueID, and a Thread::GetQueueID().
I'll add an SBThread::GetQueueID() next.
llvm-svn: 192949
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index cce5a599566..4e475c80bda 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -10,16 +10,17 @@ #include "ThreadGDBRemote.h" +#include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/State.h" +#include "lldb/Core/StreamString.h" +#include "lldb/Target/Platform.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/Watchpoint.h" #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" @@ -73,13 +74,38 @@ ThreadGDBRemote::GetQueueName () ProcessSP process_sp (GetProcess()); if (process_sp) { - ProcessGDBRemote *gdb_process = static_cast<ProcessGDBRemote *>(process_sp.get()); - return gdb_process->GetDispatchQueueNameForThread (m_thread_dispatch_qaddr, m_dispatch_queue_name); + PlatformSP platform_sp (process_sp->GetTarget().GetPlatform()); + if (platform_sp) + { + m_dispatch_queue_name = platform_sp->GetQueueNameForThreadQAddress (process_sp.get(), m_thread_dispatch_qaddr); + } + if (m_dispatch_queue_name.length() > 0) + { + return m_dispatch_queue_name.c_str(); + } } } return NULL; } +queue_id_t +ThreadGDBRemote::GetQueueID () +{ + if (m_thread_dispatch_qaddr != 0 || m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS) + { + ProcessSP process_sp (GetProcess()); + if (process_sp) + { + PlatformSP platform_sp (process_sp->GetTarget().GetPlatform()); + if (platform_sp) + { + return platform_sp->GetQueueIDForThreadQAddress (process_sp.get(), m_thread_dispatch_qaddr); + } + } + } + return LLDB_INVALID_QUEUE_ID; +} + void ThreadGDBRemote::WillResume (StateType resume_state) { |