blob: 148f55f80333b2eb2c68973d763d99cf9b075a1c [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"
Tamas Berghammer1e209fc2015-03-13 11:36:47 +000016#include "NativeRegisterContextLinux_arm64.h"
Todd Fiala2850b1b2014-06-30 23:51:35 +000017#include "NativeRegisterContextLinux_x86_64.h"
Mohit K. Bhakkad3df471c2015-03-17 11:43:56 +000018#include "NativeRegisterContextLinux_mips64.h"
Todd Fiala2850b1b2014-06-30 23:51:35 +000019
Todd Fialaaf245d12014-06-30 21:05:18 +000020#include "lldb/Core/Log.h"
21#include "lldb/Core/State.h"
22#include "lldb/Host/Host.h"
Zachary Turner13b18262014-08-20 16:42:51 +000023#include "lldb/Host/HostInfo.h"
Zachary Turner39de3112014-09-09 20:54:56 +000024#include "lldb/Host/HostNativeThread.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
Todd Fialab71e89e2014-08-29 16:01:35 +000031#include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
Todd Fialaaf245d12014-06-30 21:05:18 +000032#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
33#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
Mohit K. Bhakkad3df471c2015-03-17 11:43:56 +000034#include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
Todd Fialaaf245d12014-06-30 21:05:18 +000035#include "Plugins/Process/Utility/RegisterInfoInterface.h"
36
37using namespace lldb;
38using namespace lldb_private;
39
40namespace
41{
42 void LogThreadStopInfo (Log &log, const ThreadStopInfo &stop_info, const char *const header)
43 {
44 switch (stop_info.reason)
45 {
46 case eStopReasonSignal:
Chaoren Linae29d392015-02-03 01:50:46 +000047 log.Printf ("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo);
Todd Fialaaf245d12014-06-30 21:05:18 +000048 return;
49 case eStopReasonException:
Chaoren Linae29d392015-02-03 01:50:46 +000050 log.Printf ("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header, stop_info.details.exception.type);
Todd Fialaa9882ce2014-08-28 15:46:54 +000051 return;
52 case eStopReasonExec:
53 log.Printf ("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo);
Todd Fialaaf245d12014-06-30 21:05:18 +000054 return;
55 default:
Todd Fialaa9882ce2014-08-28 15:46:54 +000056 log.Printf ("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header, static_cast<uint32_t> (stop_info.reason));
Todd Fialaaf245d12014-06-30 21:05:18 +000057 }
58 }
59}
60
61NativeThreadLinux::NativeThreadLinux (NativeProcessLinux *process, lldb::tid_t tid) :
62 NativeThreadProtocol (process, tid),
63 m_state (StateType::eStateInvalid),
64 m_stop_info (),
Chaoren Lin28e57422015-02-03 01:51:25 +000065 m_reg_context_sp (),
66 m_stop_description ()
Todd Fialaaf245d12014-06-30 21:05:18 +000067{
68}
69
Todd Fiala7206c6d2014-09-12 22:51:49 +000070std::string
Todd Fialaaf245d12014-06-30 21:05:18 +000071NativeThreadLinux::GetName()
72{
73 NativeProcessProtocolSP process_sp = m_process_wp.lock ();
74 if (!process_sp)
75 return "<unknown: no process>";
76
77 // const NativeProcessLinux *const process = reinterpret_cast<NativeProcessLinux*> (process_sp->get ());
Zachary Turner39de3112014-09-09 20:54:56 +000078 llvm::SmallString<32> thread_name;
79 HostNativeThread::GetName(GetID(), thread_name);
80 return thread_name.c_str();
Todd Fialaaf245d12014-06-30 21:05:18 +000081}
82
83lldb::StateType
84NativeThreadLinux::GetState ()
85{
86 return m_state;
87}
88
89
90bool
Chaoren Lin28e57422015-02-03 01:51:25 +000091NativeThreadLinux::GetStopReason (ThreadStopInfo &stop_info, std::string& description)
Todd Fialaaf245d12014-06-30 21:05:18 +000092{
93 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
Chaoren Lin28e57422015-02-03 01:51:25 +000094
95 description.clear();
96
Todd Fialaaf245d12014-06-30 21:05:18 +000097 switch (m_state)
98 {
99 case eStateStopped:
100 case eStateCrashed:
101 case eStateExited:
102 case eStateSuspended:
103 case eStateUnloaded:
104 if (log)
Todd Fialaa9882ce2014-08-28 15:46:54 +0000105 LogThreadStopInfo (*log, m_stop_info, "m_stop_info in thread:");
Todd Fialaaf245d12014-06-30 21:05:18 +0000106 stop_info = m_stop_info;
Chaoren Lin18fe6402015-02-03 01:51:47 +0000107 switch (m_stop_info.reason)
108 {
109 case StopReason::eStopReasonException:
110 case StopReason::eStopReasonBreakpoint:
111 case StopReason::eStopReasonWatchpoint:
112 description = m_stop_description;
113 default:
114 break;
115 }
Todd Fialaaf245d12014-06-30 21:05:18 +0000116 if (log)
Todd Fialaa9882ce2014-08-28 15:46:54 +0000117 LogThreadStopInfo (*log, stop_info, "returned stop_info:");
Chaoren Lin28e57422015-02-03 01:51:25 +0000118
Todd Fialaaf245d12014-06-30 21:05:18 +0000119 return true;
120
121 case eStateInvalid:
122 case eStateConnected:
123 case eStateAttaching:
124 case eStateLaunching:
125 case eStateRunning:
126 case eStateStepping:
127 case eStateDetached:
Todd Fialaaf245d12014-06-30 21:05:18 +0000128 if (log)
129 {
130 log->Printf ("NativeThreadLinux::%s tid %" PRIu64 " in state %s cannot answer stop reason",
131 __FUNCTION__, GetID (), StateAsCString (m_state));
132 }
133 return false;
134 }
David Majnemer8faf9372014-09-16 06:34:29 +0000135 llvm_unreachable("unhandled StateType!");
Todd Fialaaf245d12014-06-30 21:05:18 +0000136}
137
138lldb_private::NativeRegisterContextSP
139NativeThreadLinux::GetRegisterContext ()
140{
141 // Return the register context if we already created it.
142 if (m_reg_context_sp)
143 return m_reg_context_sp;
144
145 // First select the appropriate RegisterInfoInterface.
146 RegisterInfoInterface *reg_interface = nullptr;
147 NativeProcessProtocolSP m_process_sp = m_process_wp.lock ();
148 if (!m_process_sp)
149 return NativeRegisterContextSP ();
150
151 ArchSpec target_arch;
152 if (!m_process_sp->GetArchitecture (target_arch))
153 return NativeRegisterContextSP ();
154
155 switch (target_arch.GetTriple().getOS())
156 {
157 case llvm::Triple::Linux:
158 switch (target_arch.GetMachine())
159 {
Todd Fialab71e89e2014-08-29 16:01:35 +0000160 case llvm::Triple::aarch64:
161 assert((HostInfo::GetArchitecture ().GetAddressByteSize() == 8) && "Register setting path assumes this is a 64-bit host");
162 reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_arm64(target_arch));
163 break;
Todd Fialaaf245d12014-06-30 21:05:18 +0000164 case llvm::Triple::x86:
165 case llvm::Triple::x86_64:
Zachary Turner13b18262014-08-20 16:42:51 +0000166 if (HostInfo::GetArchitecture().GetAddressByteSize() == 4)
Todd Fialaaf245d12014-06-30 21:05:18 +0000167 {
168 // 32-bit hosts run with a RegisterContextLinux_i386 context.
169 reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_i386(target_arch));
170 }
171 else
172 {
Zachary Turner13b18262014-08-20 16:42:51 +0000173 assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
174 "Register setting path assumes this is a 64-bit host");
Todd Fialaaf245d12014-06-30 21:05:18 +0000175 // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the x86_64 register context.
176 reg_interface = static_cast<RegisterInfoInterface*> (new RegisterContextLinux_x86_64 (target_arch));
177 }
178 break;
Mohit K. Bhakkad3df471c2015-03-17 11:43:56 +0000179 case llvm::Triple::mips64:
180 case llvm::Triple::mips64el:
181 assert((HostInfo::GetArchitecture ().GetAddressByteSize() == 8)
182 && "Register setting path assumes this is a 64-bit host");
183 reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_mips64 (target_arch));
184 break;
Todd Fialaaf245d12014-06-30 21:05:18 +0000185 default:
186 break;
187 }
188 break;
189 default:
190 break;
191 }
192
193 assert(reg_interface && "OS or CPU not supported!");
194 if (!reg_interface)
195 return NativeRegisterContextSP ();
196
197 // Now create the register context.
198 switch (target_arch.GetMachine())
199 {
200#if 0
201 case llvm::Triple::mips64:
202 {
203 RegisterContextPOSIXProcessMonitor_mips64 *reg_ctx = new RegisterContextPOSIXProcessMonitor_mips64(*this, 0, reg_interface);
204 m_posix_thread = reg_ctx;
205 m_reg_context_sp.reset(reg_ctx);
206 break;
207 }
208#endif
Mohit K. Bhakkad3df471c2015-03-17 11:43:56 +0000209 case llvm::Triple::mips64:
210 case llvm::Triple::mips64el:
211 {
212 const uint32_t concrete_frame_idx = 0;
213 m_reg_context_sp.reset (new NativeRegisterContextLinux_mips64 (*this, concrete_frame_idx, reg_interface));
214 break;
215 }
Tamas Berghammer1e209fc2015-03-13 11:36:47 +0000216 case llvm::Triple::aarch64:
217 {
218 const uint32_t concrete_frame_idx = 0;
219 m_reg_context_sp.reset (new NativeRegisterContextLinux_arm64(*this, concrete_frame_idx, reg_interface));
220 break;
221 }
Todd Fialaaf245d12014-06-30 21:05:18 +0000222 case llvm::Triple::x86:
Todd Fialaaf245d12014-06-30 21:05:18 +0000223 case llvm::Triple::x86_64:
224 {
225 const uint32_t concrete_frame_idx = 0;
226 m_reg_context_sp.reset (new NativeRegisterContextLinux_x86_64(*this, concrete_frame_idx, reg_interface));
227 break;
228 }
229 default:
230 break;
231 }
232
233 return m_reg_context_sp;
234}
235
236Error
237NativeThreadLinux::SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware)
238{
Chaoren Lin18fe6402015-02-03 01:51:47 +0000239 if (!hardware)
240 return Error ("not implemented");
Chaoren Linf591f692015-02-26 19:48:15 +0000241 if (m_state == eStateLaunching)
242 return Error ();
Chaoren Lin18fe6402015-02-03 01:51:47 +0000243 Error error = RemoveWatchpoint(addr);
244 if (error.Fail()) return error;
245 NativeRegisterContextSP reg_ctx = GetRegisterContext ();
246 uint32_t wp_index =
247 reg_ctx->SetHardwareWatchpoint (addr, size, watch_flags);
248 if (wp_index == LLDB_INVALID_INDEX32)
249 return Error ("Setting hardware watchpoint failed.");
250 m_watchpoint_index_map.insert({addr, wp_index});
251 return Error ();
Todd Fialaaf245d12014-06-30 21:05:18 +0000252}
253
254Error
255NativeThreadLinux::RemoveWatchpoint (lldb::addr_t addr)
256{
Chaoren Lin18fe6402015-02-03 01:51:47 +0000257 auto wp = m_watchpoint_index_map.find(addr);
258 if (wp == m_watchpoint_index_map.end())
259 return Error ();
260 uint32_t wp_index = wp->second;
261 m_watchpoint_index_map.erase(wp);
262 if (GetRegisterContext()->ClearHardwareWatchpoint(wp_index))
263 return Error ();
264 return Error ("Clearing hardware watchpoint failed.");
Todd Fialaaf245d12014-06-30 21:05:18 +0000265}
266
267void
268NativeThreadLinux::SetLaunching ()
269{
270 const StateType new_state = StateType::eStateLaunching;
271 MaybeLogStateChange (new_state);
272 m_state = new_state;
273
274 // Also mark it as stopped since launching temporarily stops the newly created thread
275 // in the ptrace machinery.
276 m_stop_info.reason = StopReason::eStopReasonSignal;
277 m_stop_info.details.signal.signo = SIGSTOP;
278}
279
280
281void
282NativeThreadLinux::SetRunning ()
283{
284 const StateType new_state = StateType::eStateRunning;
285 MaybeLogStateChange (new_state);
286 m_state = new_state;
287
288 m_stop_info.reason = StopReason::eStopReasonNone;
Chaoren Lin28e57422015-02-03 01:51:25 +0000289 m_stop_description.clear();
Chaoren Lin18fe6402015-02-03 01:51:47 +0000290
291 // If watchpoints have been set, but none on this thread,
292 // then this is a new thread. So set all existing watchpoints.
293 if (m_watchpoint_index_map.empty())
294 {
Oleksiy Vyalov8bc34f42015-02-19 17:58:04 +0000295 const auto process_sp = GetProcess();
296 if (process_sp)
Chaoren Lin18fe6402015-02-03 01:51:47 +0000297 {
Oleksiy Vyalov8bc34f42015-02-19 17:58:04 +0000298 const auto &watchpoint_map = process_sp->GetWatchpointMap();
299 if (watchpoint_map.empty()) return;
300 GetRegisterContext()->ClearAllHardwareWatchpoints();
301 for (const auto &pair : watchpoint_map)
302 {
303 const auto& wp = pair.second;
304 SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags, wp.m_hardware);
305 }
Chaoren Lin18fe6402015-02-03 01:51:47 +0000306 }
307 }
Todd Fialaaf245d12014-06-30 21:05:18 +0000308}
309
310void
311NativeThreadLinux::SetStepping ()
312{
313 const StateType new_state = StateType::eStateStepping;
314 MaybeLogStateChange (new_state);
315 m_state = new_state;
316
317 m_stop_info.reason = StopReason::eStopReasonNone;
318}
319
320void
321NativeThreadLinux::SetStoppedBySignal (uint32_t signo)
322{
323 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
324 if (log)
Chaoren Linb8af31d2015-02-03 01:50:51 +0000325 log->Printf ("NativeThreadLinux::%s called with signal 0x%02" PRIx32, __FUNCTION__, signo);
Todd Fialaaf245d12014-06-30 21:05:18 +0000326
327 const StateType new_state = StateType::eStateStopped;
328 MaybeLogStateChange (new_state);
329 m_state = new_state;
330
331 m_stop_info.reason = StopReason::eStopReasonSignal;
332 m_stop_info.details.signal.signo = signo;
333}
334
Todd Fiala511e5cd2014-09-11 23:29:14 +0000335bool
336NativeThreadLinux::IsStopped (int *signo)
337{
338 if (!StateIsStoppedState (m_state, false))
339 return false;
340
341 // If we are stopped by a signal, return the signo.
342 if (signo &&
343 m_state == StateType::eStateStopped &&
344 m_stop_info.reason == StopReason::eStopReasonSignal)
345 {
346 *signo = m_stop_info.details.signal.signo;
347 }
348
349 // Regardless, we are stopped.
350 return true;
351}
352
353
Todd Fialaaf245d12014-06-30 21:05:18 +0000354void
Todd Fialaa9882ce2014-08-28 15:46:54 +0000355NativeThreadLinux::SetStoppedByExec ()
356{
357 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
358 if (log)
359 log->Printf ("NativeThreadLinux::%s()", __FUNCTION__);
360
361 const StateType new_state = StateType::eStateStopped;
362 MaybeLogStateChange (new_state);
363 m_state = new_state;
364
365 m_stop_info.reason = StopReason::eStopReasonExec;
366 m_stop_info.details.signal.signo = SIGSTOP;
367}
368
369void
Todd Fialaaf245d12014-06-30 21:05:18 +0000370NativeThreadLinux::SetStoppedByBreakpoint ()
371{
372 const StateType new_state = StateType::eStateStopped;
373 MaybeLogStateChange (new_state);
374 m_state = new_state;
375
Chaoren Lin28e57422015-02-03 01:51:25 +0000376 m_stop_info.reason = StopReason::eStopReasonBreakpoint;
Todd Fialaaf245d12014-06-30 21:05:18 +0000377 m_stop_info.details.signal.signo = SIGTRAP;
Chaoren Lin18fe6402015-02-03 01:51:47 +0000378 m_stop_description.clear();
379}
380
381void
382NativeThreadLinux::SetStoppedByWatchpoint ()
383{
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000384 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
385 lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
386 if (log)
387 {
388 NativeProcessProtocolSP process_sp = m_process_wp.lock ();
389 if (process_sp)
390 pid = process_sp->GetID ();
391 }
392
Chaoren Lin18fe6402015-02-03 01:51:47 +0000393 const StateType new_state = StateType::eStateStopped;
394 MaybeLogStateChange (new_state);
395 m_state = new_state;
396
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000397 NativeRegisterContextSP reg_ctx = GetRegisterContext ();
398 const uint32_t num_hw_watchpoints = reg_ctx->NumSupportedHardwareWatchpoints ();
Chaoren Lin18fe6402015-02-03 01:51:47 +0000399
400 m_stop_description.clear ();
401 for (uint32_t wp_index = 0; wp_index < num_hw_watchpoints; ++wp_index)
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000402 {
403 if (reg_ctx->IsWatchpointHit (wp_index).Success())
Chaoren Lin18fe6402015-02-03 01:51:47 +0000404 {
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000405 if (log)
406 log->Printf ("NativeThreadLinux:%s (pid=%" PRIu64 ", tid=%" PRIu64 ") watchpoint found with idx: %u",
407 __FUNCTION__, pid, GetID (), wp_index);
408
Chaoren Lin18fe6402015-02-03 01:51:47 +0000409 std::ostringstream ostr;
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000410 ostr << reg_ctx->GetWatchpointAddress (wp_index) << " " << wp_index;
Chaoren Lin18fe6402015-02-03 01:51:47 +0000411 m_stop_description = ostr.str();
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000412
413 m_stop_info.reason = StopReason::eStopReasonWatchpoint;
414 m_stop_info.details.signal.signo = SIGTRAP;
Chaoren Lin18fe6402015-02-03 01:51:47 +0000415 return;
416 }
Chaoren Lin18fe6402015-02-03 01:51:47 +0000417 }
Tamas Berghammereadb2a92015-03-17 14:40:57 +0000418
419 // The process reported a watchpoint was hit, but we haven't found the
420 // watchpoint. Assume that a stopped by trace is reported as a hardware
421 // watchpoint what happens on some linux kernels (e.g.: android-arm64
422 // platfrom-21).
423
424 if (log)
425 log->Printf ("NativeThreadLinux:%s (pid=%" PRIu64 ", tid=%" PRIu64 ") none of the watchpoint was hit.",
426 __FUNCTION__, pid, GetID ());
427
428 SetStoppedByTrace ();
Todd Fialaaf245d12014-06-30 21:05:18 +0000429}
430
431bool
432NativeThreadLinux::IsStoppedAtBreakpoint ()
433{
Chaoren Lin18fe6402015-02-03 01:51:47 +0000434 return GetState () == StateType::eStateStopped &&
435 m_stop_info.reason == StopReason::eStopReasonBreakpoint;
436}
Todd Fialaaf245d12014-06-30 21:05:18 +0000437
Chaoren Lin18fe6402015-02-03 01:51:47 +0000438bool
439NativeThreadLinux::IsStoppedAtWatchpoint ()
440{
441 return GetState () == StateType::eStateStopped &&
442 m_stop_info.reason == StopReason::eStopReasonWatchpoint;
Todd Fialaaf245d12014-06-30 21:05:18 +0000443}
444
445void
Chaoren Lin28e57422015-02-03 01:51:25 +0000446NativeThreadLinux::SetStoppedByTrace ()
447{
448 const StateType new_state = StateType::eStateStopped;
449 MaybeLogStateChange (new_state);
450 m_state = new_state;
451
452 m_stop_info.reason = StopReason::eStopReasonTrace;
453 m_stop_info.details.signal.signo = SIGTRAP;
454}
455
456void
457NativeThreadLinux::SetCrashedWithException (const siginfo_t& info)
Todd Fialaaf245d12014-06-30 21:05:18 +0000458{
459 const StateType new_state = StateType::eStateCrashed;
460 MaybeLogStateChange (new_state);
461 m_state = new_state;
462
463 m_stop_info.reason = StopReason::eStopReasonException;
Chaoren Lin28e57422015-02-03 01:51:25 +0000464 m_stop_info.details.signal.signo = info.si_signo;
Todd Fialaaf245d12014-06-30 21:05:18 +0000465
Chaoren Lin28e57422015-02-03 01:51:25 +0000466 const auto reason = GetCrashReason (info);
467 m_stop_description = GetCrashReasonString (reason, reinterpret_cast<lldb::addr_t> (info.si_addr));
468}
Todd Fialaaf245d12014-06-30 21:05:18 +0000469
470void
471NativeThreadLinux::SetSuspended ()
472{
473 const StateType new_state = StateType::eStateSuspended;
474 MaybeLogStateChange (new_state);
475 m_state = new_state;
476
477 // FIXME what makes sense here? Do we need a suspended StopReason?
478 m_stop_info.reason = StopReason::eStopReasonNone;
479}
480
481void
482NativeThreadLinux::SetExited ()
483{
484 const StateType new_state = StateType::eStateExited;
485 MaybeLogStateChange (new_state);
486 m_state = new_state;
487
488 m_stop_info.reason = StopReason::eStopReasonThreadExiting;
489}
490
491void
492NativeThreadLinux::MaybeLogStateChange (lldb::StateType new_state)
493{
494 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
495 // If we're not logging, we're done.
496 if (!log)
497 return;
498
499 // If this is a state change to the same state, we're done.
500 lldb::StateType old_state = m_state;
501 if (new_state == old_state)
502 return;
503
504 NativeProcessProtocolSP m_process_sp = m_process_wp.lock ();
505 lldb::pid_t pid = m_process_sp ? m_process_sp->GetID () : LLDB_INVALID_PROCESS_ID;
506
507 // Log it.
508 log->Printf ("NativeThreadLinux: thread (pid=%" PRIu64 ", tid=%" PRIu64 ") changing from state %s to %s", pid, GetID (), StateAsCString (old_state), StateAsCString (new_state));
509}