LLDB  mainline
FreeBSDThread.cpp
Go to the documentation of this file.
1 //===-- FreeBSDThread.cpp ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include <errno.h>
10 #include <pthread.h>
11 #include <pthread_np.h>
12 #include <stdlib.h>
13 #include <sys/sysctl.h>
14 #include <sys/types.h>
15 #include <sys/user.h>
16 
18 #include "lldb/Utility/State.h"
19 
20 #include "FreeBSDThread.h"
21 #include "POSIXStopInfo.h"
30 #include "ProcessFreeBSD.h"
31 #include "ProcessMonitor.h"
39 #include "lldb/Core/Debugger.h"
40 #include "lldb/Host/Host.h"
41 #include "lldb/Host/HostInfo.h"
43 #include "lldb/Target/Process.h"
44 #include "lldb/Target/StopInfo.h"
45 #include "lldb/Target/Target.h"
46 #include "lldb/Target/ThreadSpec.h"
47 #include "lldb/Utility/State.h"
48 #include "llvm/ADT/SmallString.h"
49 
50 using namespace lldb;
51 using namespace lldb_private;
52 
54  : Thread(process, tid), m_frame_up(), m_breakpoint(),
55  m_thread_name_valid(false), m_thread_name(), m_posix_thread(nullptr) {
57  LLDB_LOGV(log, "tid = {0}", tid);
58 
59  // Set the current watchpoints for this thread.
60  Target &target = GetProcess()->GetTarget();
61  const WatchpointList &wp_list = target.GetWatchpointList();
62  size_t wp_size = wp_list.GetSize();
63 
64  for (uint32_t wp_idx = 0; wp_idx < wp_size; wp_idx++) {
65  lldb::WatchpointSP wp = wp_list.GetByIndex(wp_idx);
66  if (wp.get() && wp->IsEnabled()) {
67  // This watchpoint as been enabled; obviously this "new" thread has been
68  // created since that watchpoint was enabled. Since the
69  // POSIXBreakpointProtocol has yet to be initialized, its
70  // m_watchpoints_initialized member will be FALSE. Attempting to read
71  // the debug status register to determine if a watchpoint has been hit
72  // would result in the zeroing of that register. Since the active debug
73  // registers would have been cloned when this thread was created, simply
74  // force the m_watchpoints_initized member to TRUE and avoid resetting
75  // dr6 and dr7.
77  }
78  }
79 }
80 
82 
84  ProcessSP base = GetProcess();
85  ProcessFreeBSD &process = static_cast<ProcessFreeBSD &>(*base);
86  return process.GetMonitor();
87 }
88 
90  // Invalidate all registers in our register context. We don't set "force" to
91  // true because the stop reply packet might have had some register values
92  // that were expedited and these will already be copied into the register
93  // context by the time this function gets called. The KDPRegisterContext
94  // class has been made smart enough to detect when it needs to invalidate
95  // which registers are valid by putting hooks in the register read and
96  // register supply functions where they check the process stop ID and do the
97  // right thing. if (StateIsStoppedState(GetState())
98  {
99  const bool force = false;
100  GetRegisterContext()->InvalidateIfNeeded(force);
101  }
102 }
103 
104 const char *FreeBSDThread::GetInfo() { return nullptr; }
105 
106 void FreeBSDThread::SetName(const char *name) {
107  m_thread_name_valid = (name && name[0]);
109  m_thread_name.assign(name);
110  else
111  m_thread_name.clear();
112 }
113 
114 const char *FreeBSDThread::GetName() {
115  if (!m_thread_name_valid) {
116  m_thread_name.clear();
117  int pid = GetProcess()->GetID();
118 
119  struct kinfo_proc *kp = nullptr, *nkp;
120  size_t len = 0;
121  int error;
122  int ctl[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID | KERN_PROC_INC_THREAD,
123  pid};
124 
125  while (1) {
126  error = sysctl(ctl, 4, kp, &len, nullptr, 0);
127  if (kp == nullptr || (error != 0 && errno == ENOMEM)) {
128  // Add extra space in case threads are added before next call.
129  len += sizeof(*kp) + len / 10;
130  nkp = (struct kinfo_proc *)realloc(kp, len);
131  if (nkp == nullptr) {
132  free(kp);
133  return nullptr;
134  }
135  kp = nkp;
136  continue;
137  }
138  if (error != 0)
139  len = 0;
140  break;
141  }
142 
143  for (size_t i = 0; i < len / sizeof(*kp); i++) {
144  if (kp[i].ki_tid == (lwpid_t)GetID()) {
145  m_thread_name.append(kp[i].ki_tdname,
146  kp[i].ki_tdname + strlen(kp[i].ki_tdname));
147  break;
148  }
149  }
150  free(kp);
151  m_thread_name_valid = true;
152  }
153 
154  if (m_thread_name.empty())
155  return nullptr;
156  return m_thread_name.c_str();
157 }
158 
159 lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {
160  if (!m_reg_context_sp) {
161  m_posix_thread = nullptr;
162 
163  RegisterInfoInterface *reg_interface = nullptr;
164  const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
165 
166  assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
167  switch (target_arch.GetMachine()) {
168  case llvm::Triple::aarch64:
169  reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
170  break;
171  case llvm::Triple::arm:
172  reg_interface = new RegisterInfoPOSIX_arm(target_arch);
173  break;
174  case llvm::Triple::ppc:
175 #ifndef __powerpc64__
176  reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
177  break;
178 #endif
179  case llvm::Triple::ppc64:
180  reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
181  break;
182  case llvm::Triple::mips64:
183  reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
184  break;
185  case llvm::Triple::x86:
186  reg_interface = new RegisterContextFreeBSD_i386(target_arch);
187  break;
188  case llvm::Triple::x86_64:
189  reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
190  break;
191  default:
192  llvm_unreachable("CPU not supported");
193  }
194 
195  switch (target_arch.GetMachine()) {
196  case llvm::Triple::aarch64: {
198  new RegisterContextPOSIXProcessMonitor_arm64(*this, 0, reg_interface);
199  m_posix_thread = reg_ctx;
200  m_reg_context_sp.reset(reg_ctx);
201  break;
202  }
203  case llvm::Triple::arm: {
205  new RegisterContextPOSIXProcessMonitor_arm(*this, 0, reg_interface);
206  m_posix_thread = reg_ctx;
207  m_reg_context_sp.reset(reg_ctx);
208  break;
209  }
210  case llvm::Triple::mips64: {
213  reg_interface);
214  m_posix_thread = reg_ctx;
215  m_reg_context_sp.reset(reg_ctx);
216  break;
217  }
218  case llvm::Triple::ppc:
219  case llvm::Triple::ppc64: {
222  reg_interface);
223  m_posix_thread = reg_ctx;
224  m_reg_context_sp.reset(reg_ctx);
225  break;
226  }
227  case llvm::Triple::x86:
228  case llvm::Triple::x86_64: {
231  reg_interface);
232  m_posix_thread = reg_ctx;
233  m_reg_context_sp.reset(reg_ctx);
234  break;
235  }
236  default:
237  break;
238  }
239  }
240  return m_reg_context_sp;
241 }
242 
243 lldb::RegisterContextSP
245  lldb::RegisterContextSP reg_ctx_sp;
246  uint32_t concrete_frame_idx = 0;
247 
249  LLDB_LOGV(log, "called");
250 
251  if (frame)
252  concrete_frame_idx = frame->GetConcreteFrameIndex();
253 
254  if (concrete_frame_idx == 0)
255  reg_ctx_sp = GetRegisterContext();
256  else {
257  assert(GetUnwinder());
258  reg_ctx_sp = GetUnwinder()->CreateRegisterContextForFrame(frame);
259  }
260 
261  return reg_ctx_sp;
262 }
263 
265  ProcessMonitor &monitor = GetMonitor();
266  addr_t addr;
267  if (monitor.ReadThreadPointer(GetID(), addr))
268  return addr;
269  else
270  return LLDB_INVALID_ADDRESS;
271 }
272 
275  return true;
276 }
277 
279  if (!m_unwinder_up)
280  m_unwinder_up.reset(new UnwindLLDB(*this));
281 
282  return m_unwinder_up.get();
283 }
284 
286  // Don't set the thread state to stopped unless we really stopped.
287 }
288 
291  if (log)
292  log->Printf("tid %lu resume_state = %s", GetID(),
293  lldb_private::StateAsCString(resume_state));
294  ProcessSP process_sp(GetProcess());
295  ProcessFreeBSD *process = static_cast<ProcessFreeBSD *>(process_sp.get());
296  int signo = GetResumeSignal();
297  bool signo_valid = process->GetUnixSignals()->SignalIsValid(signo);
298 
299  switch (resume_state) {
300  case eStateSuspended:
301  case eStateStopped:
302  process->m_suspend_tids.push_back(GetID());
303  break;
304  case eStateRunning:
305  process->m_run_tids.push_back(GetID());
306  if (signo_valid)
307  process->m_resume_signo = signo;
308  break;
309  case eStateStepping:
310  process->m_step_tids.push_back(GetID());
311  if (signo_valid)
312  process->m_resume_signo = signo;
313  break;
314  default:
315  break;
316  }
317 }
318 
320  lldb::StateType resume_state = GetResumeState();
321  ProcessMonitor &monitor = GetMonitor();
322  bool status;
323 
325  if (log)
326  log->Printf("FreeBSDThread::%s (), resume_state = %s", __FUNCTION__,
327  StateAsCString(resume_state));
328 
329  switch (resume_state) {
330  default:
331  assert(false && "Unexpected state for resume!");
332  status = false;
333  break;
334 
335  case lldb::eStateRunning:
336  SetState(resume_state);
337  status = monitor.Resume(GetID(), GetResumeSignal());
338  break;
339 
341  SetState(resume_state);
342  status = monitor.SingleStep(GetID(), GetResumeSignal());
343  break;
344  case lldb::eStateStopped:
346  status = true;
347  break;
348  }
349 
350  return status;
351 }
352 
353 void FreeBSDThread::Notify(const ProcessMessage &message) {
355  if (log)
356  log->Printf("FreeBSDThread::%s () message kind = '%s' for tid %" PRIu64,
357  __FUNCTION__, message.PrintKind(), GetID());
358 
359  switch (message.GetKind()) {
360  default:
361  assert(false && "Unexpected message kind!");
362  break;
363 
365  // Nothing to be done.
366  break;
367 
369  LimboNotify(message);
370  break;
371 
374  SignalNotify(message);
375  break;
376 
378  SignalDeliveredNotify(message);
379  break;
380 
382  TraceNotify(message);
383  break;
384 
386  BreakNotify(message);
387  break;
388 
390  WatchNotify(message);
391  break;
392 
394  ExecNotify(message);
395  break;
396  }
397 }
398 
400  bool wp_set = false;
401  if (wp) {
402  addr_t wp_addr = wp->GetLoadAddress();
403  size_t wp_size = wp->GetByteSize();
404  bool wp_read = wp->WatchpointRead();
405  bool wp_write = wp->WatchpointWrite();
406  uint32_t wp_hw_index = wp->GetHardwareIndex();
408  if (reg_ctx)
409  wp_set = reg_ctx->SetHardwareWatchpointWithIndex(
410  wp_addr, wp_size, wp_read, wp_write, wp_hw_index);
411  }
412  return wp_set;
413 }
414 
416  bool result = false;
417  if (wp) {
418  lldb::RegisterContextSP reg_ctx_sp = GetRegisterContext();
419  if (reg_ctx_sp.get())
420  result = reg_ctx_sp->ClearHardwareWatchpoint(wp->GetHardwareIndex());
421  }
422  return result;
423 }
424 
426  lldb::RegisterContextSP reg_ctx_sp = GetRegisterContext();
427  if (reg_ctx_sp.get())
428  return reg_ctx_sp->NumSupportedHardwareWatchpoints();
429  return 0;
430 }
431 
433  uint32_t hw_index = LLDB_INVALID_INDEX32;
435  uint32_t wp_idx;
437  if (reg_ctx) {
438  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
439  if (reg_ctx->IsWatchpointVacant(wp_idx)) {
440  hw_index = wp_idx;
441  break;
442  }
443  }
444  }
445  return hw_index;
446 }
447 
449  bool status;
451 
452  assert(GetRegisterContext());
454  assert(status && "Breakpoint update failed!");
455 
456  // With our register state restored, resolve the breakpoint object
457  // corresponding to our current PC.
458  assert(GetRegisterContext());
459  lldb::addr_t pc = GetRegisterContext()->GetPC();
460  if (log)
461  log->Printf("FreeBSDThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc);
462  lldb::BreakpointSiteSP bp_site(
463  GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
464 
465  // If the breakpoint is for this thread, then we'll report the hit, but if it
466  // is for another thread, we create a stop reason with should_stop=false. If
467  // there is no breakpoint location, then report an invalid stop reason. We
468  // don't need to worry about stepping over the breakpoint here, that will be
469  // taken care of when the thread resumes and notices that there's a
470  // breakpoint under the pc.
471  if (bp_site) {
472  lldb::break_id_t bp_id = bp_site->GetID();
473  // If we have an operating system plug-in, we might have set a thread
474  // specific breakpoint using the operating system thread ID, so we can't
475  // make any assumptions about the thread ID so we must always report the
476  // breakpoint regardless of the thread.
477  if (bp_site->ValidForThisThread(this) ||
478  GetProcess()->GetOperatingSystem() != nullptr)
479  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id));
480  else {
481  const bool should_stop = false;
482  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id,
483  should_stop));
484  }
485  } else
486  SetStopInfo(StopInfoSP());
487 }
488 
491 
492  lldb::addr_t halt_addr = message.GetHWAddress();
493  if (log)
494  log->Printf(
495  "FreeBSDThread::%s () Hardware Watchpoint Address = 0x%8.8" PRIx64,
496  __FUNCTION__, halt_addr);
497 
499  if (reg_ctx) {
500  uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
501  uint32_t wp_idx;
502  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
503  if (reg_ctx->IsWatchpointHit(wp_idx)) {
504  // Clear the watchpoint hit here
505  reg_ctx->ClearWatchpointHits();
506  break;
507  }
508  }
509 
510  if (wp_idx == num_hw_wps)
511  return;
512 
513  Target &target = GetProcess()->GetTarget();
514  lldb::addr_t wp_monitor_addr = reg_ctx->GetWatchpointAddress(wp_idx);
515  const WatchpointList &wp_list = target.GetWatchpointList();
516  lldb::WatchpointSP wp_sp = wp_list.FindByAddress(wp_monitor_addr);
517 
518  assert(wp_sp.get() && "No watchpoint found");
519  SetStopInfo(
520  StopInfo::CreateStopReasonWithWatchpointID(*this, wp_sp->GetID()));
521  }
522 }
523 
526 
527  // Try to resolve the breakpoint object corresponding to the current PC.
528  assert(GetRegisterContext());
529  lldb::addr_t pc = GetRegisterContext()->GetPC();
530  if (log)
531  log->Printf("FreeBSDThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc);
532  lldb::BreakpointSiteSP bp_site(
533  GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
534 
535  // If the current pc is a breakpoint site then set the StopInfo to
536  // Breakpoint. Otherwise, set the StopInfo to Watchpoint or Trace. If we have
537  // an operating system plug-in, we might have set a thread specific
538  // breakpoint using the operating system thread ID, so we can't make any
539  // assumptions about the thread ID so we must always report the breakpoint
540  // regardless of the thread.
541  if (bp_site && (bp_site->ValidForThisThread(this) ||
542  GetProcess()->GetOperatingSystem() != nullptr))
543  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(
544  *this, bp_site->GetID()));
545  else {
547  if (reg_ctx) {
548  uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
549  uint32_t wp_idx;
550  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
551  if (reg_ctx->IsWatchpointHit(wp_idx)) {
552  WatchNotify(message);
553  return;
554  }
555  }
556  }
557  SetStopInfo(StopInfo::CreateStopReasonToTrace(*this));
558  }
559 }
560 
562  SetStopInfo(lldb::StopInfoSP(new POSIXLimboStopInfo(*this)));
563 }
564 
566  int signo = message.GetSignal();
567  if (message.GetKind() == ProcessMessage::eCrashMessage) {
568  std::string stop_description = GetCrashReasonString(
569  message.GetCrashReason(), message.GetFaultAddress());
570  SetStopInfo(StopInfo::CreateStopReasonWithSignal(
571  *this, signo, stop_description.c_str()));
572  } else {
573  SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
574  }
575 }
576 
578  int signo = message.GetSignal();
579  SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
580 }
581 
582 unsigned FreeBSDThread::GetRegisterIndexFromOffset(unsigned offset) {
583  unsigned reg = LLDB_INVALID_REGNUM;
584  ArchSpec arch = HostInfo::GetArchitecture();
585 
586  switch (arch.GetMachine()) {
587  default:
588  llvm_unreachable("CPU type not supported!");
589  break;
590 
591  case llvm::Triple::aarch64:
592  case llvm::Triple::arm:
593  case llvm::Triple::mips64:
594  case llvm::Triple::ppc:
595  case llvm::Triple::ppc64:
596  case llvm::Triple::x86:
597  case llvm::Triple::x86_64: {
599  reg = reg_ctx->GetRegisterIndexFromOffset(offset);
600  } break;
601  }
602  return reg;
603 }
604 
606  SetStopInfo(StopInfo::CreateStopReasonWithExec(*this));
607 }
608 
609 const char *FreeBSDThread::GetRegisterName(unsigned reg) {
610  const char *name = nullptr;
611  ArchSpec arch = HostInfo::GetArchitecture();
612 
613  switch (arch.GetMachine()) {
614  default:
615  assert(false && "CPU type not supported!");
616  break;
617 
618  case llvm::Triple::aarch64:
619  case llvm::Triple::arm:
620  case llvm::Triple::mips64:
621  case llvm::Triple::ppc:
622  case llvm::Triple::ppc64:
623  case llvm::Triple::x86:
624  case llvm::Triple::x86_64:
625  name = GetRegisterContext()->GetRegisterName(reg);
626  break;
627  }
628  return name;
629 }
630 
631 const char *FreeBSDThread::GetRegisterNameFromOffset(unsigned offset) {
633 }
lldb_private::Unwind * GetUnwinder() override
virtual bool IsWatchpointHit(uint32_t hw_index)=0
void RefreshStateAfterStop() override
void Notify(const ProcessMessage &message)
virtual bool ClearWatchpointHits()=0
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
std::unique_ptr< lldb_private::Unwind > m_unwinder_up
It gets set in Thread::ShouldResume.
Definition: Thread.h:1248
int32_t break_id_t
Definition: lldb-types.h:88
WatchpointList & GetWatchpointList()
Definition: Target.h:694
lldb::StateType GetResumeState() const
Gets the USER resume state for this thread.
Definition: Thread.h:200
virtual unsigned GetRegisterIndexFromOffset(unsigned offset)=0
Determines the index in lldb&#39;s register file given a kernel byte offset.
This class is used by Watchpoint to manage a list of watchpoints,.
bool DisableHardwareWatchpoint(lldb_private::Watchpoint *wp)
Extends RegisterClass with a few virtual operations useful on POSIX.
void SetName(const char *name) override
void SignalDeliveredNotify(const ProcessMessage &message)
RegisterInfo interface to patch RegisterInfo structure for archs.
void SetState(lldb::StateType state)
Definition: Thread.cpp:587
const char * PrintKind() const
#define POSIX_LOG_THREAD
tid_collection m_step_tids
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:49
Represents the stop state of a process ready to exit.
Definition: POSIXStopInfo.h:31
An architecture specification class.
Definition: ArchSpec.h:32
virtual lldb::addr_t GetWatchpointAddress(uint32_t hw_index)=0
bool SingleStep(lldb::tid_t unused, uint32_t signo)
Single steps the process.
bool EnableHardwareWatchpoint(lldb_private::Watchpoint *wp)
void ExecNotify(const ProcessMessage &message)
lldb::addr_t GetHWAddress() const
Process or thread is stopped and can be examined.
lldb::RegisterContextSP m_reg_context_sp
The register context for this thread&#39;s current register state.
Definition: Thread.h:1220
uint32_t NumSupportedHardwareWatchpoints()
size_t GetSize() const
Returns the number of elements in this watchpoint list.
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:431
Manages communication with the inferior (debugee) process.
lldb::addr_t GetThreadPointer() override
Retrieves the per-thread data area.
virtual bool UpdateAfterBreakpoint()=0
Updates the register state of the associated thread after hitting a breakpoint (if that make sense fo...
const lldb::UnixSignalsSP & GetUnixSignals()
Definition: Process.cpp:3361
POSIXBreakpointProtocol * m_posix_thread
Definition: FreeBSDThread.h:89
lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame)
Definition: Unwind.h:55
lldb::StopInfoSP m_stop_info_sp
The private stop reason for this thread.
Definition: Thread.h:1210
virtual uint32_t NumSupportedHardwareWatchpoints()=0
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
#define LLDB_INVALID_INDEX32
Definition: lldb-defines.h:86
const lldb::WatchpointSP FindByAddress(lldb::addr_t addr) const
Returns a shared pointer to the watchpoint at address addr - const version.
virtual void WillResume(lldb::StateType resume_state) override
const char * GetRegisterName(unsigned reg)
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:57
void SetStopInfo(const lldb::StopInfoSP &stop_info_sp)
Definition: Thread.cpp:477
bool m_thread_name_valid
Definition: FreeBSDThread.h:87
virtual ~FreeBSDThread()
void SignalNotify(const ProcessMessage &message)
bool ReadThreadPointer(lldb::tid_t tid, lldb::addr_t &value)
Reads the value of the thread-specific pointer for a given thread ID.
Kind GetKind() const
ProcessMonitor & GetMonitor()
bool CalculateStopInfo() override
void LimboNotify(const ProcessMessage &message)
uint64_t tid_t
Definition: lldb-types.h:86
CrashReason GetCrashReason() const
POSIXBreakpointProtocol * GetPOSIXBreakpointProtocol()
Definition: FreeBSDThread.h:77
lldb::RegisterContextSP GetRegisterContext() override
A plug-in interface definition class for debugging a process.
Definition: Process.h:353
virtual void DestroyThread()
Definition: Thread.cpp:278
void BreakNotify(const ProcessMessage &message)
lldb::RegisterContextSP CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
Process or thread is in the process of stepping and can not be examined.
tid_collection m_suspend_tids
lldb::ProcessSP GetProcess() const
Definition: Thread.h:154
const char * GetRegisterNameFromOffset(unsigned offset)
void DidStop() override
std::string m_thread_name
Definition: FreeBSDThread.h:88
int GetResumeSignal() const
Definition: Thread.h:156
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid)
bool WatchpointWrite() const
Definition: Watchpoint.cpp:258
uint32_t FindVacantWatchpointIndex()
uint64_t addr_t
Definition: lldb-types.h:83
unsigned GetRegisterIndexFromOffset(unsigned offset)
virtual lldb::addr_t GetLoadAddress() const
lldb::addr_t GetFaultAddress() const
Definition: SBAddress.h:15
ProcessMonitor & GetMonitor()
const char * GetInfo() override
lldb::WatchpointSP GetByIndex(uint32_t i)
Returns a shared pointer to the watchpoint with index i.
std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info)
bool WatchpointRead() const
Definition: Watchpoint.cpp:256
virtual bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read, bool write, uint32_t hw_index)=0
virtual void TraceNotify(const ProcessMessage &message)
virtual bool IsWatchpointVacant(uint32_t hw_index)=0
bool Resume(lldb::tid_t unused, uint32_t signo)
Resumes the process.
const char * GetName() override
uint32_t GetConcreteFrameIndex() const
Query this frame to find what frame it is in this Thread&#39;s StackFrameList, not counting inlined frame...
Definition: StackFrame.h:389
void Printf(const char *format,...) __attribute__((format(printf
Definition: Log.cpp:113
#define LLDB_LOGV(log,...)
Definition: Log.h:216
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:726
tid_collection m_run_tids
void WatchNotify(const ProcessMessage &message)
This base class provides an interface to stack frames.
Definition: StackFrame.h:40
int GetSignal() const
Process or thread is running and can&#39;t be examined.
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:90