1 //===-- ProcessPOSIX.cpp ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // Other libraries and framework includes
15 #include "lldb/Breakpoint/BreakpointLocation.h"
16 #include "lldb/Breakpoint/Watchpoint.h"
17 #include "lldb/Core/Module.h"
18 #include "lldb/Core/ModuleSpec.h"
19 #include "lldb/Core/PluginManager.h"
20 #include "lldb/Core/State.h"
21 #include "lldb/Host/FileSpec.h"
22 #include "lldb/Host/Host.h"
23 #include "lldb/Symbol/ObjectFile.h"
24 #include "lldb/Target/DynamicLoader.h"
25 #include "lldb/Target/Platform.h"
26 #include "lldb/Target/Target.h"
28 #include "ProcessPOSIX.h"
29 #include "ProcessPOSIXLog.h"
30 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
31 #include "POSIXThread.h"
32 #include "ProcessMonitor.h"
34 #include "lldb/Host/posix/Fcntl.h"
37 using namespace lldb_private;
39 //------------------------------------------------------------------------------
40 // Constructors and destructors.
42 ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener, UnixSignalsSP &unix_signals_sp)
43 : Process(target, listener, unix_signals_sp),
44 m_byte_order(lldb::endian::InlHostByteOrder()),
47 m_message_mutex (Mutex::eMutexTypeRecursive),
51 // FIXME: Putting this code in the ctor and saving the byte order in a
52 // member variable is a hack to avoid const qual issues in GetByteOrder.
53 lldb::ModuleSP module = GetTarget().GetExecutableModule();
54 if (module && module->GetObjectFile())
55 m_byte_order = module->GetObjectFile()->GetByteOrder();
58 ProcessPOSIX::~ProcessPOSIX()
63 //------------------------------------------------------------------------------
66 ProcessPOSIX::Finalize()
71 m_monitor->StopMonitor();
75 ProcessPOSIX::CanDebug(Target &target, bool plugin_specified_by_name)
77 // For now we are just making sure the file exists for a given module
78 ModuleSP exe_module_sp(target.GetExecutableModule());
79 if (exe_module_sp.get())
80 return exe_module_sp->GetFileSpec().Exists();
81 // If there is no executable module, we return true since we might be preparing to attach.
86 ProcessPOSIX::DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info)
89 assert(m_monitor == NULL);
91 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
92 if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
93 log->Printf ("ProcessPOSIX::%s(pid = %" PRIi64 ")", __FUNCTION__, GetID());
95 m_monitor = new ProcessMonitor(this, pid, error);
100 PlatformSP platform_sp (m_target.GetPlatform ());
101 assert (platform_sp.get());
103 return error; // FIXME: Detatch?
105 // Find out what we can about this process
106 ProcessInstanceInfo process_info;
107 platform_sp->GetProcessInfo (pid, process_info);
109 // Resolve the executable module
110 ModuleSP exe_module_sp;
111 FileSpecList executable_search_paths (Target::GetDefaultExecutableSearchPaths());
112 ModuleSpec exe_module_spec(process_info.GetExecutableFile(), m_target.GetArchitecture());
113 error = platform_sp->ResolveExecutable(exe_module_spec,
115 executable_search_paths.GetSize() ? &executable_search_paths : NULL);
116 if (!error.Success())
119 // Fix the target architecture if necessary
120 const ArchSpec &module_arch = exe_module_sp->GetArchitecture();
121 if (module_arch.IsValid() && !m_target.GetArchitecture().IsExactMatch(module_arch))
122 m_target.SetArchitecture(module_arch);
124 // Initialize the target module list
125 m_target.SetExecutableModule (exe_module_sp, true);
127 SetSTDIOFileDescriptor(m_monitor->GetTerminalFD());
135 ProcessPOSIX::WillLaunch(Module* module)
142 ProcessPOSIX::GetFileSpec(const lldb_private::FileAction *file_action,
143 const FileSpec &default_file_spec,
144 const FileSpec &dbg_pts_file_spec)
146 FileSpec file_spec{};
148 if (file_action && file_action->GetAction() == FileAction::eFileActionOpen)
150 file_spec = file_action->GetFileSpec();
151 // By default the stdio paths passed in will be pseudo-terminal
152 // (/dev/pts). If so, convert to using a different default path
153 // instead to redirect I/O to the debugger console. This should
154 // also handle user overrides to /dev/null or a different file.
155 if (!file_spec || file_spec == dbg_pts_file_spec)
156 file_spec = default_file_spec;
162 ProcessPOSIX::DoLaunch (Module *module,
163 ProcessLaunchInfo &launch_info)
166 assert(m_monitor == NULL);
168 FileSpec working_dir = launch_info.GetWorkingDirectory();
170 (!working_dir.ResolvePath() ||
171 working_dir.GetFileType() != FileSpec::eFileTypeDirectory))
173 error.SetErrorStringWithFormat("No such file or directory: %s",
174 working_dir.GetCString());
178 SetPrivateState(eStateLaunching);
180 const lldb_private::FileAction *file_action;
182 // Default of empty will mean to use existing open file descriptors
183 FileSpec stdin_file_spec{};
184 FileSpec stdout_file_spec{};
185 FileSpec stderr_file_spec{};
187 const FileSpec dbg_pts_file_spec{launch_info.GetPTY().GetSlaveName(NULL,0), false};
189 file_action = launch_info.GetFileActionForFD (STDIN_FILENO);
190 stdin_file_spec = GetFileSpec(file_action, stdin_file_spec, dbg_pts_file_spec);
192 file_action = launch_info.GetFileActionForFD (STDOUT_FILENO);
193 stdout_file_spec = GetFileSpec(file_action, stdout_file_spec, dbg_pts_file_spec);
195 file_action = launch_info.GetFileActionForFD (STDERR_FILENO);
196 stderr_file_spec = GetFileSpec(file_action, stderr_file_spec, dbg_pts_file_spec);
198 m_monitor = new ProcessMonitor(this,
200 launch_info.GetArguments().GetConstArgumentVector(),
201 launch_info.GetEnvironmentEntries().GetConstArgumentVector(),
211 if (!error.Success())
214 int terminal = m_monitor->GetTerminalFD();
216 // The reader thread will close the file descriptor when done, so we pass it a copy.
217 int stdio = fcntl(terminal, F_DUPFD_CLOEXEC, 0);
219 error.SetErrorToErrno();
222 SetSTDIOFileDescriptor(stdio);
225 SetID(m_monitor->GetPID());
230 ProcessPOSIX::DidLaunch()
235 ProcessPOSIX::DoResume()
237 StateType state = GetPrivateState();
239 assert(state == eStateStopped);
241 SetPrivateState(eStateRunning);
243 bool did_resume = false;
245 Mutex::Locker lock(m_thread_list.GetMutex());
247 uint32_t thread_count = m_thread_list.GetSize(false);
248 for (uint32_t i = 0; i < thread_count; ++i)
250 POSIXThread *thread = static_cast<POSIXThread*>(
251 m_thread_list.GetThreadAtIndex(i, false).get());
252 did_resume = thread->Resume() || did_resume;
254 assert(did_resume && "Process resume failed!");
260 ProcessPOSIX::GetImageInfoAddress()
262 Target *target = &GetTarget();
263 ObjectFile *obj_file = target->GetExecutableModule()->GetObjectFile();
264 Address addr = obj_file->GetImageInfoAddress(target);
267 return addr.GetLoadAddress(target);
268 return LLDB_INVALID_ADDRESS;
272 ProcessPOSIX::DoHalt(bool &caused_stop)
280 else if (kill(GetID(), SIGSTOP))
283 error.SetErrorToErrno();
293 ProcessPOSIX::DoSignal(int signal)
297 if (kill(GetID(), signal))
298 error.SetErrorToErrno();
304 ProcessPOSIX::DoDestroy()
312 if (GetID() == LLDB_INVALID_PROCESS_ID)
314 error.SetErrorString("invalid process id");
317 if (!m_monitor->Kill())
319 error.SetErrorToErrno();
323 SetPrivateState(eStateExited);
330 ProcessPOSIX::DoDidExec()
332 Target *target = &GetTarget();
335 PlatformSP platform_sp (target->GetPlatform());
336 assert (platform_sp.get());
339 ProcessInstanceInfo process_info;
340 platform_sp->GetProcessInfo(GetID(), process_info);
341 ModuleSP exe_module_sp;
342 ModuleSpec exe_module_spec(process_info.GetExecutableFile(), target->GetArchitecture());
343 FileSpecList executable_search_paths (Target::GetDefaultExecutableSearchPaths());
344 Error error = platform_sp->ResolveExecutable(exe_module_spec,
346 executable_search_paths.GetSize() ? &executable_search_paths : NULL);
347 if (!error.Success())
349 target->SetExecutableModule(exe_module_sp, true);
355 ProcessPOSIX::SendMessage(const ProcessMessage &message)
357 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
359 Mutex::Locker lock(m_message_mutex);
361 Mutex::Locker thread_lock(m_thread_list.GetMutex());
363 POSIXThread *thread = static_cast<POSIXThread*>(
364 m_thread_list.FindThreadByID(message.GetTID(), false).get());
366 switch (message.GetKind())
368 case ProcessMessage::eInvalidMessage:
371 case ProcessMessage::eAttachMessage:
372 SetPrivateState(eStateStopped);
375 case ProcessMessage::eLimboMessage:
377 thread->SetState(eStateStopped);
378 if (message.GetTID() == GetID())
380 m_exit_status = message.GetExitStatus();
383 SetPrivateState(eStateExited);
384 m_monitor->Detach(GetID());
388 SetPrivateState(eStateStopped);
393 SetPrivateState(eStateStopped);
397 case ProcessMessage::eExitMessage:
398 if (thread != nullptr)
399 thread->SetState(eStateExited);
403 log->Warning ("ProcessPOSIX::%s eExitMessage for TID %" PRIu64 " failed to find a thread to mark as eStateExited, ignoring", __FUNCTION__, message.GetTID ());
406 // FIXME: I'm not sure we need to do this.
407 if (message.GetTID() == GetID())
409 SetExitStatus(message.GetExitStatus(), NULL);
411 else if (!IsAThreadRunning())
412 SetPrivateState(eStateStopped);
415 case ProcessMessage::eSignalMessage:
416 case ProcessMessage::eSignalDeliveredMessage:
417 if (message.GetSignal() == SIGSTOP &&
418 AddThreadForInitialStopIfNeeded(message.GetTID()))
420 // Intentional fall-through
422 case ProcessMessage::eBreakpointMessage:
423 case ProcessMessage::eTraceMessage:
424 case ProcessMessage::eWatchpointMessage:
425 case ProcessMessage::eCrashMessage:
427 thread->SetState(eStateStopped);
428 SetPrivateState(eStateStopped);
431 case ProcessMessage::eNewThreadMessage:
433 lldb::tid_t new_tid = message.GetChildTID();
434 if (WaitingForInitialStop(new_tid))
436 m_monitor->WaitForInitialTIDStop(new_tid);
439 thread->SetState(eStateStopped);
440 SetPrivateState(eStateStopped);
444 case ProcessMessage::eExecMessage:
447 thread->SetState(eStateStopped);
448 SetPrivateState(eStateStopped);
454 m_message_queue.push(message);
458 ProcessPOSIX::AddThreadForInitialStopIfNeeded(lldb::tid_t stop_tid)
460 bool added_to_set = false;
461 ThreadStopSet::iterator it = m_seen_initial_stop.find(stop_tid);
462 if (it == m_seen_initial_stop.end())
464 m_seen_initial_stop.insert(stop_tid);
471 ProcessPOSIX::WaitingForInitialStop(lldb::tid_t stop_tid)
473 return (m_seen_initial_stop.find(stop_tid) == m_seen_initial_stop.end());
477 ProcessPOSIX::CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid)
479 return new POSIXThread(process, tid);
483 ProcessPOSIX::RefreshStateAfterStop()
485 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
486 if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
487 log->Printf ("ProcessPOSIX::%s(), message_queue size = %d", __FUNCTION__, (int)m_message_queue.size());
489 Mutex::Locker lock(m_message_mutex);
491 // This method used to only handle one message. Changing it to loop allows
492 // it to handle the case where we hit a breakpoint while handling a different
494 while (!m_message_queue.empty())
496 ProcessMessage &message = m_message_queue.front();
498 // Resolve the thread this message corresponds to and pass it along.
499 lldb::tid_t tid = message.GetTID();
501 log->Printf ("ProcessPOSIX::%s(), message_queue size = %d, pid = %" PRIi64, __FUNCTION__, (int)m_message_queue.size(), tid);
503 if (message.GetKind() == ProcessMessage::eNewThreadMessage)
506 log->Printf ("ProcessPOSIX::%s() adding thread, tid = %" PRIi64, __FUNCTION__, message.GetChildTID());
507 lldb::tid_t child_tid = message.GetChildTID();
509 thread_sp.reset(CreateNewPOSIXThread(*this, child_tid));
511 Mutex::Locker lock(m_thread_list.GetMutex());
513 m_thread_list.AddThread(thread_sp);
516 m_thread_list.RefreshStateAfterStop();
518 POSIXThread *thread = static_cast<POSIXThread*>(
519 GetThreadList().FindThreadByID(tid, false).get());
521 thread->Notify(message);
523 if (message.GetKind() == ProcessMessage::eExitMessage)
525 // FIXME: We should tell the user about this, but the limbo message is probably better for that.
527 log->Printf ("ProcessPOSIX::%s() removing thread, tid = %" PRIi64, __FUNCTION__, tid);
529 Mutex::Locker lock(m_thread_list.GetMutex());
531 ThreadSP thread_sp = m_thread_list.RemoveThreadByID(tid, false);
533 m_seen_initial_stop.erase(tid);
536 m_message_queue.pop();
541 ProcessPOSIX::IsAlive()
543 StateType state = GetPrivateState();
544 return state != eStateDetached
545 && state != eStateExited
546 && state != eStateInvalid
547 && state != eStateUnloaded;
551 ProcessPOSIX::DoReadMemory(addr_t vm_addr,
552 void *buf, size_t size, Error &error)
555 return m_monitor->ReadMemory(vm_addr, buf, size, error);
559 ProcessPOSIX::DoWriteMemory(addr_t vm_addr, const void *buf, size_t size,
563 return m_monitor->WriteMemory(vm_addr, buf, size, error);
567 ProcessPOSIX::DoAllocateMemory(size_t size, uint32_t permissions,
570 addr_t allocated_addr = LLDB_INVALID_ADDRESS;
573 if (permissions & lldb::ePermissionsReadable)
574 prot |= eMmapProtRead;
575 if (permissions & lldb::ePermissionsWritable)
576 prot |= eMmapProtWrite;
577 if (permissions & lldb::ePermissionsExecutable)
578 prot |= eMmapProtExec;
580 if (InferiorCallMmap(this, allocated_addr, 0, size, prot,
581 eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0)) {
582 m_addr_to_mmap_size[allocated_addr] = size;
585 allocated_addr = LLDB_INVALID_ADDRESS;
586 error.SetErrorStringWithFormat("unable to allocate %zu bytes of memory with permissions %s", size, GetPermissionsAsCString (permissions));
589 return allocated_addr;
593 ProcessPOSIX::DoDeallocateMemory(lldb::addr_t addr)
596 MMapMap::iterator pos = m_addr_to_mmap_size.find(addr);
597 if (pos != m_addr_to_mmap_size.end() &&
598 InferiorCallMunmap(this, addr, pos->second))
599 m_addr_to_mmap_size.erase (pos);
601 error.SetErrorStringWithFormat("unable to deallocate memory at 0x%" PRIx64, addr);
607 ProcessPOSIX::GetSoftwareBreakpointTrapOpcode(BreakpointSite* bp_site)
609 static const uint8_t g_aarch64_opcode[] = { 0x00, 0x00, 0x20, 0xD4 };
610 static const uint8_t g_i386_opcode[] = { 0xCC };
612 ArchSpec arch = GetTarget().GetArchitecture();
613 const uint8_t *opcode = NULL;
614 size_t opcode_size = 0;
616 switch (arch.GetMachine())
619 assert(false && "CPU type not supported!");
622 case llvm::Triple::arm:
624 // The ARM reference recommends the use of 0xe7fddefe and 0xdefe
625 // but the linux kernel does otherwise.
626 static const uint8_t g_arm_breakpoint_opcode[] = { 0xf0, 0x01, 0xf0, 0xe7 };
627 static const uint8_t g_thumb_breakpoint_opcode[] = { 0x01, 0xde };
629 lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0));
630 AddressClass addr_class = eAddressClassUnknown;
633 addr_class = bp_loc_sp->GetAddress ().GetAddressClass ();
635 if (addr_class == eAddressClassCodeAlternateISA
636 || (addr_class == eAddressClassUnknown
637 && bp_loc_sp->GetAddress().GetOffset() & 1))
639 opcode = g_thumb_breakpoint_opcode;
640 opcode_size = sizeof(g_thumb_breakpoint_opcode);
644 opcode = g_arm_breakpoint_opcode;
645 opcode_size = sizeof(g_arm_breakpoint_opcode);
649 case llvm::Triple::aarch64:
650 opcode = g_aarch64_opcode;
651 opcode_size = sizeof(g_aarch64_opcode);
654 case llvm::Triple::x86:
655 case llvm::Triple::x86_64:
656 opcode = g_i386_opcode;
657 opcode_size = sizeof(g_i386_opcode);
661 bp_site->SetTrapOpcode(opcode, opcode_size);
666 ProcessPOSIX::EnableBreakpointSite(BreakpointSite *bp_site)
668 return EnableSoftwareBreakpoint(bp_site);
672 ProcessPOSIX::DisableBreakpointSite(BreakpointSite *bp_site)
674 return DisableSoftwareBreakpoint(bp_site);
678 ProcessPOSIX::EnableWatchpoint(Watchpoint *wp, bool notify)
683 user_id_t watchID = wp->GetID();
684 addr_t addr = wp->GetLoadAddress();
685 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_WATCHPOINTS));
687 log->Printf ("ProcessPOSIX::EnableWatchpoint(watchID = %" PRIu64 ")",
692 log->Printf("ProcessPOSIX::EnableWatchpoint(watchID = %" PRIu64
693 ") addr = 0x%8.8" PRIx64 ": watchpoint already enabled.",
694 watchID, (uint64_t)addr);
698 // Try to find a vacant watchpoint slot in the inferiors' main thread
699 uint32_t wp_hw_index = LLDB_INVALID_INDEX32;
700 Mutex::Locker lock(m_thread_list.GetMutex());
701 POSIXThread *thread = static_cast<POSIXThread*>(
702 m_thread_list.GetThreadAtIndex(0, false).get());
705 wp_hw_index = thread->FindVacantWatchpointIndex();
707 if (wp_hw_index == LLDB_INVALID_INDEX32)
709 error.SetErrorString("Setting hardware watchpoint failed.");
713 wp->SetHardwareIndex(wp_hw_index);
714 bool wp_enabled = true;
715 uint32_t thread_count = m_thread_list.GetSize(false);
716 for (uint32_t i = 0; i < thread_count; ++i)
718 thread = static_cast<POSIXThread*>(
719 m_thread_list.GetThreadAtIndex(i, false).get());
721 wp_enabled &= thread->EnableHardwareWatchpoint(wp);
727 wp->SetEnabled(true, notify);
732 // Watchpoint enabling failed on at least one
733 // of the threads so roll back all of them
734 DisableWatchpoint(wp, false);
735 error.SetErrorString("Setting hardware watchpoint failed");
740 error.SetErrorString("Watchpoint argument was NULL.");
745 ProcessPOSIX::DisableWatchpoint(Watchpoint *wp, bool notify)
750 user_id_t watchID = wp->GetID();
751 addr_t addr = wp->GetLoadAddress();
752 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_WATCHPOINTS));
754 log->Printf("ProcessPOSIX::DisableWatchpoint(watchID = %" PRIu64 ")",
756 if (!wp->IsEnabled())
759 log->Printf("ProcessPOSIX::DisableWatchpoint(watchID = %" PRIu64
760 ") addr = 0x%8.8" PRIx64 ": watchpoint already disabled.",
761 watchID, (uint64_t)addr);
762 // This is needed (for now) to keep watchpoints disabled correctly
763 wp->SetEnabled(false, notify);
767 if (wp->IsHardware())
769 bool wp_disabled = true;
770 Mutex::Locker lock(m_thread_list.GetMutex());
771 uint32_t thread_count = m_thread_list.GetSize(false);
772 for (uint32_t i = 0; i < thread_count; ++i)
774 POSIXThread *thread = static_cast<POSIXThread*>(
775 m_thread_list.GetThreadAtIndex(i, false).get());
777 wp_disabled &= thread->DisableHardwareWatchpoint(wp);
783 wp->SetHardwareIndex(LLDB_INVALID_INDEX32);
784 wp->SetEnabled(false, notify);
788 error.SetErrorString("Disabling hardware watchpoint failed");
792 error.SetErrorString("Watchpoint argument was NULL.");
797 ProcessPOSIX::GetWatchpointSupportInfo(uint32_t &num)
800 Mutex::Locker lock(m_thread_list.GetMutex());
801 POSIXThread *thread = static_cast<POSIXThread*>(
802 m_thread_list.GetThreadAtIndex(0, false).get());
804 num = thread->NumSupportedHardwareWatchpoints();
806 error.SetErrorString("Process does not exist.");
811 ProcessPOSIX::GetWatchpointSupportInfo(uint32_t &num, bool &after)
813 Error error = GetWatchpointSupportInfo(num);
814 // Watchpoints trigger and halt the inferior after
815 // the corresponding instruction has been executed.
821 ProcessPOSIX::UpdateThreadListIfNeeded()
823 Mutex::Locker lock(m_thread_list.GetMutex());
824 // Do not allow recursive updates.
825 return m_thread_list.GetSize(false);
829 ProcessPOSIX::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
831 Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
832 if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
833 log->Printf ("ProcessPOSIX::%s() (pid = %" PRIi64 ")", __FUNCTION__, GetID());
835 bool has_updated = false;
836 // Update the process thread list with this new thread.
837 // FIXME: We should be using tid, not pid.
839 ThreadSP thread_sp (old_thread_list.FindThreadByID (GetID(), false));
841 thread_sp.reset(CreateNewPOSIXThread(*this, GetID()));
845 if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
846 log->Printf ("ProcessPOSIX::%s() updated pid = %" PRIi64, __FUNCTION__, GetID());
847 new_thread_list.AddThread(thread_sp);
849 return has_updated; // the list has been updated
853 ProcessPOSIX::GetByteOrder() const
855 // FIXME: We should be able to extract this value directly. See comment in
861 ProcessPOSIX::PutSTDIN(const char *buf, size_t len, Error &error)
864 if ((status = write(m_monitor->GetTerminalFD(), buf, len)) < 0)
866 error.SetErrorToErrno();
872 //------------------------------------------------------------------------------
873 // Utility functions.
876 ProcessPOSIX::HasExited()
878 switch (GetPrivateState())
892 ProcessPOSIX::IsStopped()
894 switch (GetPrivateState())
901 case eStateSuspended:
909 ProcessPOSIX::IsAThreadRunning()
911 bool is_running = false;
912 Mutex::Locker lock(m_thread_list.GetMutex());
913 uint32_t thread_count = m_thread_list.GetSize(false);
914 for (uint32_t i = 0; i < thread_count; ++i)
916 POSIXThread *thread = static_cast<POSIXThread*>(
917 m_thread_list.GetThreadAtIndex(i, false).get());
918 StateType thread_state = thread->GetState();
919 if (thread_state == eStateRunning || thread_state == eStateStepping)
929 ProcessPOSIX::GetAuxvData ()
931 // If we're the local platform, we can ask the host for auxv data.
932 PlatformSP platform_sp = m_target.GetPlatform ();
933 if (platform_sp && platform_sp->IsHost ())
934 return lldb_private::Host::GetAuxvData(this);
936 // Somewhat unexpected - the process is not running locally or we don't have a platform.
937 assert (false && "no platform or not the host - how did we get here with ProcessPOSIX?");
938 return DataBufferSP ();