LLDB  mainline
FreeBSDThread.cpp
Go to the documentation of this file.
1 //===-- FreeBSDThread.cpp -------------------------------------------------===//
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 
17 #include "FreeBSDThread.h"
18 #include "POSIXStopInfo.h"
26 #include "ProcessFreeBSD.h"
27 #include "ProcessMonitor.h"
35 #include "lldb/Core/Debugger.h"
36 #include "lldb/Host/Host.h"
37 #include "lldb/Host/HostInfo.h"
39 #include "lldb/Target/Process.h"
40 #include "lldb/Target/StopInfo.h"
41 #include "lldb/Target/Target.h"
42 #include "lldb/Target/ThreadSpec.h"
44 #include "lldb/Target/Unwind.h"
45 #include "lldb/Utility/State.h"
46 #include "llvm/ADT/SmallString.h"
47 
48 using namespace lldb;
49 using namespace lldb_private;
50 
52  : Thread(process, tid), m_frame_up(), m_breakpoint(),
53  m_thread_name_valid(false), m_thread_name(), m_posix_thread(nullptr) {
55  LLDB_LOGV(log, "tid = {0}", tid);
56 
57  // Set the current watchpoints for this thread.
58  Target &target = GetProcess()->GetTarget();
59  const WatchpointList &wp_list = target.GetWatchpointList();
60  size_t wp_size = wp_list.GetSize();
61 
62  for (uint32_t wp_idx = 0; wp_idx < wp_size; wp_idx++) {
63  lldb::WatchpointSP wp = wp_list.GetByIndex(wp_idx);
64  if (wp.get() && wp->IsEnabled()) {
65  // This watchpoint as been enabled; obviously this "new" thread has been
66  // created since that watchpoint was enabled. Since the
67  // POSIXBreakpointProtocol has yet to be initialized, its
68  // m_watchpoints_initialized member will be FALSE. Attempting to read
69  // the debug status register to determine if a watchpoint has been hit
70  // would result in the zeroing of that register. Since the active debug
71  // registers would have been cloned when this thread was created, simply
72  // force the m_watchpoints_initized member to TRUE and avoid resetting
73  // dr6 and dr7.
75  }
76  }
77 }
78 
80 
82  ProcessSP base = GetProcess();
83  ProcessFreeBSD &process = static_cast<ProcessFreeBSD &>(*base);
84  return process.GetMonitor();
85 }
86 
88  // Invalidate all registers in our register context. We don't set "force" to
89  // true because the stop reply packet might have had some register values
90  // that were expedited and these will already be copied into the register
91  // context by the time this function gets called. The KDPRegisterContext
92  // class has been made smart enough to detect when it needs to invalidate
93  // which registers are valid by putting hooks in the register read and
94  // register supply functions where they check the process stop ID and do the
95  // right thing. if (StateIsStoppedState(GetState())
96  {
97  const bool force = false;
98  GetRegisterContext()->InvalidateIfNeeded(force);
99  }
100 }
101 
102 const char *FreeBSDThread::GetInfo() { return nullptr; }
103 
104 void FreeBSDThread::SetName(const char *name) {
105  m_thread_name_valid = (name && name[0]);
107  m_thread_name.assign(name);
108  else
109  m_thread_name.clear();
110 }
111 
112 const char *FreeBSDThread::GetName() {
113  if (!m_thread_name_valid) {
114  m_thread_name.clear();
115  int pid = GetProcess()->GetID();
116 
117  struct kinfo_proc *kp = nullptr, *nkp;
118  size_t len = 0;
119  int error;
120  int ctl[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID | KERN_PROC_INC_THREAD,
121  pid};
122 
123  while (1) {
124  error = sysctl(ctl, 4, kp, &len, nullptr, 0);
125  if (kp == nullptr || (error != 0 && errno == ENOMEM)) {
126  // Add extra space in case threads are added before next call.
127  len += sizeof(*kp) + len / 10;
128  nkp = (struct kinfo_proc *)realloc(kp, len);
129  if (nkp == nullptr) {
130  free(kp);
131  return nullptr;
132  }
133  kp = nkp;
134  continue;
135  }
136  if (error != 0)
137  len = 0;
138  break;
139  }
140 
141  for (size_t i = 0; i < len / sizeof(*kp); i++) {
142  if (kp[i].ki_tid == (lwpid_t)GetID()) {
143  m_thread_name.append(kp[i].ki_tdname,
144  kp[i].ki_tdname + strlen(kp[i].ki_tdname));
145  break;
146  }
147  }
148  free(kp);
149  m_thread_name_valid = true;
150  }
151 
152  if (m_thread_name.empty())
153  return nullptr;
154  return m_thread_name.c_str();
155 }
156 
157 lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {
158  if (!m_reg_context_sp) {
159  m_posix_thread = nullptr;
160 
161  RegisterInfoInterface *reg_interface = nullptr;
162  const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
163 
164  assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
165  switch (target_arch.GetMachine()) {
166  case llvm::Triple::aarch64:
167  reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
168  break;
169  case llvm::Triple::arm:
170  reg_interface = new RegisterInfoPOSIX_arm(target_arch);
171  break;
172  case llvm::Triple::ppc:
173 #ifndef __powerpc64__
174  reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
175  break;
176 #endif
177  case llvm::Triple::ppc64:
178  reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
179  break;
180  case llvm::Triple::mips64:
181  reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
182  break;
183  case llvm::Triple::x86:
184  reg_interface = new RegisterContextFreeBSD_i386(target_arch);
185  break;
186  case llvm::Triple::x86_64:
187  reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
188  break;
189  default:
190  llvm_unreachable("CPU not supported");
191  }
192 
193  switch (target_arch.GetMachine()) {
194  case llvm::Triple::aarch64: {
196  new RegisterContextPOSIXProcessMonitor_arm64(*this, 0, reg_interface);
197  m_posix_thread = reg_ctx;
198  m_reg_context_sp.reset(reg_ctx);
199  break;
200  }
201  case llvm::Triple::arm: {
203  new RegisterContextPOSIXProcessMonitor_arm(*this, 0, reg_interface);
204  m_posix_thread = reg_ctx;
205  m_reg_context_sp.reset(reg_ctx);
206  break;
207  }
208  case llvm::Triple::mips64: {
211  reg_interface);
212  m_posix_thread = reg_ctx;
213  m_reg_context_sp.reset(reg_ctx);
214  break;
215  }
216  case llvm::Triple::ppc:
217  case llvm::Triple::ppc64: {
220  reg_interface);
221  m_posix_thread = reg_ctx;
222  m_reg_context_sp.reset(reg_ctx);
223  break;
224  }
225  case llvm::Triple::x86:
226  case llvm::Triple::x86_64: {
229  reg_interface);
230  m_posix_thread = reg_ctx;
231  m_reg_context_sp.reset(reg_ctx);
232  break;
233  }
234  default:
235  break;
236  }
237  }
238  return m_reg_context_sp;
239 }
240 
241 lldb::RegisterContextSP
243  lldb::RegisterContextSP reg_ctx_sp;
244  uint32_t concrete_frame_idx = 0;
245 
247  LLDB_LOGV(log, "called");
248 
249  if (frame)
250  concrete_frame_idx = frame->GetConcreteFrameIndex();
251 
252  if (concrete_frame_idx == 0)
253  reg_ctx_sp = GetRegisterContext();
254  else {
255  reg_ctx_sp = GetUnwinder().CreateRegisterContextForFrame(frame);
256  }
257 
258  return reg_ctx_sp;
259 }
260 
262  ProcessMonitor &monitor = GetMonitor();
263  addr_t addr;
264  if (monitor.ReadThreadPointer(GetID(), addr))
265  return addr;
266  else
267  return LLDB_INVALID_ADDRESS;
268 }
269 
272  return true;
273 }
274 
276  // Don't set the thread state to stopped unless we really stopped.
277 }
278 
281  LLDB_LOGF(log, "tid %lu resume_state = %s", GetID(),
282  lldb_private::StateAsCString(resume_state));
283  ProcessSP process_sp(GetProcess());
284  ProcessFreeBSD *process = static_cast<ProcessFreeBSD *>(process_sp.get());
285  int signo = GetResumeSignal();
286  bool signo_valid = process->GetUnixSignals()->SignalIsValid(signo);
287 
288  switch (resume_state) {
289  case eStateSuspended:
290  case eStateStopped:
291  process->m_suspend_tids.push_back(GetID());
292  break;
293  case eStateRunning:
294  process->m_run_tids.push_back(GetID());
295  if (signo_valid)
296  process->m_resume_signo = signo;
297  break;
298  case eStateStepping:
299  process->m_step_tids.push_back(GetID());
300  if (signo_valid)
301  process->m_resume_signo = signo;
302  break;
303  default:
304  break;
305  }
306 }
307 
309  lldb::StateType resume_state = GetResumeState();
310  ProcessMonitor &monitor = GetMonitor();
311  bool status;
312 
314  LLDB_LOGF(log, "FreeBSDThread::%s (), resume_state = %s", __FUNCTION__,
315  StateAsCString(resume_state));
316 
317  switch (resume_state) {
318  default:
319  assert(false && "Unexpected state for resume!");
320  status = false;
321  break;
322 
323  case lldb::eStateRunning:
324  SetState(resume_state);
325  status = monitor.Resume(GetID(), GetResumeSignal());
326  break;
327 
329  SetState(resume_state);
330  status = monitor.SingleStep(GetID(), GetResumeSignal());
331  break;
332  case lldb::eStateStopped:
334  status = true;
335  break;
336  }
337 
338  return status;
339 }
340 
341 void FreeBSDThread::Notify(const ProcessMessage &message) {
343  LLDB_LOGF(log, "FreeBSDThread::%s () message kind = '%s' for tid %" PRIu64,
344  __FUNCTION__, message.PrintKind(), GetID());
345 
346  switch (message.GetKind()) {
347  default:
348  assert(false && "Unexpected message kind!");
349  break;
350 
352  // Nothing to be done.
353  break;
354 
356  LimboNotify(message);
357  break;
358 
361  SignalNotify(message);
362  break;
363 
365  SignalDeliveredNotify(message);
366  break;
367 
369  TraceNotify(message);
370  break;
371 
373  BreakNotify(message);
374  break;
375 
377  WatchNotify(message);
378  break;
379 
381  ExecNotify(message);
382  break;
383  }
384 }
385 
387  bool wp_set = false;
388  if (wp) {
389  addr_t wp_addr = wp->GetLoadAddress();
390  size_t wp_size = wp->GetByteSize();
391  bool wp_read = wp->WatchpointRead();
392  bool wp_write = wp->WatchpointWrite();
393  uint32_t wp_hw_index = wp->GetHardwareIndex();
395  if (reg_ctx)
396  wp_set = reg_ctx->SetHardwareWatchpointWithIndex(
397  wp_addr, wp_size, wp_read, wp_write, wp_hw_index);
398  }
399  return wp_set;
400 }
401 
403  bool result = false;
404  if (wp) {
405  lldb::RegisterContextSP reg_ctx_sp = GetRegisterContext();
406  if (reg_ctx_sp.get())
407  result = reg_ctx_sp->ClearHardwareWatchpoint(wp->GetHardwareIndex());
408  }
409  return result;
410 }
411 
413  lldb::RegisterContextSP reg_ctx_sp = GetRegisterContext();
414  if (reg_ctx_sp.get())
415  return reg_ctx_sp->NumSupportedHardwareWatchpoints();
416  return 0;
417 }
418 
420  uint32_t hw_index = LLDB_INVALID_INDEX32;
422  uint32_t wp_idx;
424  if (reg_ctx) {
425  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
426  if (reg_ctx->IsWatchpointVacant(wp_idx)) {
427  hw_index = wp_idx;
428  break;
429  }
430  }
431  }
432  return hw_index;
433 }
434 
436  bool status;
438 
439  assert(GetRegisterContext());
441  assert(status && "Breakpoint update failed!");
442 
443  // With our register state restored, resolve the breakpoint object
444  // corresponding to our current PC.
445  assert(GetRegisterContext());
446  lldb::addr_t pc = GetRegisterContext()->GetPC();
447  LLDB_LOGF(log, "FreeBSDThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc);
448  lldb::BreakpointSiteSP bp_site(
449  GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
450 
451  // If the breakpoint is for this thread, then we'll report the hit, but if it
452  // is for another thread, we create a stop reason with should_stop=false. If
453  // there is no breakpoint location, then report an invalid stop reason. We
454  // don't need to worry about stepping over the breakpoint here, that will be
455  // taken care of when the thread resumes and notices that there's a
456  // breakpoint under the pc.
457  if (bp_site) {
458  lldb::break_id_t bp_id = bp_site->GetID();
459  // If we have an operating system plug-in, we might have set a thread
460  // specific breakpoint using the operating system thread ID, so we can't
461  // make any assumptions about the thread ID so we must always report the
462  // breakpoint regardless of the thread.
463  if (bp_site->ValidForThisThread(this) ||
464  GetProcess()->GetOperatingSystem() != nullptr)
465  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id));
466  else {
467  const bool should_stop = false;
468  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id,
469  should_stop));
470  }
471  } else
472  SetStopInfo(StopInfoSP());
473 }
474 
477 
478  lldb::addr_t halt_addr = message.GetHWAddress();
479  LLDB_LOGF(log,
480  "FreeBSDThread::%s () Hardware Watchpoint Address = 0x%8.8" PRIx64,
481  __FUNCTION__, halt_addr);
482 
484  if (reg_ctx) {
485  uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
486  uint32_t wp_idx;
487  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
488  if (reg_ctx->IsWatchpointHit(wp_idx)) {
489  // Clear the watchpoint hit here
490  reg_ctx->ClearWatchpointHits();
491  break;
492  }
493  }
494 
495  if (wp_idx == num_hw_wps)
496  return;
497 
498  Target &target = GetProcess()->GetTarget();
499  lldb::addr_t wp_monitor_addr = reg_ctx->GetWatchpointAddress(wp_idx);
500  const WatchpointList &wp_list = target.GetWatchpointList();
501  lldb::WatchpointSP wp_sp = wp_list.FindByAddress(wp_monitor_addr);
502 
503  assert(wp_sp.get() && "No watchpoint found");
504  SetStopInfo(
505  StopInfo::CreateStopReasonWithWatchpointID(*this, wp_sp->GetID()));
506  }
507 }
508 
511 
512  // Try to resolve the breakpoint object corresponding to the current PC.
513  assert(GetRegisterContext());
514  lldb::addr_t pc = GetRegisterContext()->GetPC();
515  LLDB_LOGF(log, "FreeBSDThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc);
516  lldb::BreakpointSiteSP bp_site(
517  GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
518 
519  // If the current pc is a breakpoint site then set the StopInfo to
520  // Breakpoint. Otherwise, set the StopInfo to Watchpoint or Trace. If we have
521  // an operating system plug-in, we might have set a thread specific
522  // breakpoint using the operating system thread ID, so we can't make any
523  // assumptions about the thread ID so we must always report the breakpoint
524  // regardless of the thread.
525  if (bp_site && (bp_site->ValidForThisThread(this) ||
526  GetProcess()->GetOperatingSystem() != nullptr))
527  SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(
528  *this, bp_site->GetID()));
529  else {
531  if (reg_ctx) {
532  uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
533  uint32_t wp_idx;
534  for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) {
535  if (reg_ctx->IsWatchpointHit(wp_idx)) {
536  WatchNotify(message);
537  return;
538  }
539  }
540  }
541  SetStopInfo(StopInfo::CreateStopReasonToTrace(*this));
542  }
543 }
544 
546  SetStopInfo(lldb::StopInfoSP(new POSIXLimboStopInfo(*this)));
547 }
548 
550  int signo = message.GetSignal();
551  if (message.GetKind() == ProcessMessage::eCrashMessage) {
552  std::string stop_description = GetCrashReasonString(
553  message.GetCrashReason(), message.GetFaultAddress());
554  SetStopInfo(StopInfo::CreateStopReasonWithSignal(
555  *this, signo, stop_description.c_str()));
556  } else {
557  SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
558  }
559 }
560 
562  int signo = message.GetSignal();
563  SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
564 }
565 
566 unsigned FreeBSDThread::GetRegisterIndexFromOffset(unsigned offset) {
567  unsigned reg = LLDB_INVALID_REGNUM;
568  ArchSpec arch = HostInfo::GetArchitecture();
569 
570  switch (arch.GetMachine()) {
571  default:
572  llvm_unreachable("CPU type not supported!");
573  break;
574 
575  case llvm::Triple::aarch64:
576  case llvm::Triple::arm:
577  case llvm::Triple::mips64:
578  case llvm::Triple::ppc:
579  case llvm::Triple::ppc64:
580  case llvm::Triple::x86:
581  case llvm::Triple::x86_64: {
583  reg = reg_ctx->GetRegisterIndexFromOffset(offset);
584  } break;
585  }
586  return reg;
587 }
588 
590  SetStopInfo(StopInfo::CreateStopReasonWithExec(*this));
591 }
592 
593 const char *FreeBSDThread::GetRegisterName(unsigned reg) {
594  const char *name = nullptr;
595  ArchSpec arch = HostInfo::GetArchitecture();
596 
597  switch (arch.GetMachine()) {
598  default:
599  assert(false && "CPU type not supported!");
600  break;
601 
602  case llvm::Triple::aarch64:
603  case llvm::Triple::arm:
604  case llvm::Triple::mips64:
605  case llvm::Triple::ppc:
606  case llvm::Triple::ppc64:
607  case llvm::Triple::x86:
608  case llvm::Triple::x86_64:
609  name = GetRegisterContext()->GetRegisterName(reg);
610  break;
611  }
612  return name;
613 }
614 
615 const char *FreeBSDThread::GetRegisterNameFromOffset(unsigned offset) {
617 }
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
A class that represents a running process on the host machine.
int32_t break_id_t
Definition: lldb-types.h:88
WatchpointList & GetWatchpointList()
Definition: Target.h:695
lldb::StateType GetResumeState() const
Gets the USER resume state for this thread.
Definition: Thread.h:196
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:551
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:47
Represents the stop state of a process ready to exit.
Definition: POSIXStopInfo.h:31
An architecture specification class.
Definition: ArchSpec.h:33
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)
virtual Unwind & GetUnwinder()
Definition: Thread.cpp:1860
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:1228
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:434
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:3422
POSIXBreakpointProtocol * m_posix_thread
Definition: FreeBSDThread.h:89
lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame)
Definition: Unwind.h:56
lldb::StopInfoSP m_stop_info_sp
The private stop reason for this thread.
Definition: Thread.h:1218
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:58
void SetStopInfo(const lldb::StopInfoSP &stop_info_sp)
Definition: Thread.cpp:440
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
StateType
Process and Thread States.
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:362
virtual void DestroyThread()
Definition: Thread.cpp:254
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:152
const char * GetRegisterNameFromOffset(unsigned offset)
void DidStop() override
std::string m_thread_name
Definition: FreeBSDThread.h:88
int GetResumeSignal() const
Definition: Thread.h:154
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
#define LLDB_LOGF(log,...)
Definition: Log.h:249
FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid)
bool WatchpointWrite() const
Definition: Watchpoint.cpp:267
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:265
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
#define LLDB_LOGV(log,...)
Definition: Log.h:256
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:714
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