blob: 4ab2a9ae62454ac760e2637bb00d88e9449f40b7 [file] [log] [blame]
Todd Fialaaf245d12014-06-30 21:05:18 +00001//===-- NativeThreadLinux.cpp --------------------------------- -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "NativeThreadLinux.h"
11
12#include <signal.h>
Chaoren Lin18fe6402015-02-03 01:51:47 +000013#include <sstream>
Todd Fialaaf245d12014-06-30 21:05:18 +000014
15#include "NativeProcessLinux.h"
Pavel Labath0f4b17d2015-08-24 13:25:54 +000016#include "NativeRegisterContextLinux.h"
Pavel Labath605b51b2016-02-23 13:56:30 +000017#include "SingleStepCheck.h"
Todd Fiala2850b1b2014-06-30 23:51:35 +000018
Todd Fialaaf245d12014-06-30 21:05:18 +000019#include "lldb/Core/State.h"
Zachary Turner39de3112014-09-09 20:54:56 +000020#include "lldb/Host/HostNativeThread.h"
Pavel Labath605b51b2016-02-23 13:56:30 +000021#include "lldb/Host/linux/Ptrace.h"
Pavel Labath225b7952017-03-17 09:51:23 +000022#include "lldb/Host/linux/Support.h"
Chaoren Linc16f5dc2015-03-19 23:28:10 +000023#include "lldb/Utility/LLDBAssert.h"
Zachary Turner6f9e6902017-03-03 20:56:28 +000024#include "lldb/Utility/Log.h"
Todd Fialaaf245d12014-06-30 21:05:18 +000025#include "lldb/lldb-enumerations.h"
Zachary Turner39de3112014-09-09 20:54:56 +000026
27#include "llvm/ADT/SmallString.h"
28
Chaoren Lin28e57422015-02-03 01:51:25 +000029#include "Plugins/Process/POSIX/CrashReason.h"
30
Pavel Labath8c8ff7a2015-05-11 10:03:10 +000031#include <sys/syscall.h>
32// Try to define a macro to encapsulate the tgkill syscall
Kate Stoneb9c1b512016-09-06 20:57:50 +000033#define tgkill(pid, tid, sig) \
34 syscall(__NR_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), \
35 sig)
Pavel Labath8c8ff7a2015-05-11 10:03:10 +000036
Todd Fialaaf245d12014-06-30 21:05:18 +000037using namespace lldb;
38using namespace lldb_private;
Tamas Berghammerdb264a62015-03-31 09:52:22 +000039using namespace lldb_private::process_linux;
Todd Fialaaf245d12014-06-30 21:05:18 +000040
Kate Stoneb9c1b512016-09-06 20:57:50 +000041namespace {
42void LogThreadStopInfo(Log &log, const ThreadStopInfo &stop_info,
43 const char *const header) {
44 switch (stop_info.reason) {
45 case eStopReasonNone:
46 log.Printf("%s: %s no stop reason", __FUNCTION__, header);
47 return;
48 case eStopReasonTrace:
49 log.Printf("%s: %s trace, stopping signal 0x%" PRIx32, __FUNCTION__, header,
50 stop_info.details.signal.signo);
51 return;
52 case eStopReasonBreakpoint:
53 log.Printf("%s: %s breakpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
54 header, stop_info.details.signal.signo);
55 return;
56 case eStopReasonWatchpoint:
57 log.Printf("%s: %s watchpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
58 header, stop_info.details.signal.signo);
59 return;
60 case eStopReasonSignal:
61 log.Printf("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header,
62 stop_info.details.signal.signo);
63 return;
64 case eStopReasonException:
65 log.Printf("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header,
66 stop_info.details.exception.type);
67 return;
68 case eStopReasonExec:
69 log.Printf("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header,
70 stop_info.details.signal.signo);
71 return;
72 case eStopReasonPlanComplete:
73 log.Printf("%s: %s plan complete", __FUNCTION__, header);
74 return;
75 case eStopReasonThreadExiting:
76 log.Printf("%s: %s thread exiting", __FUNCTION__, header);
77 return;
78 case eStopReasonInstrumentation:
79 log.Printf("%s: %s instrumentation", __FUNCTION__, header);
80 return;
81 default:
82 log.Printf("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header,
83 static_cast<uint32_t>(stop_info.reason));
84 }
85}
Todd Fialaaf245d12014-06-30 21:05:18 +000086}
87
Pavel Labath82abefa2017-07-18 09:24:48 +000088NativeThreadLinux::NativeThreadLinux(NativeProcessLinux &process,
Kate Stoneb9c1b512016-09-06 20:57:50 +000089 lldb::tid_t tid)
90 : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid),
Pavel Labathd37349f2017-11-10 11:05:49 +000091 m_stop_info(),
92 m_reg_context_up(
93 NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
94 process.GetArchitecture(), *this)),
95 m_stop_description() {}
Kate Stoneb9c1b512016-09-06 20:57:50 +000096
97std::string NativeThreadLinux::GetName() {
Pavel Labath225b7952017-03-17 09:51:23 +000098 NativeProcessLinux &process = GetProcess();
Kate Stoneb9c1b512016-09-06 20:57:50 +000099
Pavel Labath225b7952017-03-17 09:51:23 +0000100 auto BufferOrError = getProcFile(process.GetID(), GetID(), "comm");
101 if (!BufferOrError)
102 return "";
103 return BufferOrError.get()->getBuffer().rtrim('\n');
Todd Fialaaf245d12014-06-30 21:05:18 +0000104}
105
Kate Stoneb9c1b512016-09-06 20:57:50 +0000106lldb::StateType NativeThreadLinux::GetState() { return m_state; }
Todd Fialaaf245d12014-06-30 21:05:18 +0000107
Kate Stoneb9c1b512016-09-06 20:57:50 +0000108bool NativeThreadLinux::GetStopReason(ThreadStopInfo &stop_info,
109 std::string &description) {
110 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
Todd Fialaaf245d12014-06-30 21:05:18 +0000111
Kate Stoneb9c1b512016-09-06 20:57:50 +0000112 description.clear();
Todd Fialaaf245d12014-06-30 21:05:18 +0000113
Kate Stoneb9c1b512016-09-06 20:57:50 +0000114 switch (m_state) {
115 case eStateStopped:
116 case eStateCrashed:
117 case eStateExited:
118 case eStateSuspended:
119 case eStateUnloaded:
Todd Fialaaf245d12014-06-30 21:05:18 +0000120 if (log)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000121 LogThreadStopInfo(*log, m_stop_info, "m_stop_info in thread:");
122 stop_info = m_stop_info;
123 description = m_stop_description;
124 if (log)
125 LogThreadStopInfo(*log, stop_info, "returned stop_info:");
Todd Fialaaf245d12014-06-30 21:05:18 +0000126
Todd Fiala511e5cd2014-09-11 23:29:14 +0000127 return true;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000128
129 case eStateInvalid:
130 case eStateConnected:
131 case eStateAttaching:
132 case eStateLaunching:
133 case eStateRunning:
134 case eStateStepping:
135 case eStateDetached:
136 if (log) {
137 log->Printf("NativeThreadLinux::%s tid %" PRIu64
138 " in state %s cannot answer stop reason",
139 __FUNCTION__, GetID(), StateAsCString(m_state));
140 }
141 return false;
142 }
143 llvm_unreachable("unhandled StateType!");
Todd Fiala511e5cd2014-09-11 23:29:14 +0000144}
145
Zachary Turner97206d52017-05-12 04:51:55 +0000146Status NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size,
147 uint32_t watch_flags, bool hardware) {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000148 if (!hardware)
Zachary Turner97206d52017-05-12 04:51:55 +0000149 return Status("not implemented");
Kate Stoneb9c1b512016-09-06 20:57:50 +0000150 if (m_state == eStateLaunching)
Zachary Turner97206d52017-05-12 04:51:55 +0000151 return Status();
152 Status error = RemoveWatchpoint(addr);
Kate Stoneb9c1b512016-09-06 20:57:50 +0000153 if (error.Fail())
154 return error;
Pavel Labathd37349f2017-11-10 11:05:49 +0000155 uint32_t wp_index =
156 m_reg_context_up->SetHardwareWatchpoint(addr, size, watch_flags);
Kate Stoneb9c1b512016-09-06 20:57:50 +0000157 if (wp_index == LLDB_INVALID_INDEX32)
Zachary Turner97206d52017-05-12 04:51:55 +0000158 return Status("Setting hardware watchpoint failed.");
Kate Stoneb9c1b512016-09-06 20:57:50 +0000159 m_watchpoint_index_map.insert({addr, wp_index});
Zachary Turner97206d52017-05-12 04:51:55 +0000160 return Status();
Todd Fialaa9882ce2014-08-28 15:46:54 +0000161}
162
Zachary Turner97206d52017-05-12 04:51:55 +0000163Status NativeThreadLinux::RemoveWatchpoint(lldb::addr_t addr) {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000164 auto wp = m_watchpoint_index_map.find(addr);
165 if (wp == m_watchpoint_index_map.end())
Zachary Turner97206d52017-05-12 04:51:55 +0000166 return Status();
Kate Stoneb9c1b512016-09-06 20:57:50 +0000167 uint32_t wp_index = wp->second;
168 m_watchpoint_index_map.erase(wp);
Pavel Labathd37349f2017-11-10 11:05:49 +0000169 if (m_reg_context_up->ClearHardwareWatchpoint(wp_index))
Zachary Turner97206d52017-05-12 04:51:55 +0000170 return Status();
171 return Status("Clearing hardware watchpoint failed.");
Chaoren Lin18fe6402015-02-03 01:51:47 +0000172}
173
Zachary Turner97206d52017-05-12 04:51:55 +0000174Status NativeThreadLinux::SetHardwareBreakpoint(lldb::addr_t addr,
175 size_t size) {
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000176 if (m_state == eStateLaunching)
Zachary Turner97206d52017-05-12 04:51:55 +0000177 return Status();
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000178
Zachary Turner97206d52017-05-12 04:51:55 +0000179 Status error = RemoveHardwareBreakpoint(addr);
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000180 if (error.Fail())
181 return error;
182
Pavel Labathd37349f2017-11-10 11:05:49 +0000183 uint32_t bp_index = m_reg_context_up->SetHardwareBreakpoint(addr, size);
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000184
185 if (bp_index == LLDB_INVALID_INDEX32)
Zachary Turner97206d52017-05-12 04:51:55 +0000186 return Status("Setting hardware breakpoint failed.");
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000187
188 m_hw_break_index_map.insert({addr, bp_index});
Zachary Turner97206d52017-05-12 04:51:55 +0000189 return Status();
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000190}
191
Zachary Turner97206d52017-05-12 04:51:55 +0000192Status NativeThreadLinux::RemoveHardwareBreakpoint(lldb::addr_t addr) {
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000193 auto bp = m_hw_break_index_map.find(addr);
194 if (bp == m_hw_break_index_map.end())
Zachary Turner97206d52017-05-12 04:51:55 +0000195 return Status();
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000196
197 uint32_t bp_index = bp->second;
Pavel Labathd37349f2017-11-10 11:05:49 +0000198 if (m_reg_context_up->ClearHardwareBreakpoint(bp_index)) {
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000199 m_hw_break_index_map.erase(bp);
Zachary Turner97206d52017-05-12 04:51:55 +0000200 return Status();
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000201 }
202
Zachary Turner97206d52017-05-12 04:51:55 +0000203 return Status("Clearing hardware breakpoint failed.");
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000204}
205
Zachary Turner97206d52017-05-12 04:51:55 +0000206Status NativeThreadLinux::Resume(uint32_t signo) {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000207 const StateType new_state = StateType::eStateRunning;
208 MaybeLogStateChange(new_state);
209 m_state = new_state;
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000210
Kate Stoneb9c1b512016-09-06 20:57:50 +0000211 m_stop_info.reason = StopReason::eStopReasonNone;
212 m_stop_description.clear();
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000213
Adrian Prantl05097242018-04-30 16:49:04 +0000214 // If watchpoints have been set, but none on this thread, then this is a new
215 // thread. So set all existing watchpoints.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000216 if (m_watchpoint_index_map.empty()) {
Pavel Labath605b51b2016-02-23 13:56:30 +0000217 NativeProcessLinux &process = GetProcess();
Pavel Labath8c8ff7a2015-05-11 10:03:10 +0000218
Kate Stoneb9c1b512016-09-06 20:57:50 +0000219 const auto &watchpoint_map = process.GetWatchpointMap();
Pavel Labathd37349f2017-11-10 11:05:49 +0000220 m_reg_context_up->ClearAllHardwareWatchpoints();
Kate Stoneb9c1b512016-09-06 20:57:50 +0000221 for (const auto &pair : watchpoint_map) {
222 const auto &wp = pair.second;
223 SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags, wp.m_hardware);
Pavel Labath8c8ff7a2015-05-11 10:03:10 +0000224 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000225 }
Pavel Labath8c8ff7a2015-05-11 10:03:10 +0000226
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000227 // Set all active hardware breakpoint on all threads.
228 if (m_hw_break_index_map.empty()) {
229 NativeProcessLinux &process = GetProcess();
230
231 const auto &hw_breakpoint_map = process.GetHardwareBreakpointMap();
Pavel Labathd37349f2017-11-10 11:05:49 +0000232 m_reg_context_up->ClearAllHardwareBreakpoints();
Omair Javaidd5ffbad2017-02-24 13:27:31 +0000233 for (const auto &pair : hw_breakpoint_map) {
234 const auto &bp = pair.second;
235 SetHardwareBreakpoint(bp.m_addr, bp.m_size);
236 }
237 }
238
Kate Stoneb9c1b512016-09-06 20:57:50 +0000239 intptr_t data = 0;
240
241 if (signo != LLDB_INVALID_SIGNAL_NUMBER)
242 data = signo;
243
244 return NativeProcessLinux::PtraceWrapper(PTRACE_CONT, GetID(), nullptr,
245 reinterpret_cast<void *>(data));
Pavel Labath8c8ff7a2015-05-11 10:03:10 +0000246}
247
Zachary Turner97206d52017-05-12 04:51:55 +0000248Status NativeThreadLinux::SingleStep(uint32_t signo) {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000249 const StateType new_state = StateType::eStateStepping;
250 MaybeLogStateChange(new_state);
251 m_state = new_state;
252 m_stop_info.reason = StopReason::eStopReasonNone;
Pavel Labatha37bbbd2017-02-17 11:48:34 +0000253
254 if(!m_step_workaround) {
255 // If we already hava a workaround inplace, don't reset it. Otherwise, the
256 // destructor of the existing instance will run after the new instance has
257 // fetched the cpu mask, and the thread will end up with the wrong mask.
258 m_step_workaround = SingleStepWorkaround::Get(m_tid);
259 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000260
261 intptr_t data = 0;
262 if (signo != LLDB_INVALID_SIGNAL_NUMBER)
263 data = signo;
264
265 // If hardware single-stepping is not supported, we just do a continue. The
Adrian Prantl05097242018-04-30 16:49:04 +0000266 // breakpoint on the next instruction has been setup in
267 // NativeProcessLinux::Resume.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000268 return NativeProcessLinux::PtraceWrapper(
269 GetProcess().SupportHardwareSingleStepping() ? PTRACE_SINGLESTEP
270 : PTRACE_CONT,
271 m_tid, nullptr, reinterpret_cast<void *>(data));
272}
273
274void NativeThreadLinux::SetStoppedBySignal(uint32_t signo,
275 const siginfo_t *info) {
276 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
277 if (log)
278 log->Printf("NativeThreadLinux::%s called with signal 0x%02" PRIx32,
279 __FUNCTION__, signo);
280
281 SetStopped();
282
283 m_stop_info.reason = StopReason::eStopReasonSignal;
284 m_stop_info.details.signal.signo = signo;
285
286 m_stop_description.clear();
287 if (info) {
288 switch (signo) {
289 case SIGSEGV:
290 case SIGBUS:
291 case SIGFPE:
292 case SIGILL:
293 // In case of MIPS64 target, SI_KERNEL is generated for invalid 64bit
294 // address.
295 const auto reason =
296 (info->si_signo == SIGBUS && info->si_code == SI_KERNEL)
297 ? CrashReason::eInvalidAddress
298 : GetCrashReason(*info);
Valentina Giusti6f8c1f82016-10-06 18:05:12 +0000299 m_stop_description = GetCrashReasonString(reason, *info);
Kate Stoneb9c1b512016-09-06 20:57:50 +0000300 break;
301 }
302 }
303}
304
305bool NativeThreadLinux::IsStopped(int *signo) {
306 if (!StateIsStoppedState(m_state, false))
307 return false;
308
309 // If we are stopped by a signal, return the signo.
310 if (signo && m_state == StateType::eStateStopped &&
311 m_stop_info.reason == StopReason::eStopReasonSignal) {
312 *signo = m_stop_info.details.signal.signo;
313 }
314
315 // Regardless, we are stopped.
316 return true;
317}
318
319void NativeThreadLinux::SetStopped() {
320 if (m_state == StateType::eStateStepping)
Pavel Labath8abd34f2017-01-25 11:19:45 +0000321 m_step_workaround.reset();
Kate Stoneb9c1b512016-09-06 20:57:50 +0000322
323 const StateType new_state = StateType::eStateStopped;
324 MaybeLogStateChange(new_state);
325 m_state = new_state;
326 m_stop_description.clear();
327}
328
329void NativeThreadLinux::SetStoppedByExec() {
330 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
331 if (log)
332 log->Printf("NativeThreadLinux::%s()", __FUNCTION__);
333
334 SetStopped();
335
336 m_stop_info.reason = StopReason::eStopReasonExec;
337 m_stop_info.details.signal.signo = SIGSTOP;
338}
339
340void NativeThreadLinux::SetStoppedByBreakpoint() {
341 SetStopped();
342
343 m_stop_info.reason = StopReason::eStopReasonBreakpoint;
344 m_stop_info.details.signal.signo = SIGTRAP;
345 m_stop_description.clear();
346}
347
348void NativeThreadLinux::SetStoppedByWatchpoint(uint32_t wp_index) {
349 SetStopped();
350
351 lldbassert(wp_index != LLDB_INVALID_INDEX32 && "wp_index cannot be invalid");
352
353 std::ostringstream ostr;
Pavel Labathd37349f2017-11-10 11:05:49 +0000354 ostr << m_reg_context_up->GetWatchpointAddress(wp_index) << " ";
Kate Stoneb9c1b512016-09-06 20:57:50 +0000355 ostr << wp_index;
356
357 /*
358 * MIPS: Last 3bits of the watchpoint address are masked by the kernel. For
359 * example:
360 * 'n' is at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at
361 * 'm', then
362 * watch exception is generated even when 'n' is read/written. To handle this
363 * case,
364 * find the base address of the load/store instruction and append it in the
365 * stop-info
366 * packet.
367 */
Pavel Labathd37349f2017-11-10 11:05:49 +0000368 ostr << " " << m_reg_context_up->GetWatchpointHitAddress(wp_index);
Kate Stoneb9c1b512016-09-06 20:57:50 +0000369
370 m_stop_description = ostr.str();
371
372 m_stop_info.reason = StopReason::eStopReasonWatchpoint;
373 m_stop_info.details.signal.signo = SIGTRAP;
374}
375
376bool NativeThreadLinux::IsStoppedAtBreakpoint() {
377 return GetState() == StateType::eStateStopped &&
378 m_stop_info.reason == StopReason::eStopReasonBreakpoint;
379}
380
381bool NativeThreadLinux::IsStoppedAtWatchpoint() {
382 return GetState() == StateType::eStateStopped &&
383 m_stop_info.reason == StopReason::eStopReasonWatchpoint;
384}
385
386void NativeThreadLinux::SetStoppedByTrace() {
387 SetStopped();
388
389 m_stop_info.reason = StopReason::eStopReasonTrace;
390 m_stop_info.details.signal.signo = SIGTRAP;
391}
392
393void NativeThreadLinux::SetStoppedWithNoReason() {
394 SetStopped();
395
396 m_stop_info.reason = StopReason::eStopReasonNone;
397 m_stop_info.details.signal.signo = 0;
398}
399
400void NativeThreadLinux::SetExited() {
401 const StateType new_state = StateType::eStateExited;
402 MaybeLogStateChange(new_state);
403 m_state = new_state;
404
405 m_stop_info.reason = StopReason::eStopReasonThreadExiting;
406}
407
Zachary Turner97206d52017-05-12 04:51:55 +0000408Status NativeThreadLinux::RequestStop() {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000409 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
410
411 NativeProcessLinux &process = GetProcess();
412
413 lldb::pid_t pid = process.GetID();
414 lldb::tid_t tid = GetID();
415
416 if (log)
417 log->Printf("NativeThreadLinux::%s requesting thread stop(pid: %" PRIu64
418 ", tid: %" PRIu64 ")",
419 __FUNCTION__, pid, tid);
420
Zachary Turner97206d52017-05-12 04:51:55 +0000421 Status err;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000422 errno = 0;
423 if (::tgkill(pid, tid, SIGSTOP) != 0) {
424 err.SetErrorToErrno();
425 if (log)
426 log->Printf("NativeThreadLinux::%s tgkill(%" PRIu64 ", %" PRIu64
427 ", SIGSTOP) failed: %s",
428 __FUNCTION__, pid, tid, err.AsCString());
429 }
430
431 return err;
432}
433
434void NativeThreadLinux::MaybeLogStateChange(lldb::StateType new_state) {
435 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
436 // If we're not logging, we're done.
437 if (!log)
438 return;
439
440 // If this is a state change to the same state, we're done.
441 lldb::StateType old_state = m_state;
442 if (new_state == old_state)
443 return;
444
Pavel Labath82abefa2017-07-18 09:24:48 +0000445 LLDB_LOG(log, "pid={0}, tid={1}: changing from state {2} to {3}",
446 m_process.GetID(), GetID(), old_state, new_state);
Kate Stoneb9c1b512016-09-06 20:57:50 +0000447}
448
449NativeProcessLinux &NativeThreadLinux::GetProcess() {
Pavel Labath82abefa2017-07-18 09:24:48 +0000450 return static_cast<NativeProcessLinux &>(m_process);
Pavel Labath605b51b2016-02-23 13:56:30 +0000451}