1 //===-- ThreadGDBRemote.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadGDBRemote_h_
11 #define liblldb_ThreadGDBRemote_h_
17 // Other libraries and framework includes
19 #include "lldb/Core/StructuredData.h"
20 #include "lldb/Target/Process.h"
21 #include "lldb/Target/Thread.h"
23 class StringExtractor;
25 namespace lldb_private {
26 namespace process_gdb_remote {
28 class ProcessGDBRemote;
30 class ThreadGDBRemote : public Thread
33 ThreadGDBRemote (Process &process, lldb::tid_t tid);
35 ~ThreadGDBRemote() override;
38 WillResume (lldb::StateType resume_state) override;
41 RefreshStateAfterStop() override;
47 GetQueueName () override;
50 GetQueueID () override;
56 GetQueueLibdispatchQueueAddress () override;
58 lldb::RegisterContextSP
59 GetRegisterContext () override;
61 lldb::RegisterContextSP
62 CreateRegisterContextForFrame (StackFrame *frame) override;
65 Dump (Log *log, uint32_t index);
68 ThreadIDIsValid (lldb::tid_t thread);
71 ShouldStop (bool &step_more);
74 GetBasicInfoAsString ();
77 SetName (const char *name) override
80 m_thread_name.assign (name);
82 m_thread_name.clear();
86 GetThreadDispatchQAddr ()
88 return m_thread_dispatch_qaddr;
92 SetThreadDispatchQAddr (lldb::addr_t thread_dispatch_qaddr)
94 m_thread_dispatch_qaddr = thread_dispatch_qaddr;
101 SetQueueInfo (std::string &&queue_name, lldb::QueueKind queue_kind, uint64_t queue_serial);
103 StructuredData::ObjectSP
104 FetchThreadExtendedInfo () override;
107 friend class ProcessGDBRemote;
109 std::string m_thread_name;
110 std::string m_dispatch_queue_name;
111 lldb::addr_t m_thread_dispatch_qaddr;
112 lldb::QueueKind m_queue_kind; // Queue info from stop reply/stop info for thread
113 uint64_t m_queue_serial; // Queue info from stop reply/stop info for thread
116 PrivateSetRegisterValue (uint32_t reg,
117 StringExtractor &response);
120 PrivateSetRegisterValue (uint32_t reg,
124 CachedQueueInfoIsValid() const
126 return m_queue_kind != lldb::eQueueKindUnknown;
129 SetStopInfoFromPacket (StringExtractor &stop_packet, uint32_t stop_id);
132 CalculateStopInfo () override;
135 } // namespace process_gdb_remote
136 } // namespace lldb_private
138 #endif // liblldb_ThreadGDBRemote_h_