Home | History | Annotate | Download | only in Target

Lines Matching full:process

1 //===-- Process.cpp ---------------------------------------------*- C++ -*-===//
12 #include "lldb/Target/Process.h"
48 // Comment out line below to disable memory caching, overriding the process setting
49 // target.process.disable-memory-cache
67 // is part of a new lldb_private::Process instance. It will copy all current
77 // When gettings the value for a key from the process options, we will always
78 // try and grab the setting from the current process if there is one. Else we just
82 Process *process = exe_ctx->GetProcessPtr();
83 if (process)
85 ProcessOptionValueProperties *instance_properties = static_cast<ProcessOptionValueProperties *>(process->GetValueProperties().get());
98 { "extra-startup-command", OptionValue::eTypeArray , false, OptionValue::eTypeString, NULL, NULL, "A list containing extra commands understood by the particular process plugin used. "
104 { "detach-keeps-stopped" , OptionValue::eTypeBoolean, true, false, NULL, NULL, "If true, detach will attempt to keep the process stopped." },
123 m_collection_sp.reset (new ProcessOptionValueProperties(ConstString("process")));
131 m_collection_sp.reset (new ProcessOptionValueProperties(Process::GetGlobalProperties().get()));
431 // If notthing was specified, then check the process for any default
774 case 'p': // Process plug-in name
794 case 't': // Open process in new terminal window
829 { LLDB_OPT_SET_ALL, false, "stop-at-entry", 's', no_argument, NULL, 0, eArgTypeNone, "Stop at the entry point of the program when launching a process."},
830 { LLDB_OPT_SET_ALL, false, "disable-aslr", 'A', no_argument, NULL, 0, eArgTypeNone, "Disable address space layout randomization when launching a process."},
831 { LLDB_OPT_SET_ALL, false, "plugin", 'p', required_argument, NULL, 0, eArgTypePlugin, "Name of the process plugin you want to use."},
833 { LLDB_OPT_SET_ALL, false, "arch", 'a', required_argument, NULL, 0, eArgTypeArchitecture, "Set the architecture for the process to launch when ambiguous."},
835 { LLDB_OPT_SET_ALL, false, "shell", 'c', optional_argument, NULL, 0, eArgTypeFilename, "Run the process in a shell (not supported on all platforms)."},
837 { LLDB_OPT_SET_1 , false, "stdin", 'i', required_argument, NULL, 0, eArgTypeFilename, "Redirect stdin for the process to <filename>."},
838 { LLDB_OPT_SET_1 , false, "stdout", 'o', required_argument, NULL, 0, eArgTypeFilename, "Redirect stdout for the process to <filename>."},
839 { LLDB_OPT_SET_1 , false, "stderr", 'e', required_argument, NULL, 0, eArgTypeFilename, "Redirect stderr for the process to <filename>."},
841 { LLDB_OPT_SET_2 , false, "tty", 't', no_argument, NULL, 0, eArgTypeNone, "Start the process in a terminal (not supported on all platforms)."},
843 { LLDB_OPT_SET_3 , false, "no-stdio", 'n', no_argument, NULL, 0, eArgTypeNone, "Do not set up for terminal I/O to go to running process."},
941 Process::FindPlugin (Target &target, const char *plugin_name, Listener &listener, const FileSpec *crash_file_path)
986 Process::GetStaticBroadcasterClass ()
988 static ConstString class_name ("lldb.process");
993 // Process constructor
995 Process::Process(Target &target, Listener &listener) :
998 Broadcaster (&(target.GetDebugger()), "lldb.process"),
1002 m_private_state_broadcaster (NULL, "lldb.process.internal_state_broadcaster"),
1003 m_private_state_control_broadcaster (NULL, "lldb.process.internal_state_control_broadcaster"),
1004 m_private_state_listener ("lldb.process.internal_state_listener"),
1024 m_stdio_communication ("process.stdio"),
1047 log->Printf ("%p Process::Process()", this);
1079 Process::~Process()
1083 log->Printf ("%p Process::~Process()", this);
1088 Process::GetGlobalProperties()
1097 Process::Finalize()
1111 // FIXME: This will have to be a process setting:
1132 // We need to destroy the loader before the derived Process class gets destroyed
1133 // since it is very likely that undoing the loader will require access to the real process.
1158 // process around forever. These events need to be cleared out.
1168 Process::RegisterNotificationCallbacks (const Notifications& callbacks)
1176 Process::UnregisterNotificationCallbacks(const Notifications& callbacks)
1193 Process::SynchronouslyNotifyStateChanged (StateType state)
1212 Process::GetNextEvent (EventSP &event_sp)
1217 state = Process::ProcessEventData::GetStateFromEvent (event_sp.get());
1224 Process::WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp_ptr)
1252 if (Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
1265 Process::WaitForState
1293 Process::HijackProcessEvents (Listener *listener)
1304 Process::RestoreProcessEvents ()
1310 Process::HijackPrivateProcessEvents (Listener *listener)
1321 Process::RestorePrivateProcessEvents ()
1327 Process::WaitForStateChangedEvents (const TimeValue *timeout, EventSP &event_sp)
1332 log->Printf ("Process::%s (timeout = %p, event_sp)...", __FUNCTION__, timeout);
1341 state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
1343 log->Printf ("Process::%s got no event or was interrupted.", __FUNCTION__);
1347 log->Printf ("Process::%s (timeout = %p, event_sp) => %s",
1355 Process::PeekAtStateChangedEvents ()
1360 log->Printf ("Process::%s...", __FUNCTION__);
1369 log->Printf ("Process::%s (event_ptr) => %s",
1375 log->Printf ("Process::%s no events found",
1383 Process::WaitForStateChangedEventsPrivate (const TimeValue *timeout, EventSP &event_sp)
1388 log->Printf ("Process::%s (timeout = %p, event_sp)...", __FUNCTION__, timeout);
1396 state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
1404 log->Printf ("Process::%s (timeout = %p, event_sp) => TIMEOUT", __FUNCTION__, timeout);
1406 log->Printf ("Process::%s (timeout = %p, event_sp) => %s", __FUNCTION__, timeout, StateAsCString(state));
1412 Process::WaitForEventsPrivate (const TimeValue *timeout, EventSP &event_sp, bool control_only)
1417 log->Printf ("Process::%s (timeout = %p, event_sp)...", __FUNCTION__, timeout);
1426 Process::IsRunning () const
1432 Process::GetExitStatus ()
1441 Process::GetExitDescription ()
1449 Process::SetExitStatus (int status, const char *cstr)
1453 log->Printf("Process::SetExitStatus (status=%i (0x%8.8x), description=%s%s%s)",
1463 log->Printf("Process::SetExitStatus () ignoring exit status because state was already set to eStateExited");
1480 // the current host. The the child process exits, the process will be
1482 // lldb_private::Process doesn't go away before we can deliver the signal.
1484 Process::SetProcessExitStatus (void *callback_baton,
1488 int exit_status // Exit value of process if signal is zero
1493 log->Printf ("Process::SetProcessExitStatus (baton=%p, pid=%" PRIu64 ", exited=%i, signal=%i, exit_status=%i)\n",
1522 Process::UpdateThreadListIfNeeded ()
1550 // backed by actual threads from the lldb_private::Process subclass
1557 real_thread_list, // The actual thread list full of threads created by each lldb_private::Process subclass
1576 Process::CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context)
1585 Process::GetNextThreadIndexID (uint64_t thread_id)
1591 Process::HasAssignedIndexIDToThread(uint64_t thread_id)
1605 Process::AssignIndexIDToThread(uint64_t thread_id)
1623 Process::GetState()
1630 Process::SetPublicState (StateType new_state, bool restarted)
1634 log->Printf("Process::SetPublicState (state = %s, restarted = %i)", StateAsCString(new_state), restarted);
1646 log->Printf("Process::SetPublicState (%s) -- unlocking run lock for detach", StateAsCString(new_state));
1658 log->Printf("Process::SetPublicState (%s) -- unlocking run lock", StateAsCString(new_state));
1667 Process::Resume ()
1671 log->Printf("Process::Resume -- locking run lock");
1674 Error error("Resume request failed - process still running.");
1676 log->Printf ("Process::Resume: -- TrySetRunning failed, not resuming.");
1683 Process::GetPrivateState ()
1689 Process::SetPrivateState (StateType new_state)
1695 log->Printf("Process::SetPrivateState (%s)", StateAsCString(new_state));
1719 // stop when the process stops. In the future we will want to
1726 // The process plugin is responsible for managing the actual
1734 log->Printf("Process::SetPrivateState (%s) stop_id = %u", StateAsCString(new_state), m_mod_id.GetStopID());
1745 log->Printf("Process::SetPrivateState (%s) state didn't change. Ignoring...", StateAsCString(new_state));
1750 Process::SetRunningUserExpression (bool on)
1756 Process::GetImageInfoAddress()
1765 // unix variants. Any Process subclasses that need to do shared library
1770 Process::LoadImage (const FileSpec &image_spec, Error &error)
1839 // unix variants. Any Process subclasses that need to do shared library
1844 Process::UnloadImage (uint32_t image_token)
1921 Process::GetABI()
1929 Process::GetLanguageRuntime(lldb::LanguageType language, bool retry_if_null)
1945 Process::GetCPPLanguageRuntime (bool retry_if_null)
1954 Process::GetObjCLanguageRuntime (bool retry_if_null)
1963 Process::IsPossibleDynamicValue (ValueObject& in_value)
1984 Process::GetBreakpointSiteList()
1990 Process::GetBreakpointSiteList() const
1997 Process::DisableAllBreakpointSites ()
2006 Process::ClearBreakpointSiteByID (lldb::user_id_t break_id)
2017 Process::DisableBreakpointSiteByID (lldb::user_id_t break_id)
2035 Process::EnableBreakpointSiteByID (lldb::user_id_t break_id)
2052 Process::CreateBreakpointSite (const BreakpointLocationSP &owner, bool use_hardware)
2089 Process::RemoveOwnerFromBreakpointSite (lldb::user_id_t owner_id, lldb::user_id_t owner_loc_id, BreakpointSiteSP &bp_site_sp)
2094 // Don't try to disable the site if we don't have a live process anymore.
2103 Process::RemoveBreakpointOpcodesFromBuffer (addr_t bp_addr, size_t size, uint8_t *buf) const
2133 Process::GetSoftwareBreakpointTrapOpcode (BreakpointSite* bp_site)
2142 Process::EnableSoftwareBreakpoint (BreakpointSite *bp_site)
2149 log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64, bp_site->GetID(), (uint64_t)bp_addr);
2153 log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- already enabled", bp_site->GetID(), (uint64_t)bp_addr);
2162 // Ask the lldb::Process subclass to fill in the correct software breakpoint
2168 error.SetErrorStringWithFormat ("Process::GetSoftwareBreakpointTrapOpcode() returned zero, unable to get breakpoint trap for address 0x%" PRIx64, bp_addr);
2194 log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- SUCCESS",
2211 log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- FAILED: %s",
2219 Process::DisableSoftwareBreakpoint (BreakpointSite *bp_site)
2227 log->Printf ("Process::DisableSoftwareBreakpoint (breakID = %" PRIu64 ") addr = 0x%" PRIx64, breakID, (uint64_t)bp_addr);
2281 log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- SUCCESS", bp_site->GetID(), (uint64_t)bp_addr);
2301 log->Printf ("Process
2306 log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- FAILED: %s",
2318 Process::ReadMemory (addr_t addr, void *buf, size_t size, Error &error)
2361 Process::ReadCStringFromMemory (addr_t addr, std::string &out_str, Error &error)
2384 Process::ReadStringFromMemory (addr_t addr, char *dst, size_t max_bytes, Error &error,
2438 Process::ReadCStringFromMemory (addr_t addr, char *dst, size_t dst_max_len, Error &result_error)
2487 Process::ReadMemoryFromInferior (addr_t addr, void *buf, size_t size, Error &error)
2515 Process::ReadUnsignedIntegerFromMemory (lldb::addr_t vm_addr, size_t integer_byte_size, uint64_t fail_value, Error &error)
2524 Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error)
2534 Process::WritePointerToMemory (lldb::addr_t vm_addr,
2548 Process::WriteMemoryPrivate (addr_t addr, const void *buf, size_t size, Error &error)
2568 Process::WriteMemory (addr_t addr, const void *buf, size_t size, Error &error)
2653 Process::WriteScalarToMemory (addr_t addr, const Scalar &scalar, size_t byte_size, Error &error)
2674 Process::ReadScalarIntegerFromMemory (addr_t addr,
2714 Process::AllocateMemory(size_t size, uint32_t permissions, Error &error)
2725 log->Printf("Process::AllocateMemory(size=%4zu, permissions=%s) => 0x%16.16" PRIx64 " (m_stop_id = %u m_memory_id = %u)",
2736 Process::CanJIT ()
2758 Process::SetCanJIT (bool can_jit)
2764 Process::DeallocateMemory (addr_t ptr)
2777 log->Printf("Process::DeallocateMemory(addr=0x%16.16" PRIx64 ") => err = %s (m_stop_id = %u, m_memory_id = %u)",
2788 Process::ReadModuleFromMemory (const FileSpec& file_spec,
2803 Process::EnableWatchpoint (Watchpoint *watchpoint, bool notify)
2811 Process::DisableWatchpoint (Watchpoint *watchpoint, bool notify)
2819 Process::WaitForProcessStopPrivate (const TimeValue *timeout, EventSP &event_sp)
2822 // Now wait for the process to launch and return control to us, and then
2843 Process::Launch (const ProcessLaunchInfo &launch_info)
2878 error.SetErrorString("failed to acquire process run lock");
2902 // We were able to launch the process, but we failed to
2945 Process::LoadCore ()
2970 Process::GetDynamicLoader ()
2978 Process::NextEventAction::EventActionResult
2979 Process::AttachCompletionHandler::PerformAction (lldb::EventSP &event_sp)
2992 // lldb_private::Process subclasses must set the new process ID.
3017 m_exit_string.assign ("No valid Process");
3021 Process::NextEventAction::EventActionResult
3022 Process::AttachCompletionHandler::HandleBeingInterrupted()
3028 Process::AttachCompletionHandler::GetExitString ()
3034 Process::Attach (ProcessAttachInfo &attach_info)
3067 error.SetErrorString("failed to acquire process run lock");
3083 SetNextEventAction(new Process::AttachCompletionHandler(this, attach_info.GetResumeCount()));
3104 // Fall through and attach using the above process ID
3110 error.SetErrorStringWithFormat ("more than one process named %s", process_name);
3112 error.SetErrorStringWithFormat ("could not find a process named %s", process_name);
3124 error.SetErrorString ("invalid process name");
3145 error.SetErrorString("failed to acquire process run lock");
3151 SetNextEventAction(new Process::AttachCompletionHandler(this, attach_info.GetResumeCount()));
3172 Process::CompleteAttach ()
3174 // Let the process subclass figure out at much as it can about the process
3178 // We just attached. If we have a platform, ask it for the process architecture, and if it isn't
3233 Process::ConnectRemote (Stream *strm, const char *remote_url)
3238 // Find the process and its architecture. Make sure it matches the architecture
3251 // If we attached and actually have a process on the other end, then
3272 Process::PrivateResume ()
3276 log->Printf("Process::PrivateResume() m_stop_id = %u, public state: %s private state: %s",
3282 // Tell the process it is about to resume before the thread list
3289 // that they are supposed to have when the process is resumed
3298 error.SetErrorStringWithFormat ("Process::PrivateResume PreResumeActions failed, not resuming.");
3309 log->Printf ("Process thinks the process has resumed.");
3318 log->Printf ("Process::PrivateResume() asked to simulate a start & stop.");
3325 log->Printf ("Process::PrivateResume() got an error \"%s\".", error.AsCString("<unknown error>"));
3330 Process::Halt (bool clear_thread_plans)
3344 Listener halt_listener ("lldb.process.halt_listener");
3355 // Ask the process subclass to actually halt our process
3366 // If "caused_stop" is true, then DoHalt stopped the process. If
3367 // "caused_stop" is false, the process was already stopped.
3368 // If the DoHalt caused the process to stop, then we want to catch
3370 // this along so clients know that the process was interrupted by
3374 // Wait for 1 second for the process to stop.
3390 // We caused the process to interrupt itself, so mark this
3392 // process from a natural stop
3399 log->Printf("Process::Halt() failed to stop, state is: %s", StateAsCString(state));
3412 // stopped the process, intercepted the event and set the interrupted
3422 Process::HaltForDestroyOrDetach(lldb::EventSP &exit_event_sp)
3429 log->Printf("Process::Destroy() About to halt.");
3438 // If the process exited while we were waiting for it to stop, put the exited event into
3440 // they don't have a process anymore...
3445 log->Printf("Process::HaltForDestroyOrDetach() Process exited while waiting to Halt.");
3454 log->Printf("Process::HaltForDestroyOrDetach() Halt failed to stop, state is: %s", StateAsCString(state));
3455 // If we really couldn't stop the process then we should just error out here, but if the
3467 log->Printf("Process::HaltForDestroyOrDetach() Halt got error: %s", error.AsCString());
3474 Process::Detach (bool keep_stopped)
3494 // We shouldn't need to do anything else here. There's no process left to detach from...
3514 // If we exited when we were waiting for a process to stop, then
3525 // it here so when we do to tear down the process we don't get an error destroying the lock.
3532 Process::Destroy ()
3535 // Tell ourselves we are in the process of destroying the process, so that we don't do any unnecessary work
3537 // failed and the process stays around for some reason it won't be in a confused state.
3573 // If we exited when we were waiting for a process to stop, then
3584 // it here so when we do to tear down the process we don't get an error destroying the lock.
3594 Process::Signal (int signal)
3607 Process::GetByteOrder () const
3613 Process::GetAddressByteSize () const
3620 Process::ShouldBroadcastEvent (Event *event_ptr)
3622 const StateType state = Process::ProcessEventData::GetStateFromEvent (event_ptr);
3692 log->Printf ("Process::ShouldBroadcastEvent (%p) stopped due to an interrupt, state: %s",
3713 log->Printf ("Process::ShouldBroadcastEvent: should_stop: %i state: %s was_restarted: %i stop_vote: %d.",
3733 log->Printf ("Process::ShouldBroadcastEvent (%p) Restarting process from state: %s", event_ptr, StateAsCString(state));
3760 log->Printf ("Process::ShouldBroadcastEvent (%p) => new state: %s, last broadcast state: %s - %s",
3770 Process::StartPrivateStateThread (bool force)
3776 log->Printf ("Process::%s()%s ", __FUNCTION__, already_running ? " already running" : " starting private state thread");
3785 snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state-override(pid=%" PRIu64 ")>", GetID());
3787 snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state(pid=%" PRIu64 ")>", GetID());
3790 m_private_state_thread = Host::ThreadCreate (thread_name, Process::PrivateStateThread, this, NULL);
3802 Process::PausePrivateStateThread ()
3808 Process::ResumePrivateStateThread ()
3814 Process::StopPrivateStateThread ()
3827 Process::ControlPrivateStateThread (uint32_t signal)
3836 log->Printf ("Process::%s (signal = %d)", __FUNCTION__, signal);
3884 Process::SendAsyncInterrupt ()
3887 m_private_state_broadcaster.BroadcastEvent (Process::eBroadcastBitInterrupt, NULL);
3889 BroadcastEvent (Process::eBroadcastBitInterrupt, NULL);
3893 Process::HandlePrivateEvent (EventSP &event_sp)
3900 const StateType new_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
3942 log->Printf ("Process::%s (pid = %" PRIu64 ") broadcasting new state %s (old state %s) to %s",
3949 Process::ProcessEventData::SetUpdateStateOnRemoval(event_sp.get());
3952 else if (!Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
3961 log->Printf ("Process::%s (pid = %" PRIu64 ") suppressing state %s (old state %s): should_broadcast == false",
3972 Process::PrivateStateThread (void *arg)
3974 Process *proc = static_cast<Process*> (arg);
3980 Process::RunPrivateStateThread ()
3987 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") thread starting...", __FUNCTION__, this, GetID());
3997 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") got a control event: %d", __FUNCTION__, this, GetID(), event_sp->GetType());
4022 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") woke up with an interrupt while attaching - forwarding interrupt.", __FUNCTION__, this, GetID());
4028 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") woke up with an interrupt - Halting.", __FUNCTION__, this, GetID());
4034 const StateType internal_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
4052 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") about to exit with internal state %s...", __FUNCTION__, this, GetID(), StateAsCString(internal_state));
4060 log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") thread exiting...", __FUNCTION__, this, GetID());
4069 // Process Event Data
4072 Process::ProcessEventData::ProcessEventData () :
4082 Process::ProcessEventData::ProcessEventData (const ProcessSP &process_sp, StateType state) :
4092 Process::ProcessEventData::~ProcessEventData()
4097 Process::ProcessEventData::GetFlavorString ()
4099 static ConstString g_flavor ("Process::ProcessEventData");
4104 Process::ProcessEventData::GetFlavor () const
4110 Process::ProcessEventData::DoOnRemoval (Event *event_ptr)
4113 // off of the private process event queue, and then any number of times, first when it gets pulled off of
4121 m_process_sp->SetPublicState (m_state, Process::ProcessEventData::GetRestartedFromEvent(event_ptr));
4131 process, so we need to query that as we go.
4234 Process::ProcessEventData::Dump (Stream *s) const
4237 s->Printf(" process = %p (pid = %" PRIu64 "), ", m_process_sp.get(), m_process_sp->GetID());
4242 const Process::ProcessEventData *
4243 Process::ProcessEventData::GetEventDataFromEvent (const Event *event_ptr)
4255 Process::ProcessEventData::GetProcessFromEvent (const Event *event_ptr)
4265 Process::ProcessEventData::GetStateFromEvent (const Event *event_ptr)
4275 Process::ProcessEventData::GetRestartedFromEvent (const Event *event_ptr)
4285 Process::ProcessEventData::SetRestartedInEvent (Event *event_ptr, bool new_value)
4293 Process::ProcessEventData::GetNumRestartedReasons(const Event *event_ptr)
4303 Process::ProcessEventData::GetRestartedReasonAtIndex(const Event *event_ptr, size_t idx)
4313 Process::ProcessEventData::AddRestartedReason (Event *event_ptr, const char *reason)
4321 Process::ProcessEventData::GetInterruptedFromEvent (const Event *event_ptr)
4331 Process::ProcessEventData::SetInterruptedInEvent (Event *event_ptr, bool new_value)
4339 Process::ProcessEventData::SetUpdateStateOnRemoval (Event *event_ptr)
4351 Process::CalculateTarget ()
4357 Process::CalculateExecutionContext (ExecutionContext &exe_ctx)
4366 //Process::ListProcessesMatchingName (const char *name, StringList &matches, std::vector<lldb::pid_t> &pids)
4372 //Process::GetArchSpecForExistingProcess (lldb::pid_t pid)
4378 //Process::GetArchSpecForExistingProcess (const char *process_name)
4384 Process::AppendSTDOUT (const char * s, size_t len)
4392 Process::AppendSTDERR (const char * s, size_t len)
4400 Process::BroadcastAsyncProfileData(const std::string &one_profile_data)
4408 Process::GetAsyncProfileData (char *buf, size_t buf_size, Error &error)
4420 log->Printf ("Process::GetProfileData (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
4438 // Process STDIO
4442 Process::GetSTDOUT (char *buf, size_t buf_size, Error &error)
4450 log->Printf ("Process::GetSTDOUT (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
4468 Process::GetSTDERR (char *buf, size_t buf_size, Error &error)
4476 log->Printf ("Process::GetSTDERR (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
4493 Process::STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len)
4495 Process *process = (Process *) baton;
4496 process->AppendSTDOUT (static_cast<const char *>(src), src_len);
4500 Process::ProcessInputReaderCallback (void *baton,
4506 Process *process = (Process *) baton;
4525 process->PutSTDIN (bytes, bytes_len, error);
4530 process->SendAsyncInterrupt();
4534 process->AppendSTDOUT ("^D", 2);
4546 Process::ResetProcessInputReader ()
4552 Process::SetSTDIOFileDescriptor (int file_descriptor)
4554 // First set up the Read Thread for reading/handling process I/O
4571 Error err (m_process_input_reader->Initialize (Process::ProcessInputReaderCallback,
4586 Process::PushProcessInputReader ()
4593 Process::PopProcessInputReader ()
4599 // The process needs to know about installed plug-ins
4601 Process::SettingsInitialize ()
4637 Process::SettingsTerminate ()
4643 Process::RunThreadPlan (ExecutionContext &exe_ctx,
4668 errors.Printf("RunThreadPlan called on wrong process.");
4760 Listener listener("lldb.process.listener.run-thread-plan");
4765 // This process event hijacker Hijacks the Public events and its destructor makes sure that the process events get
4768 // If the event needs to propagate beyond the hijacker (e.g., the process exits during execution), then the event
4777 log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4" PRIx64 " to run thread plan \"%s\".",
4827 // We usually want to resume the process if we get to the top of the loop.
4861 log->Printf ("Process::RunThreadPlan(): didn't get any event after resume %d, exiting.",
4869 stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
4877 restarted = Process::ProcessEventData::GetRestartedFromEvent(event_sp.get());
4879 log->Printf("Process::RunThreadPlan(): didn't get running event after "
4902 log->PutCString ("Process::RunThreadPlan(): resuming succeeded.");
4912 log->PutCString ("Process::RunThreadPlan(): waiting for next event.");
4938 // Now wait for the process to stop again:
4945 log->Printf ("Process::RunThreadPlan(): about to wait - now is %" PRIu64 " - endpoint is %" PRIu64,
4951 log->Printf ("Process::RunThreadPlan(): about to wait forever.");
4968 log->Printf ("Process::RunThreadPlan(): Got interrupted by eBroadcastBitInterrupted, exiting.");
4973 stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
4975 log->Printf("Process::RunThreadPlan(): in while loop, got event: %s.", StateAsCString(stop_state));
4987 log->Printf ("Process::RunThreadPlan(): execution completed but our thread (index-id=%u) has vanished.", thread_idx_id);
4993 if (Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
4997 log->Printf ("Process::RunThreadPlan(): Got a stop and restart, so we'll continue waiting.");
5018 log->PutCString ("Process::RunThreadPlan(): execution completed successfully.");
5031 log->Printf ("Process::RunThreadPlan() stopped for breakpoint: %s.", stop_info_sp->GetDescription());
5041 log->PutCString ("Process::RunThreadPlan(): thread plan didn't successfully complete.");
5062 log->Printf("Process::RunThreadPlan(): execution stopped with unexpected state: %s.", StateAsCString(stop_state));
5081 log->PutCString ("Process::RunThreadPlan(): got_event was true, but the event pointer was null. How odd...");
5089 // We will interrupt the process here. Depending on what we were asked to do we will
5097 log->Printf ("Process::RunThreadPlan(): Running function with one thread timeout timed out, "
5101 log->Printf ("Process::RunThreadPlan(): Restarting function with all threads enabled "
5106 log->Printf ("Process::RunThreadPlan(): Running function with timeout: %d timed out, "
5127 log->Printf ("Process::RunThreadPlan(): Running Halt.");
5133 log->PutCString ("Process::RunThreadPlan(): Halt succeeded.");
5142 stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
5145 log->Printf ("Process::RunThreadPlan(): Stopped with event: %s", StateAsCString(stop_state));
5147 && Process::ProcessEventData::GetInterruptedFromEvent(event_sp.get()))
5153 // Between the time we initiated the Halt and the time we delivered it, the process could have
5159 log->PutCString ("Process::RunThreadPlan(): Even though we timed out, the call plan was done. "
5166 if (Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
5169 log->PutCString ("Process::RunThreadPlan(): Went to halt but got a restarted event, there must be an un-restarted stopped event so try again... "
5179 log->PutCString ("Process::RunThreadPlan(): try_all_threads was false, we stopped so now we're quitting.");
5191 log->PutCString ("Process::RunThreadPlan(): about to resume.");
5200 log->PutCString("Process::RunThreadPlan(): running all threads timed out.");
5209 log->PutCString("Process::RunThreadPlan(): halt said it succeeded, but I got no event. "
5268 log->PutCString ("Process::RunThreadPlan(): Stop event that interrupted us is NULL.");
5289 const Process::ProcessEventData *event_data = Process::ProcessEventData::GetEventDataFromEvent (event_sp.get());
5297 Process *process = event_data->GetProcessSP().get();
5299 if (!process)
5301 event_explanation = "<no process>";
5305 ThreadList &thread_list = process->GetThreadList();
5347 log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s", s.GetData(), event_explanation);
5349 log->Printf("Process::RunThreadPlan(): execution interrupted: %s", s.GetData());
5355 log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - discarding thread plans up to %p.", thread_plan_sp.get());
5362 log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - for plan: %p not discarding.", thread_plan_sp.get());
5368 log->PutCString("Process::RunThreadPlan(): execution set up error.");
5381 log->PutCString("Process::RunThreadPlan(): thread plan is done");
5387 log->PutCString("Process::RunThreadPlan(): thread plan was discarded");
5393 log->PutCString("Process::RunThreadPlan(): thread plan stopped in mid course");
5397 log->PutCString("Process::RunThreadPlan(): discarding thread plan 'cause unwind_on_error is set.");
5413 // Also restore the current process'es selected frame & thread, since this function calling may
5429 // If the process exited during the run of the thread plan, notify everyone.
5434 log->PutCString("Process::RunThreadPlan(): rebroadcasting event.");
5442 Process::ExecutionResultAsCString (ExecutionResults result)
5471 Process::GetStatus (Stream &strm)
5480 strm.Printf ("Process %" PRIu64 " exited with status = %i (0x%8.8x) %s\n",
5491 strm.Printf ("Process %" PRIu64 " %s\n", GetID(), StateAsCString (state));
5496 strm.Printf ("Process %" PRIu64 " is running.\n", GetID());
5501 Process::GetThreadStatus (Stream &strm,
5533 Process::AddInvalidMemoryRegion (const LoadRange &region)
5539 Process::RemoveInvalidMemoryRange (const LoadRange &region)
5545 Process::AddPreResumeAction (PreResumeActionCallback callback, void *baton)
5551 Process::RunPreResumeActions ()
5565 Process::ClearPreResumeActions ()
5571 Process::Flush ()
5577 Process::DidExec ()