LLDB  mainline
NativeThreadLinux.cpp
Go to the documentation of this file.
1 //===-- NativeThreadLinux.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 "NativeThreadLinux.h"
10 
11 #include <signal.h>
12 #include <sstream>
13 
14 #include "NativeProcessLinux.h"
16 #include "SingleStepCheck.h"
17 
19 #include "lldb/Host/linux/Ptrace.h"
22 #include "lldb/Utility/Log.h"
23 #include "lldb/Utility/State.h"
24 #include "lldb/lldb-enumerations.h"
25 
26 #include "llvm/ADT/SmallString.h"
27 
29 
30 #include <sys/syscall.h>
31 // Try to define a macro to encapsulate the tgkill syscall
32 #define tgkill(pid, tid, sig) \
33  syscall(__NR_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), \
34  sig)
35 
36 using namespace lldb;
37 using namespace lldb_private;
38 using namespace lldb_private::process_linux;
39 
40 namespace {
41 void LogThreadStopInfo(Log &log, const ThreadStopInfo &stop_info,
42  const char *const header) {
43  switch (stop_info.reason) {
44  case eStopReasonNone:
45  log.Printf("%s: %s no stop reason", __FUNCTION__, header);
46  return;
47  case eStopReasonTrace:
48  log.Printf("%s: %s trace, stopping signal 0x%" PRIx32, __FUNCTION__, header,
49  stop_info.details.signal.signo);
50  return;
52  log.Printf("%s: %s breakpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
53  header, stop_info.details.signal.signo);
54  return;
56  log.Printf("%s: %s watchpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
57  header, stop_info.details.signal.signo);
58  return;
59  case eStopReasonSignal:
60  log.Printf("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header,
61  stop_info.details.signal.signo);
62  return;
64  log.Printf("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header,
65  stop_info.details.exception.type);
66  return;
67  case eStopReasonExec:
68  log.Printf("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header,
69  stop_info.details.signal.signo);
70  return;
72  log.Printf("%s: %s plan complete", __FUNCTION__, header);
73  return;
75  log.Printf("%s: %s thread exiting", __FUNCTION__, header);
76  return;
78  log.Printf("%s: %s instrumentation", __FUNCTION__, header);
79  return;
81  log.Printf("%s: %s processor trace", __FUNCTION__, header);
82  return;
83  default:
84  log.Printf("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header,
85  static_cast<uint32_t>(stop_info.reason));
86  }
87 }
88 }
89 
90 NativeThreadLinux::NativeThreadLinux(NativeProcessLinux &process,
91  lldb::tid_t tid)
92  : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid),
93  m_stop_info(),
94  m_reg_context_up(
95  NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
96  process.GetArchitecture(), *this)),
97  m_stop_description() {}
98 
100  NativeProcessLinux &process = GetProcess();
101 
102  auto BufferOrError = getProcFile(process.GetID(), GetID(), "comm");
103  if (!BufferOrError)
104  return "";
105  return std::string(BufferOrError.get()->getBuffer().rtrim('\n'));
106 }
107 
109 
111  std::string &description) {
113 
114  description.clear();
115 
116  switch (m_state) {
117  case eStateStopped:
118  case eStateCrashed:
119  case eStateExited:
120  case eStateSuspended:
121  case eStateUnloaded:
122  if (log)
123  LogThreadStopInfo(*log, m_stop_info, "m_stop_info in thread:");
124  stop_info = m_stop_info;
125  description = m_stop_description;
126  if (log)
127  LogThreadStopInfo(*log, stop_info, "returned stop_info:");
128 
129  return true;
130 
131  case eStateInvalid:
132  case eStateConnected:
133  case eStateAttaching:
134  case eStateLaunching:
135  case eStateRunning:
136  case eStateStepping:
137  case eStateDetached:
138  if (log) {
139  LLDB_LOGF(log,
140  "NativeThreadLinux::%s tid %" PRIu64
141  " in state %s cannot answer stop reason",
142  __FUNCTION__, GetID(), StateAsCString(m_state));
143  }
144  return false;
145  }
146  llvm_unreachable("unhandled StateType!");
147 }
148 
150  uint32_t watch_flags, bool hardware) {
151  if (!hardware)
152  return Status("not implemented");
153  if (m_state == eStateLaunching)
154  return Status();
155  Status error = RemoveWatchpoint(addr);
156  if (error.Fail())
157  return error;
158  uint32_t wp_index =
159  m_reg_context_up->SetHardwareWatchpoint(addr, size, watch_flags);
160  if (wp_index == LLDB_INVALID_INDEX32)
161  return Status("Setting hardware watchpoint failed.");
162  m_watchpoint_index_map.insert({addr, wp_index});
163  return Status();
164 }
165 
167  auto wp = m_watchpoint_index_map.find(addr);
168  if (wp == m_watchpoint_index_map.end())
169  return Status();
170  uint32_t wp_index = wp->second;
171  m_watchpoint_index_map.erase(wp);
172  if (m_reg_context_up->ClearHardwareWatchpoint(wp_index))
173  return Status();
174  return Status("Clearing hardware watchpoint failed.");
175 }
176 
178  size_t size) {
179  if (m_state == eStateLaunching)
180  return Status();
181 
183  if (error.Fail())
184  return error;
185 
186  uint32_t bp_index = m_reg_context_up->SetHardwareBreakpoint(addr, size);
187 
188  if (bp_index == LLDB_INVALID_INDEX32)
189  return Status("Setting hardware breakpoint failed.");
190 
191  m_hw_break_index_map.insert({addr, bp_index});
192  return Status();
193 }
194 
196  auto bp = m_hw_break_index_map.find(addr);
197  if (bp == m_hw_break_index_map.end())
198  return Status();
199 
200  uint32_t bp_index = bp->second;
201  if (m_reg_context_up->ClearHardwareBreakpoint(bp_index)) {
202  m_hw_break_index_map.erase(bp);
203  return Status();
204  }
205 
206  return Status("Clearing hardware breakpoint failed.");
207 }
208 
210  const StateType new_state = StateType::eStateRunning;
211  MaybeLogStateChange(new_state);
212  m_state = new_state;
213 
215  m_stop_description.clear();
216 
217  // If watchpoints have been set, but none on this thread, then this is a new
218  // thread. So set all existing watchpoints.
219  if (m_watchpoint_index_map.empty()) {
220  NativeProcessLinux &process = GetProcess();
221 
222  const auto &watchpoint_map = process.GetWatchpointMap();
223  m_reg_context_up->ClearAllHardwareWatchpoints();
224  for (const auto &pair : watchpoint_map) {
225  const auto &wp = pair.second;
226  SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags, wp.m_hardware);
227  }
228  }
229 
230  // Set all active hardware breakpoint on all threads.
231  if (m_hw_break_index_map.empty()) {
232  NativeProcessLinux &process = GetProcess();
233 
234  const auto &hw_breakpoint_map = process.GetHardwareBreakpointMap();
235  m_reg_context_up->ClearAllHardwareBreakpoints();
236  for (const auto &pair : hw_breakpoint_map) {
237  const auto &bp = pair.second;
238  SetHardwareBreakpoint(bp.m_addr, bp.m_size);
239  }
240  }
241 
242  intptr_t data = 0;
243 
244  if (signo != LLDB_INVALID_SIGNAL_NUMBER)
245  data = signo;
246 
247  return NativeProcessLinux::PtraceWrapper(PTRACE_CONT, GetID(), nullptr,
248  reinterpret_cast<void *>(data));
249 }
250 
252  const StateType new_state = StateType::eStateStepping;
253  MaybeLogStateChange(new_state);
254  m_state = new_state;
256 
257  if(!m_step_workaround) {
258  // If we already hava a workaround inplace, don't reset it. Otherwise, the
259  // destructor of the existing instance will run after the new instance has
260  // fetched the cpu mask, and the thread will end up with the wrong mask.
262  }
263 
264  intptr_t data = 0;
265  if (signo != LLDB_INVALID_SIGNAL_NUMBER)
266  data = signo;
267 
268  // If hardware single-stepping is not supported, we just do a continue. The
269  // breakpoint on the next instruction has been setup in
270  // NativeProcessLinux::Resume.
272  GetProcess().SupportHardwareSingleStepping() ? PTRACE_SINGLESTEP
273  : PTRACE_CONT,
274  m_tid, nullptr, reinterpret_cast<void *>(data));
275 }
276 
278  const siginfo_t *info) {
280  LLDB_LOGF(log, "NativeThreadLinux::%s called with signal 0x%02" PRIx32,
281  __FUNCTION__, signo);
282 
283  SetStopped();
284 
286  m_stop_info.details.signal.signo = signo;
287 
288  m_stop_description.clear();
289  if (info) {
290  switch (signo) {
291  case SIGSEGV:
292  case SIGBUS:
293  case SIGFPE:
294  case SIGILL:
295  // In case of MIPS64 target, SI_KERNEL is generated for invalid 64bit
296  // address.
297  const auto reason =
298  (info->si_signo == SIGBUS && info->si_code == SI_KERNEL)
300  : GetCrashReason(*info);
301  m_stop_description = GetCrashReasonString(reason, *info);
302  break;
303  }
304  }
305 }
306 
308  if (!StateIsStoppedState(m_state, false))
309  return false;
310 
311  // If we are stopped by a signal, return the signo.
312  if (signo && m_state == StateType::eStateStopped &&
314  *signo = m_stop_info.details.signal.signo;
315  }
316 
317  // Regardless, we are stopped.
318  return true;
319 }
320 
323  m_step_workaround.reset();
324 
325  // On every stop, clear any cached register data structures
327 
328  const StateType new_state = StateType::eStateStopped;
329  MaybeLogStateChange(new_state);
330  m_state = new_state;
331  m_stop_description.clear();
332 }
333 
336  LLDB_LOGF(log, "NativeThreadLinux::%s()", __FUNCTION__);
337 
338  SetStopped();
339 
342 }
343 
345  SetStopped();
346 
349  m_stop_description.clear();
350 }
351 
353  SetStopped();
354 
355  lldbassert(wp_index != LLDB_INVALID_INDEX32 && "wp_index cannot be invalid");
356 
357  std::ostringstream ostr;
358  ostr << m_reg_context_up->GetWatchpointAddress(wp_index) << " ";
359  ostr << wp_index;
360 
361  /*
362  * MIPS: Last 3bits of the watchpoint address are masked by the kernel. For
363  * example:
364  * 'n' is at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at
365  * 'm', then
366  * watch exception is generated even when 'n' is read/written. To handle this
367  * case,
368  * find the base address of the load/store instruction and append it in the
369  * stop-info
370  * packet.
371  */
372  ostr << " " << m_reg_context_up->GetWatchpointHitAddress(wp_index);
373 
374  m_stop_description = ostr.str();
375 
378 }
379 
381  return GetState() == StateType::eStateStopped &&
383 }
384 
386  return GetState() == StateType::eStateStopped &&
388 }
389 
391  SetStopped();
392 
395 }
396 
397 void NativeThreadLinux::SetStoppedByFork(bool is_vfork, lldb::pid_t child_pid) {
398  SetStopped();
399 
402  m_stop_info.details.fork.child_pid = child_pid;
403  m_stop_info.details.fork.child_tid = child_pid;
404 }
405 
407  SetStopped();
408 
410 }
411 
413  SetStopped();
414 
416  m_stop_info.details.signal.signo = 0;
417 }
418 
420  llvm::StringRef description) {
421  SetStopped();
422 
424  m_stop_info.details.signal.signo = 0;
425  m_stop_description = description.str();
426 }
427 
429  const StateType new_state = StateType::eStateExited;
430  MaybeLogStateChange(new_state);
431  m_state = new_state;
432 
434 }
435 
438 
439  NativeProcessLinux &process = GetProcess();
440 
441  lldb::pid_t pid = process.GetID();
442  lldb::tid_t tid = GetID();
443 
444  LLDB_LOGF(log,
445  "NativeThreadLinux::%s requesting thread stop(pid: %" PRIu64
446  ", tid: %" PRIu64 ")",
447  __FUNCTION__, pid, tid);
448 
449  Status err;
450  errno = 0;
451  if (::tgkill(pid, tid, SIGSTOP) != 0) {
452  err.SetErrorToErrno();
453  LLDB_LOGF(log,
454  "NativeThreadLinux::%s tgkill(%" PRIu64 ", %" PRIu64
455  ", SIGSTOP) failed: %s",
456  __FUNCTION__, pid, tid, err.AsCString());
457  }
458 
459  return err;
460 }
461 
464  // If we're not logging, we're done.
465  if (!log)
466  return;
467 
468  // If this is a state change to the same state, we're done.
469  lldb::StateType old_state = m_state;
470  if (new_state == old_state)
471  return;
472 
473  LLDB_LOG(log, "pid={0}, tid={1}: changing from state {2} to {3}",
474  m_process.GetID(), GetID(), old_state, new_state);
475 }
476 
478  return static_cast<NativeProcessLinux &>(m_process);
479 }
lldb_private::process_linux::NativeThreadLinux::SetStoppedByVForkDone
void SetStoppedByVForkDone()
Definition: NativeThreadLinux.cpp:406
lldb_private::process_linux::NativeThreadLinux::IsStopped
bool IsStopped(int *signo)
Return true if the thread is stopped.
Definition: NativeThreadLinux.cpp:307
lldb_private::process_linux::NativeProcessLinux::PtraceWrapper
static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr=nullptr, void *data=nullptr, size_t data_size=0, long *result=nullptr)
}
Definition: NativeProcessLinux.cpp:1838
lldb_private::NativeThreadProtocol
Definition: NativeThreadProtocol.h:20
lldb_private::process_linux::NativeThreadLinux::GetProcess
NativeProcessLinux & GetProcess()
Definition: NativeThreadLinux.cpp:477
lldb::eStopReasonVFork
@ eStopReasonVFork
Definition: lldb-enumerations.h:253
lldb_private::process_linux::NativeThreadLinux::Resume
Status Resume(uint32_t signo)
Resumes the thread.
Definition: NativeThreadLinux.cpp:209
lldb_private::process_linux::NativeRegisterContextLinux
Definition: NativeRegisterContextLinux.h:20
lldb_private::process_linux::NativeThreadLinux::SetStoppedByProcessorTrace
void SetStoppedByProcessorTrace(llvm::StringRef description)
Definition: NativeThreadLinux.cpp:419
lldb::eStateAttaching
@ eStateAttaching
Process is currently trying to attach.
Definition: lldb-enumerations.h:78
lldb_private::process_linux::NativeThreadLinux::m_stop_info
ThreadStopInfo m_stop_info
Definition: NativeThreadLinux.h:107
lldb_private::process_linux::NativeThreadLinux::m_watchpoint_index_map
WatchpointIndexMap m_watchpoint_index_map
Definition: NativeThreadLinux.h:111
lldb::eStopReasonThreadExiting
@ eStopReasonThreadExiting
Definition: lldb-enumerations.h:249
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
lldb_private::StateAsCString
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
lldb_private::process_linux::NativeThreadLinux::m_step_workaround
std::unique_ptr< SingleStepWorkaround > m_step_workaround
Definition: NativeThreadLinux.h:113
lldb::eStopReasonException
@ eStopReasonException
Definition: lldb-enumerations.h:246
lldb_private::ThreadStopInfo::details
union lldb_private::ThreadStopInfo::@13 details
lldb_private::process_linux::NativeThreadLinux::m_state
lldb::StateType m_state
Definition: NativeThreadLinux.h:106
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
NativeThreadLinux.h
SIGSTOP
#define SIGSTOP
Definition: windows/PosixApi.h:32
lldb::eStopReasonTrace
@ eStopReasonTrace
Definition: lldb-enumerations.h:242
lldb::eStateExited
@ eStateExited
Process has exited and can't be examined.
Definition: lldb-enumerations.h:90
lldb::eStateStopped
@ eStateStopped
Process or thread is stopped and can be examined.
Definition: lldb-enumerations.h:84
lldb_private::Log::Printf
void Printf(const char *format,...) __attribute__((format(printf
Prefer using LLDB_LOGF whenever possible.
Definition: Log.cpp:121
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
LLDB_INVALID_SIGNAL_NUMBER
#define LLDB_INVALID_SIGNAL_NUMBER
Definition: lldb-defines.h:95
lldb::eStateCrashed
@ eStateCrashed
Process or thread has crashed and can be examined.
Definition: lldb-enumerations.h:88
lldb_private::process_linux::NativeThreadLinux::SetStoppedByFork
void SetStoppedByFork(bool is_vfork, lldb::pid_t child_pid)
Definition: NativeThreadLinux.cpp:397
lldb::eStopReasonProcessorTrace
@ eStopReasonProcessorTrace
Definition: lldb-enumerations.h:251
LLDBAssert.h
lldb_private::StateIsStoppedState
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
Definition: State.cpp:89
lldb_private::process_linux::NativeThreadLinux::RemoveHardwareBreakpoint
Status RemoveHardwareBreakpoint(lldb::addr_t addr) override
Definition: NativeThreadLinux.cpp:195
lldb_private::process_linux::NativeThreadLinux::SetStoppedByExec
void SetStoppedByExec()
Definition: NativeThreadLinux.cpp:334
lldb_private::process_linux::NativeThreadLinux::GetName
std::string GetName() override
Definition: NativeThreadLinux.cpp:99
lldb_private::process_linux
Definition: IntelPTManager.h:24
Log.h
lldb::eStopReasonWatchpoint
@ eStopReasonWatchpoint
Definition: lldb-enumerations.h:244
lldb_private::process_linux::NativeThreadLinux::m_stop_description
std::string m_stop_description
Definition: NativeThreadLinux.h:109
lldb::eStopReasonNone
@ eStopReasonNone
Definition: lldb-enumerations.h:241
lldb::eStateConnected
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
Definition: lldb-enumerations.h:76
SIGTRAP
#define SIGTRAP
Definition: windows/PosixApi.h:30
lldb::eStateLaunching
@ eStateLaunching
Process is in the process of launching.
Definition: lldb-enumerations.h:79
lldb::eStopReasonInstrumentation
@ eStopReasonInstrumentation
Definition: lldb-enumerations.h:250
lldb_private::ThreadStopInfo::reason
lldb::StopReason reason
Definition: Debug.h:134
lldb_private::NativeProcessProtocol::GetID
lldb::pid_t GetID() const
Definition: NativeProcessProtocol.h:166
lldb_private::process_linux::NativeThreadLinux::SingleStep
Status SingleStep(uint32_t signo)
Single steps the thread.
Definition: NativeThreadLinux.cpp:251
lldb_private::process_linux::SingleStepWorkaround::Get
static std::unique_ptr< SingleStepWorkaround > Get(::pid_t tid)
Definition: SingleStepCheck.h:47
lldb-enumerations.h
lldb_private::process_linux::NativeThreadLinux::RemoveWatchpoint
Status RemoveWatchpoint(lldb::addr_t addr) override
Definition: NativeThreadLinux.cpp:166
CrashReason::eInvalidAddress
@ eInvalidAddress
lldb_private::process_linux::NativeProcessLinux
Definition: NativeProcessLinux.h:40
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
SingleStepCheck.h
lldb_private::process_linux::NativeThreadLinux::SetStopped
void SetStopped()
Definition: NativeThreadLinux.cpp:321
lldb_private::process_linux::NativeThreadLinux::GetState
lldb::StateType GetState() override
Definition: NativeThreadLinux.cpp:108
lldb::eStateDetached
@ eStateDetached
Process has been detached and can't be examined.
Definition: lldb-enumerations.h:89
lldb_private::ThreadStopInfo::exception
struct lldb_private::ThreadStopInfo::@13::@15 exception
lldb_private::process_linux::NativeThreadLinux::SetStoppedByTrace
void SetStoppedByTrace()
Definition: NativeThreadLinux.cpp:390
lldb_private::process_linux::NativeThreadLinux::MaybeLogStateChange
void MaybeLogStateChange(lldb::StateType new_state)
Definition: NativeThreadLinux.cpp:462
lldb_private::process_linux::NativeThreadLinux::IsStoppedAtBreakpoint
bool IsStoppedAtBreakpoint()
Definition: NativeThreadLinux.cpp:380
lldb_private::process_linux::NativeThreadLinux::SetWatchpoint
Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
Definition: NativeThreadLinux.cpp:149
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
lldb_private::getProcFile
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getProcFile(::pid_t pid, ::pid_t tid, const llvm::Twine &file)
Definition: Support.cpp:14
lldb_private::process_linux::NativeThreadLinux::RequestStop
Status RequestStop()
Definition: NativeThreadLinux.cpp:436
lldb_private::ThreadStopInfo::signal
struct lldb_private::ThreadStopInfo::@13::@14 signal
lldb_private::process_linux::NativeThreadLinux::SetHardwareBreakpoint
Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override
Definition: NativeThreadLinux.cpp:177
lldb_private::process_linux::NativeThreadLinux::m_hw_break_index_map
WatchpointIndexMap m_hw_break_index_map
Definition: NativeThreadLinux.h:112
tgkill
#define tgkill(pid, tid, sig)
Definition: NativeThreadLinux.cpp:32
lldb::eStateUnloaded
@ eStateUnloaded
Process is object is valid, but not currently loaded.
Definition: lldb-enumerations.h:75
lldb_private::process_linux::NativeThreadLinux::SetStoppedByBreakpoint
void SetStoppedByBreakpoint()
Definition: NativeThreadLinux.cpp:344
lldb_private::ThreadStopInfo
Definition: Debug.h:133
lldb_private::process_linux::NativeThreadLinux::SetExited
void SetExited()
Definition: NativeThreadLinux.cpp:428
lldb_private::process_linux::NativeThreadLinux::SetStoppedBySignal
void SetStoppedBySignal(uint32_t signo, const siginfo_t *info=nullptr)
Definition: NativeThreadLinux.cpp:277
lldb::eStateStepping
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
Definition: lldb-enumerations.h:86
lldbassert
#define lldbassert(x)
Definition: LLDBAssert.h:15
lldb::eStateSuspended
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
Definition: lldb-enumerations.h:91
lldb::eStopReasonSignal
@ eStopReasonSignal
Definition: lldb-enumerations.h:245
GetCrashReasonString
std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info)
Definition: CrashReason.cpp:144
lldb::eStopReasonExec
@ eStopReasonExec
Program was re-exec'ed.
Definition: lldb-enumerations.h:247
lldb_private::Status
Definition: Status.h:44
lldb_private::process_linux::NativeThreadLinux::SetStoppedByWatchpoint
void SetStoppedByWatchpoint(uint32_t wp_index)
Definition: NativeThreadLinux.cpp:352
uint32_t
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb::eStopReasonPlanComplete
@ eStopReasonPlanComplete
Definition: lldb-enumerations.h:248
Support.h
lldb_private::NativeThreadProtocol::GetID
lldb::tid_t GetID() const
Definition: NativeThreadProtocol.h:35
lldb_private::process_linux::NativeThreadLinux::m_reg_context_up
std::unique_ptr< NativeRegisterContextLinux > m_reg_context_up
Definition: NativeThreadLinux.h:108
Ptrace.h
lldb_private::process_linux::NativeThreadLinux::SetStoppedWithNoReason
void SetStoppedWithNoReason()
Definition: NativeThreadLinux.cpp:412
lldb::eStopReasonBreakpoint
@ eStopReasonBreakpoint
Definition: lldb-enumerations.h:243
lldb_private::Status::SetErrorToErrno
void SetErrorToErrno()
Set the current error to errno.
Definition: Status.cpp:224
lldb_private::NativeProcessProtocol::GetHardwareBreakpointMap
virtual const HardwareBreakpointMap & GetHardwareBreakpointMap() const
Definition: NativeProcessProtocol.cpp:217
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
lldb_private::ThreadStopInfo::fork
struct lldb_private::ThreadStopInfo::@13::@16 fork
NativeRegisterContextLinux.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::NativeThreadProtocol::m_process
NativeProcessProtocol & m_process
Definition: NativeThreadProtocol.h:51
NativeProcessLinux.h
lldb_private::NativeProcessProtocol::GetWatchpointMap
virtual const NativeWatchpointList::WatchpointMap & GetWatchpointMap() const
Definition: NativeProcessProtocol.cpp:112
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb_private::process_linux::NativeThreadLinux::GetRegisterContext
NativeRegisterContextLinux & GetRegisterContext() override
Definition: NativeThreadLinux.h:43
State.h
lldb_private::process_linux::NativeRegisterContextLinux::InvalidateAllRegisters
virtual void InvalidateAllRegisters()
Definition: NativeRegisterContextLinux.h:32
LLDB_INVALID_INDEX32
#define LLDB_INVALID_INDEX32
Definition: lldb-defines.h:86
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::Log
Definition: Log.h:49
HostNativeThread.h
lldb_private::process_linux::NativeThreadLinux::IsStoppedAtWatchpoint
bool IsStoppedAtWatchpoint()
Definition: NativeThreadLinux.cpp:385
lldb::eStopReasonVForkDone
@ eStopReasonVForkDone
Definition: lldb-enumerations.h:254
lldb_private::process_linux::NativeThreadLinux::GetStopReason
bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) override
Definition: NativeThreadLinux.cpp:110
lldb
Definition: SBAddress.h:15
LIBLLDB_LOG_THREAD
#define LIBLLDB_LOG_THREAD
Definition: Logging.h:16
lldb::eStateRunning
@ eStateRunning
Process or thread is running and can't be examined.
Definition: lldb-enumerations.h:85
lldb::eStopReasonFork
@ eStopReasonFork
Definition: lldb-enumerations.h:252
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
CrashReason.h
lldb_private::NativeThreadProtocol::m_tid
lldb::tid_t m_tid
Definition: NativeThreadProtocol.h:52
lldb_private::Status::AsCString
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition: Status.cpp:131
GetCrashReason
CrashReason GetCrashReason(const siginfo_t &info)
Definition: CrashReason.cpp:341