37 :
Thread(process, tid), m_thread_name(), m_dispatch_queue_name(),
43 LLDB_LOG(log,
"this = {0}, pid = {1}, tid = {2}",
this, process.
GetID(),
48 if (!gdb_process.m_register_info_sp->IsReconfigurable())
51 m_reg_info_sp = std::make_shared<GDBRemoteDynamicRegisterInfo>(
52 *gdb_process.m_register_info_sp);
58 LLDB_LOG(log,
"this = {0}, pid = {1}, tid = {2}",
this,
78 QueueKind queue_kind, uint64_t queue_serial,
80 LazyBool associated_with_libdispatch_queue) {
177 queue = process_sp->GetQueueList().FindQueueByID(queue_id);
218 LazyBool associated_with_libdispatch_queue) {
226 LLDB_LOGF(log,
"Fetching extended information for thread %4.4" PRIx64, tid);
240 LLDB_LOGF(log,
"Resuming thread: %4.4" PRIx64
" with state: %s.", tid,
247 switch (resume_state) {
282 const bool force =
false;
302 uint32_t concrete_frame_idx = 0;
307 if (concrete_frame_idx == 0) {
314 bool read_all_registers_at_once =
316 bool write_all_registers_at_once = !pSupported;
317 reg_ctx_sp = std::make_shared<GDBRemoteRegisterContext>(
318 *
this, concrete_frame_idx,
m_reg_info_sp, read_all_registers_at_once,
319 write_all_registers_at_once);
328 llvm::ArrayRef<uint8_t> data) {
346 ->CalculateThreadStopInfo(
this);
350llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
354 return llvm::createStringError(llvm::inconvertibleErrorCode(),
359 return llvm::createStringError(llvm::inconvertibleErrorCode(),
360 "qXfer:siginfo:read not supported");
362 llvm::Expected<std::string> response =
365 return response.takeError();
367 return llvm::MemoryBuffer::getMemBufferCopy(response.get());
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
A plug-in interface definition class for debugging a process.
lldb::pid_t GetID() const
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid.
const lldb::UnixSignalsSP & GetUnixSignals()
This base class provides an interface to stack frames.
uint32_t GetConcreteFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frame...
std::shared_ptr< Object > ObjectSP
A plug-in interface definition class for system runtimes.
virtual std::string GetQueueNameFromThreadQAddress(lldb::addr_t dispatch_qaddr)
Get the queue name for a thread given a thread's dispatch_qaddr.
virtual lldb::addr_t GetLibdispatchQueueAddressFromThreadQAddress(lldb::addr_t dispatch_qaddr)
Get the libdispatch_queue_t address for the queue given the thread's dispatch_qaddr.
virtual lldb::queue_id_t GetQueueIDFromThreadQAddress(lldb::addr_t dispatch_qaddr)
Get the QueueID for the libdispatch queue given the thread's dispatch_qaddr.
virtual lldb::QueueKind GetQueueKind(lldb::addr_t dispatch_qaddr)
Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
virtual lldb::user_id_t GetProtocolID() const
virtual void DestroyThread()
virtual Unwind & GetUnwinder()
int GetResumeSignal() const
lldb::ProcessSP GetProcess() const
lldb::RegisterContextSP m_reg_context_sp
The register context for this thread's current register state.
lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame)
llvm::Expected< std::string > ReadExtFeature(llvm::StringRef object, llvm::StringRef annex)
bool GetpPacketSupported(lldb::tid_t tid)
bool GetQXferSigInfoReadSupported()
bool PrivateSetRegisterValue(uint32_t reg, llvm::ArrayRef< uint8_t > data)
GDBRemoteCommunicationClient & GetGDBRemote()
tid_sig_collection m_continue_C_tids
GDBRemoteCommunicationClient m_gdb_comm
tid_sig_collection m_continue_S_tids
StructuredData::ObjectSP GetExtendedInfoForThread(lldb::tid_t tid)
bool m_use_g_packet_for_reading
tid_collection m_continue_c_tids
tid_collection m_continue_s_tids
StructuredData::ObjectSP FetchThreadExtendedInfo() override
uint64_t m_queue_serial_number
void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t) override
bool ThreadHasQueueInformation() const override
Whether this Thread already has all the Queue information cached or not.
lldb::QueueSP GetQueue() override
Retrieve the Queue for this thread, if any.
std::string m_dispatch_queue_name
std::string m_thread_name
void Dump(Log *log, uint32_t index)
const char * GetName() override
bool ShouldStop(bool &step_more)
void RefreshStateAfterStop() override
void SetQueueInfo(std::string &&queue_name, lldb::QueueKind queue_kind, uint64_t queue_serial, lldb::addr_t dispatch_queue_t, lldb_private::LazyBool associated_with_libdispatch_queue)
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo(size_t max_size) const override
lldb_private::LazyBool GetAssociatedWithLibdispatchQueue() override
Whether this thread can be associated with a libdispatch queue.
lldb::QueueKind GetQueueKind() override
Retrieve the Queue kind for the queue currently using this Thread.
lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame) override
lldb_private::LazyBool m_associated_with_libdispatch_queue
lldb::queue_id_t GetQueueID() override
Retrieve the Queue ID for the queue currently using this Thread.
const char * GetQueueName() override
Retrieve the Queue name for the queue currently using this Thread.
bool CalculateStopInfo() override
Ask the thread subclass to set its stop info.
void WillResume(lldb::StateType resume_state) override
lldb::RegisterContextSP GetRegisterContext() override
ThreadGDBRemote(Process &process, lldb::tid_t tid)
static bool ThreadIDIsValid(lldb::tid_t thread)
~ThreadGDBRemote() override
lldb::QueueKind m_queue_kind
bool CachedQueueInfoIsValid() const
lldb::addr_t m_thread_dispatch_qaddr
lldb::addr_t GetQueueLibdispatchQueueAddress() override
Retrieve the address of the libdispatch_queue_t struct for queue currently using this Thread.
lldb::addr_t m_dispatch_queue_t
void SetAssociatedWithLibdispatchQueue(lldb_private::LazyBool associated_with_libdispatch_queue) override
GDBRemoteDynamicRegisterInfoSP m_reg_info_sp
bool PrivateSetRegisterValue(uint32_t reg, llvm::ArrayRef< uint8_t > data)
#define LLDB_INVALID_QUEUE_ID
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::shared_ptr< lldb_private::Queue > QueueSP
StateType
Process and Thread States.
@ eStateStopped
Process or thread is stopped and can be examined.
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
lldb::user_id_t GetID() const
Get accessor for the user ID.