LLDB  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
lldb_private::Process Class Referenceabstract

A plug-in interface definition class for debugging a process. More...

#include "lldb/Target/Process.h"

Inheritance diagram for lldb_private::Process:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Process:
Collaboration graph
[legend]

Classes

class  AttachCompletionHandler
 
class  NextEventAction
 
struct  Notifications
 A notification structure that can be used by clients to listen for changes in a process's lifetime. More...
 
struct  PreResumeCallbackAndBaton
 
class  ProcessEventData
 
class  ProcessEventHijacker
 

Public Types

enum  {
  eBroadcastBitStateChanged = (1 << 0), eBroadcastBitInterrupt = (1 << 1), eBroadcastBitSTDOUT = (1 << 2), eBroadcastBitSTDERR = (1 << 3),
  eBroadcastBitProfileData = (1 << 4), eBroadcastBitStructuredData = (1 << 5)
}
 Broadcaster event bits definitions. More...
 
enum  { eBroadcastInternalStateControlStop = (1 << 0), eBroadcastInternalStateControlPause = (1 << 1), eBroadcastInternalStateControlResume = (1 << 2) }
 
enum  Warnings { eWarningsOptimization = 1 }
 Process warning types. More...
 
typedef Range< lldb::addr_t, lldb::addr_tLoadRange
 
typedef ProcessRunLock::ProcessRunLocker StopLocker
 
typedef bool() PreResumeActionCallback(void *)
 

Public Member Functions

ConstStringGetBroadcasterClass () const override
 
 Process (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp)
 Construct with a shared pointer to a target, and the Process listener. More...
 
 Process (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb::UnixSignalsSP &unix_signals_sp)
 Construct with a shared pointer to a target, the Process listener, and the appropriate UnixSignalsSP for the process. More...
 
 ~Process () override
 Destructor. More...
 
lldb::ByteOrder GetByteOrder () const
 
uint32_t GetAddressByteSize () const
 
uint32_t GetUniqueID () const
 
virtual bool CanDebug (lldb::TargetSP target, bool plugin_specified_by_name)=0
 Check if a plug-in instance can debug the file in module. More...
 
virtual void Finalize ()
 This object is about to be destroyed, do any necessary cleanup. More...
 
bool IsValid () const
 Return whether this object is valid (i.e. More...
 
virtual CommandObjectGetPluginCommandObject ()
 Return a multi-word command object that can be used to expose plug-in specific commands. More...
 
virtual Status Launch (ProcessLaunchInfo &launch_info)
 Launch a new process. More...
 
virtual Status LoadCore ()
 
virtual Status DoLoadCore ()
 
UtilityFunctionGetLoadImageUtilityFunction (Platform *platform, llvm::function_ref< std::unique_ptr< UtilityFunction >()> factory)
 Get the cached UtilityFunction that assists in loading binary images into the process. More...
 
virtual DynamicLoaderGetDynamicLoader ()
 Get the dynamic loader plug-in for this process. More...
 
virtual const lldb::DataBufferSP GetAuxvData ()
 
virtual size_t LoadModules ()
 Sometimes processes know how to retrieve and load shared libraries. More...
 
virtual size_t LoadModules (LoadedModuleInfoList &)
 
virtual SystemRuntimeGetSystemRuntime ()
 Get the system runtime plug-in for this process. More...
 
virtual Status Attach (ProcessAttachInfo &attach_info)
 Attach to an existing process using the process attach info. More...
 
virtual Status ConnectRemote (Stream *strm, llvm::StringRef remote_url)
 Attach to a remote system via a URL. More...
 
bool GetShouldDetach () const
 
void SetShouldDetach (bool b)
 
virtual lldb::addr_t GetImageInfoAddress ()
 Get the image information address for the current process. More...
 
virtual void WillPublicStop ()
 Called when the process is about to broadcast a public stop. More...
 
void RegisterNotificationCallbacks (const Process::Notifications &callbacks)
 Register for process and thread notifications. More...
 
bool UnregisterNotificationCallbacks (const Process::Notifications &callbacks)
 Unregister for process and thread notifications. More...
 
Status Resume ()
 Resumes all of a process's threads as configured using the Thread run control functions. More...
 
Status ResumeSynchronous (Stream *stream)
 
Status Halt (bool clear_thread_plans=false, bool use_run_lock=true)
 Halts a running process. More...
 
Status Detach (bool keep_stopped)
 Detaches from a running or stopped process. More...
 
Status Destroy (bool force_kill)
 Kills the process and shuts down all threads that were spawned to track and monitor the process. More...
 
Status Signal (int signal)
 Sends a process a UNIX signal signal. More...
 
void SetUnixSignals (lldb::UnixSignalsSP &&signals_sp)
 
const lldb::UnixSignalsSP & GetUnixSignals ()
 
virtual Status WillAttachToProcessWithID (lldb::pid_t pid)
 Called before attaching to a process. More...
 
virtual Status WillAttachToProcessWithName (const char *process_name, bool wait_for_launch)
 Called before attaching to a process. More...
 
virtual Status DoConnectRemote (Stream *strm, llvm::StringRef remote_url)
 Attach to a remote system via a URL. More...
 
virtual Status DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info)
 Attach to an existing process using a process ID. More...
 
virtual Status DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info)
 Attach to an existing process using a partial process name. More...
 
virtual void DidAttach (ArchSpec &process_arch)
 Called after attaching a process. More...
 
virtual void DidExec ()
 Called after a process re-execs itself. More...
 
virtual void DoDidExec ()
 Subclasses of Process should implement this function if they need to do anything after a process exec's itself. More...
 
virtual Status WillLaunch (Module *module)
 Called before launching to a process. More...
 
virtual Status DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info)
 Launch a new process. More...
 
virtual void DidLaunch ()
 Called after launching a process. More...
 
virtual Status WillResume ()
 Called before resuming to a process. More...
 
virtual Status DoResume ()
 Resumes all of a process's threads as configured using the Thread run control functions. More...
 
virtual void DidResume ()
 Called after resuming a process. More...
 
virtual Status WillHalt ()
 Called before halting to a process. More...
 
virtual Status DoHalt (bool &caused_stop)
 Halts a running process. More...
 
virtual void DidHalt ()
 Called after halting a process. More...
 
virtual Status WillDetach ()
 Called before detaching from a process. More...
 
virtual Status DoDetach (bool keep_stopped)
 Detaches from a running or stopped process. More...
 
virtual void DidDetach ()
 Called after detaching from a process. More...
 
virtual bool DetachRequiresHalt ()
 
virtual Status WillSignal ()
 Called before sending a signal to a process. More...
 
virtual Status DoSignal (int signal)
 Sends a process a UNIX signal signal. More...
 
virtual Status WillDestroy ()
 
virtual Status DoDestroy ()=0
 
virtual void DidDestroy ()
 
virtual bool DestroyRequiresHalt ()
 
virtual void DidSignal ()
 Called after sending a signal to a process. More...
 
virtual void RefreshStateAfterStop ()=0
 Currently called as part of ShouldStop. More...
 
virtual llvm::VersionTuple GetHostOSVersion ()
 Sometimes the connection to a process can detect the host OS version that the process is running on. More...
 
TargetGetTarget ()
 Get the target object pointer for this module. More...
 
const TargetGetTarget () const
 Get the const target object pointer for this module. More...
 
void Flush ()
 Flush all data in the process. More...
 
lldb::StateType GetState ()
 Get accessor for the current process state. More...
 
lldb::ExpressionResults RunThreadPlan (ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
 
void GetStatus (Stream &ostrm)
 
size_t GetThreadStatus (Stream &ostrm, bool only_threads_with_stop_reason, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format)
 
void SendAsyncInterrupt ()
 
virtual void ModulesDidLoad (ModuleList &module_list)
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_address, lldb::addr_t image_count)
 Retrieve the list of shared libraries that are loaded for this process This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre- watchOS 3 systems. More...
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos ()
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (const std::vector< lldb::addr_t > &load_addresses)
 
virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo ()
 
void PrintWarningOptimization (const SymbolContext &sc)
 Print a user-visible warning about a module being built with optimization. More...
 
virtual bool GetProcessInfo (ProcessInstanceInfo &info)
 
int GetExitStatus ()
 Get the exit status for a process. More...
 
const char * GetExitDescription ()
 Get a textual description of what the process exited. More...
 
virtual void DidExit ()
 
ProcessModID GetModID () const
 Get the Modification ID of the process. More...
 
const ProcessModIDGetModIDRef () const
 
uint32_t GetStopID () const
 
uint32_t GetResumeID () const
 
uint32_t GetLastUserExpressionResumeID () const
 
uint32_t GetLastNaturalStopID () const
 
lldb::EventSP GetStopEventForStopID (uint32_t stop_id) const
 
virtual bool SetExitStatus (int exit_status, const char *cstr)
 Set accessor for the process exit status (return code). More...
 
virtual bool IsAlive ()
 Check if a process is still alive. More...
 
virtual bool WarnBeforeDetach () const
 Before lldb detaches from a process, it warns the user that they are about to lose their debug session. More...
 
virtual size_t DoReadMemory (lldb::addr_t vm_addr, void *buf, size_t size, Status &error)=0
 Actually do the reading of memory from a process. More...
 
virtual size_t ReadMemory (lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
 Read of memory from a process. More...
 
size_t ReadMemoryFromInferior (lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
 Read of memory from a process. More...
 
size_t ReadStringFromMemory (lldb::addr_t vm_addr, char *str, size_t max_bytes, Status &error, size_t type_width=1)
 Read a NULL terminated string from memory. More...
 
size_t ReadCStringFromMemory (lldb::addr_t vm_addr, char *cstr, size_t cstr_max_len, Status &error)
 Read a NULL terminated C string from memory. More...
 
size_t ReadCStringFromMemory (lldb::addr_t vm_addr, std::string &out_str, Status &error)
 
uint64_t ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Status &error)
 Reads an unsigned integer of the specified byte size from process memory. More...
 
int64_t ReadSignedIntegerFromMemory (lldb::addr_t load_addr, size_t byte_size, int64_t fail_value, Status &error)
 
lldb::addr_t ReadPointerFromMemory (lldb::addr_t vm_addr, Status &error)
 
bool WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Status &error)
 
virtual size_t DoWriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
 Actually do the writing of memory to a process. More...
 
size_t WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, size_t size, Status &error)
 Write all or part of a scalar value to memory. More...
 
size_t ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Status &error)
 
size_t WriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
 Write memory to a process. More...
 
virtual lldb::addr_t DoAllocateMemory (size_t size, uint32_t permissions, Status &error)
 Actually allocate memory in the process. More...
 
virtual Status WriteObjectFile (std::vector< ObjectFile::LoadableData > entries)
 
lldb::addr_t AllocateMemory (size_t size, uint32_t permissions, Status &error)
 The public interface to allocating memory in the process. More...
 
lldb::addr_t CallocateMemory (size_t size, uint32_t permissions, Status &error)
 The public interface to allocating memory in the process, this also clears the allocated memory. More...
 
virtual lldb::addr_t ResolveIndirectFunction (const Address *address, Status &error)
 Resolve dynamically loaded indirect functions. More...
 
virtual Status GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info)
 Locate the memory region that contains load_addr. More...
 
virtual Status GetMemoryRegions (lldb_private::MemoryRegionInfos &region_list)
 Obtain all the mapped memory regions within this process. More...
 
virtual Status GetWatchpointSupportInfo (uint32_t &num)
 
virtual Status GetWatchpointSupportInfo (uint32_t &num, bool &after)
 
lldb::ModuleSP ReadModuleFromMemory (const FileSpec &file_spec, lldb::addr_t header_addr, size_t size_to_read=512)
 
virtual bool GetLoadAddressPermissions (lldb::addr_t load_addr, uint32_t &permissions)
 Attempt to get the attributes for a region of memory in the process. More...
 
bool CanJIT ()
 Determines whether executing JIT-compiled code in this process is possible. More...
 
void SetCanJIT (bool can_jit)
 Sets whether executing JIT-compiled code in this process is possible. More...
 
bool CanInterpretFunctionCalls ()
 Determines whether executing function calls using the interpreter is possible for this process. More...
 
void SetCanInterpretFunctionCalls (bool can_interpret_function_calls)
 Sets whether executing function calls using the interpreter is possible for this process. More...
 
void SetCanRunCode (bool can_run_code)
 Sets whether executing code in this process is possible. More...
 
virtual Status DoDeallocateMemory (lldb::addr_t ptr)
 Actually deallocate memory in the process. More...
 
Status DeallocateMemory (lldb::addr_t ptr)
 The public interface to deallocating memory in the process. More...
 
virtual size_t GetSTDOUT (char *buf, size_t buf_size, Status &error)
 Get any available STDOUT. More...
 
virtual size_t GetSTDERR (char *buf, size_t buf_size, Status &error)
 Get any available STDERR. More...
 
virtual size_t PutSTDIN (const char *buf, size_t buf_size, Status &error)
 Puts data into this process's STDIN. More...
 
virtual size_t GetAsyncProfileData (char *buf, size_t buf_size, Status &error)
 Get any available profile data. More...
 
size_t GetSoftwareBreakpointTrapOpcode (BreakpointSite *bp_site)
 
virtual Status EnableBreakpointSite (BreakpointSite *bp_site)
 
virtual Status DisableBreakpointSite (BreakpointSite *bp_site)
 
virtual Status EnableSoftwareBreakpoint (BreakpointSite *bp_site)
 
virtual Status DisableSoftwareBreakpoint (BreakpointSite *bp_site)
 
BreakpointSiteListGetBreakpointSiteList ()
 
const BreakpointSiteListGetBreakpointSiteList () const
 
void DisableAllBreakpointSites ()
 
Status ClearBreakpointSiteByID (lldb::user_id_t break_id)
 
lldb::break_id_t CreateBreakpointSite (const lldb::BreakpointLocationSP &owner, bool use_hardware)
 
Status DisableBreakpointSiteByID (lldb::user_id_t break_id)
 
Status EnableBreakpointSiteByID (lldb::user_id_t break_id)
 
void RemoveOwnerFromBreakpointSite (lldb::user_id_t owner_id, lldb::user_id_t owner_loc_id, lldb::BreakpointSiteSP &bp_site_sp)
 
virtual Status EnableWatchpoint (Watchpoint *wp, bool notify=true)
 
virtual Status DisableWatchpoint (Watchpoint *wp, bool notify=true)
 
virtual bool UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)=0
 
void UpdateThreadListIfNeeded ()
 
ThreadListGetThreadList ()
 
ThreadListGetExtendedThreadList ()
 
ThreadList::ThreadIterable Threads ()
 
uint32_t GetNextThreadIndexID (uint64_t thread_id)
 
lldb::ThreadSP CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context)
 
bool HasAssignedIndexIDToThread (uint64_t sb_thread_id)
 
uint32_t AssignIndexIDToThread (uint64_t thread_id)
 
void UpdateQueueListIfNeeded ()
 
QueueListGetQueueList ()
 
QueueList::QueueIterable Queues ()
 
lldb::StateType GetNextEvent (lldb::EventSP &event_sp)
 
lldb::StateType WaitForProcessToStop (const Timeout< std::micro > &timeout, lldb::EventSP *event_sp_ptr=nullptr, bool wait_always=true, lldb::ListenerSP hijack_listener=lldb::ListenerSP(), Stream *stream=nullptr, bool use_run_lock=true)
 
uint32_t GetIOHandlerID () const
 
void SyncIOHandler (uint32_t iohandler_id, const Timeout< std::micro > &timeout)
 Waits for the process state to be running within a given msec timeout. More...
 
lldb::StateType GetStateChangedEvents (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout, lldb::ListenerSP hijack_listener)
 
EventPeekAtStateChangedEvents ()
 
bool HijackProcessEvents (lldb::ListenerSP listener_sp)
 If you need to ensure that you and only you will hear about some public event, then make a new listener, set to listen to process events, and then call this with that listener. More...
 
void RestoreProcessEvents ()
 Restores the process event broadcasting to its normal state. More...
 
bool StateChangedIsHijackedForSynchronousResume ()
 
bool StateChangedIsExternallyHijacked ()
 
const lldb::ABISP & GetABI ()
 
OperatingSystemGetOperatingSystem ()
 
virtual LanguageRuntimeGetLanguageRuntime (lldb::LanguageType language, bool retry_if_null=true)
 
virtual CPPLanguageRuntimeGetCPPLanguageRuntime (bool retry_if_null=true)
 
virtual ObjCLanguageRuntimeGetObjCLanguageRuntime (bool retry_if_null=true)
 
bool IsPossibleDynamicValue (ValueObject &in_value)
 
bool IsRunning () const
 
DynamicCheckerFunctionsGetDynamicCheckers ()
 
void SetDynamicCheckers (DynamicCheckerFunctions *dynamic_checkers)
 
virtual bool StartNoticingNewThreads ()
 Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts. More...
 
virtual bool StopNoticingNewThreads ()
 Call this to turn off the stop & notice new threads mode. More...
 
void SetRunningUserExpression (bool on)
 
void SetRunningUtilityFunction (bool on)
 
lldb::TargetSP CalculateTarget () override
 
lldb::ProcessSP CalculateProcess () override
 
lldb::ThreadSP CalculateThread () override
 
lldb::StackFrameSP CalculateStackFrame () override
 
void CalculateExecutionContext (ExecutionContext &exe_ctx) override
 Reconstruct the object's execution context into sc. More...
 
void SetSTDIOFileDescriptor (int file_descriptor)
 
void AddInvalidMemoryRegion (const LoadRange &region)
 
bool RemoveInvalidMemoryRange (const LoadRange &region)
 
void AddPreResumeAction (PreResumeActionCallback callback, void *baton)
 
bool RunPreResumeActions ()
 
void ClearPreResumeActions ()
 
void ClearPreResumeAction (PreResumeActionCallback callback, void *baton)
 
ProcessRunLockGetRunLock ()
 
virtual Status SendEventData (const char *data)
 
lldb::ThreadCollectionSP GetHistoryThreads (lldb::addr_t addr)
 
lldb::InstrumentationRuntimeSP GetInstrumentationRuntime (lldb::InstrumentationRuntimeType type)
 
virtual bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec)
 Try to fetch the module specification for a module with the given file name and architecture. More...
 
virtual void PrefetchModuleSpecs (llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple)
 
virtual Status GetFileLoadAddress (const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr)
 Try to find the load address of a file. More...
 
size_t AddImageToken (lldb::addr_t image_ptr)
 
lldb::addr_t GetImagePtrFromToken (size_t token) const
 
void ResetImageToken (size_t token)
 
Address AdvanceAddressToNextBranchInstruction (Address default_stop_addr, AddressRange range_bounds)
 Find the next branch instruction to set a breakpoint on. More...
 
virtual Status ConfigureStructuredData (ConstString type_name, const StructuredData::ObjectSP &config_sp)
 Configure asynchronous structured data feature. More...
 
void BroadcastStructuredData (const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp)
 Broadcasts the given structured data object from the given plugin. More...
 
lldb::StructuredDataPluginSP GetStructuredDataPlugin (ConstString type_name) const
 Returns the StructuredDataPlugin associated with a given type name, if there is one. More...
 
virtual lldb::user_id_t StartTrace (const TraceOptions &options, Status &error)
 Starts tracing with the configuration provided in options. More...
 
virtual Status StopTrace (lldb::user_id_t uid, lldb::tid_t thread_id)
 Stops the tracing instance leading to deletion of the trace data. More...
 
virtual Status GetData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 Provides the trace data as raw bytes. More...
 
virtual Status GetMetaData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 Similar API as above except for obtaining meta data. More...
 
virtual Status GetTraceConfig (lldb::user_id_t uid, TraceOptions &options)
 API to obtain the trace configuration used by a trace instance. More...
 
- Public Member Functions inherited from lldb_private::ProcessProperties
 ProcessProperties (lldb_private::Process *process)
 
 ~ProcessProperties () override
 
bool GetDisableMemoryCache () const
 
uint64_t GetMemoryCacheLineSize () const
 
Args GetExtraStartupCommands () const
 
void SetExtraStartupCommands (const Args &args)
 
FileSpec GetPythonOSPluginPath () const
 
void SetPythonOSPluginPath (const FileSpec &file)
 
bool GetIgnoreBreakpointsInExpressions () const
 
void SetIgnoreBreakpointsInExpressions (bool ignore)
 
bool GetUnwindOnErrorInExpressions () const
 
void SetUnwindOnErrorInExpressions (bool ignore)
 
bool GetStopOnSharedLibraryEvents () const
 
void SetStopOnSharedLibraryEvents (bool stop)
 
bool GetDetachKeepsStopped () const
 
void SetDetachKeepsStopped (bool keep_stopped)
 
bool GetWarningsOptimization () const
 
bool GetStopOnExec () const
 
std::chrono::seconds GetUtilityExpressionTimeout () const
 
- Public Member Functions inherited from lldb_private::Properties
 Properties ()
 
 Properties (const lldb::OptionValuePropertiesSP &collection_sp)
 
virtual ~Properties ()
 
virtual lldb::OptionValuePropertiesSP GetValueProperties () const
 
virtual lldb::OptionValueSP GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, bool will_modify, Status &error) const
 
virtual Status SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value)
 
virtual Status DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask)
 
virtual void DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
 
virtual void DumpAllDescriptions (CommandInterpreter &interpreter, Stream &strm) const
 
size_t Apropos (llvm::StringRef keyword, std::vector< const Property *> &matching_properties) const
 
lldb::OptionValuePropertiesSP GetSubProperty (const ExecutionContext *exe_ctx, ConstString name)
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 
- Public Member Functions inherited from lldb_private::Broadcaster
 Broadcaster (lldb::BroadcasterManagerSP manager_sp, const char *name)
 Construct with a broadcaster with a name. More...
 
virtual ~Broadcaster ()
 Destructor. More...
 
void CheckInWithManager ()
 
void BroadcastEvent (lldb::EventSP &event_sp)
 Broadcast an event which has no associated data. More...
 
void BroadcastEventIfUnique (lldb::EventSP &event_sp)
 
void BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp)
 
void BroadcastEvent (uint32_t event_type, EventData *event_data=nullptr)
 
void BroadcastEventIfUnique (uint32_t event_type, EventData *event_data=nullptr)
 
void Clear ()
 
virtual void AddInitialEventsToListener (const lldb::ListenerSP &listener_sp, uint32_t requested_events)
 
uint32_t AddListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask)
 Listen for any events specified by event_mask. More...
 
ConstString GetBroadcasterName ()
 Get the NULL terminated C string name of this Broadcaster object. More...
 
bool GetEventNames (Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const
 Get the event name(s) for one or more event bits. More...
 
void SetEventName (uint32_t event_mask, const char *name)
 Set the name for an event bit. More...
 
const char * GetEventName (uint32_t event_mask) const
 
bool EventTypeHasListeners (uint32_t event_type)
 
bool RemoveListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Removes a Listener from this broadcasters list and frees the event bits specified by event_mask that were previously acquired by listener (assuming listener was listening to this object) for other listener objects to use. More...
 
bool HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Provides a simple mechanism to temporarily redirect events from broadcaster. More...
 
bool IsHijackedForEvent (uint32_t event_mask)
 
void RestoreBroadcaster ()
 Restore the state of the Broadcaster from a previous hijack attempt. More...
 
lldb::BroadcasterManagerSP GetManager ()
 
- Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()
 
- Public Member Functions inherited from lldb_private::PluginInterface
virtual ~PluginInterface ()
 
virtual ConstString GetPluginName ()=0
 
virtual uint32_t GetPluginVersion ()=0
 

Static Public Member Functions

static ConstStringGetStaticBroadcasterClass ()
 
static void SettingsInitialize ()
 
static void SettingsTerminate ()
 
static const ProcessPropertiesSPGetGlobalProperties ()
 
static lldb::ProcessSP FindPlugin (lldb::TargetSP target_sp, llvm::StringRef plugin_name, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path)
 Find a Process plug-in that can debug module using the currently selected architecture. More...
 
static bool SetProcessExitStatus (lldb::pid_t pid, bool exited, int signo, int status)
 Static function that can be used with the host function Host::StartMonitoringChildProcess (). More...
 
static const char * ExecutionResultAsCString (lldb::ExpressionResults result)
 
static bool HandleProcessStateChangedEvent (const lldb::EventSP &event_sp, Stream *stream, bool &pop_process_io_handler)
 Centralize the code that handles and prints descriptions for process state changes. More...
 
- Static Public Member Functions inherited from lldb_private::Properties
static const char * GetExperimentalSettingsName ()
 
static bool IsSettingExperimental (llvm::StringRef setting)
 

Protected Types

enum  { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo }
 
typedef std::map< lldb::LanguageType, lldb::LanguageRuntimeSP > LanguageRuntimeCollection
 
typedef std::unordered_set< const void * > WarningsPointerSet
 
typedef std::map< uint64_t, WarningsPointerSetWarningsCollection
 
using StructuredDataPluginMap = std::map< ConstString, lldb::StructuredDataPluginSP >
 
- Protected Types inherited from lldb_private::Broadcaster
typedef std::shared_ptr< BroadcasterImplBroadcasterImplSP
 
typedef std::weak_ptr< BroadcasterImplBroadcasterImplWP
 

Protected Member Functions

virtual JITLoaderListGetJITLoaders ()
 
void SetState (lldb::EventSP &event_sp)
 
lldb::StateType GetPrivateState ()
 
Status PrivateResume ()
 The "private" side of resuming a process. More...
 
void CompleteAttach ()
 
void PrintWarning (uint64_t warning_type, const void *repeat_key, const char *fmt,...) __attribute__((format(printf
 Print a user-visible warning one time per Process. More...
 
void SetNextEventAction (Process::NextEventAction *next_event_action)
 
bool PrivateStateThreadIsValid () const
 
void ForceNextEventDelivery ()
 
void MapSupportedStructuredDataPlugins (const StructuredData::Array &supported_type_names)
 Loads any plugins associated with asynchronous structured data and maps the relevant supported type name to the plugin. More...
 
bool RouteAsyncStructuredData (const StructuredData::ObjectSP object_sp)
 Route the incoming structured data dictionary to the right plugin. More...
 
size_t RemoveBreakpointOpcodesFromBuffer (lldb::addr_t addr, size_t size, uint8_t *buf) const
 
void SynchronouslyNotifyStateChanged (lldb::StateType state)
 
void SetPublicState (lldb::StateType new_state, bool restarted)
 
void SetPrivateState (lldb::StateType state)
 
bool StartPrivateStateThread (bool is_secondary_thread=false)
 
void StopPrivateStateThread ()
 
void PausePrivateStateThread ()
 
void ResumePrivateStateThread ()
 
void HandlePrivateEvent (lldb::EventSP &event_sp)
 
Status HaltPrivate ()
 
lldb::StateType WaitForProcessStopPrivate (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
 
bool GetEventsPrivate (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout, bool control_only)
 
lldb::StateType GetStateChangedEventsPrivate (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
 
size_t WriteMemoryPrivate (lldb::addr_t addr, const void *buf, size_t size, Status &error)
 
void AppendSTDOUT (const char *s, size_t len)
 
void AppendSTDERR (const char *s, size_t len)
 
void BroadcastAsyncProfileData (const std::string &one_profile_data)
 
bool PushProcessIOHandler ()
 
bool PopProcessIOHandler ()
 
bool ProcessIOHandlerIsActive ()
 
bool ProcessIOHandlerExists () const
 
Status StopForDestroyOrDetach (lldb::EventSP &exit_event_sp)
 
virtual Status UpdateAutomaticSignalFiltering ()
 
void LoadOperatingSystemPlugin (bool flush)
 
- Protected Member Functions inherited from lldb_private::Broadcaster
BroadcasterImplSP GetBroadcasterImpl ()
 
const char * GetHijackingListenerName ()
 

Static Protected Member Functions

static void STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len)
 
- Static Protected Member Functions inherited from lldb_private::ProcessProperties
static void OptionValueChangedCallback (void *baton, OptionValue *option_value)
 

Protected Attributes

std::weak_ptr< Targetm_target_wp
 The target that owns this process. More...
 
ThreadSafeValue< lldb::StateTypem_public_state
 
ThreadSafeValue< lldb::StateTypem_private_state
 
Broadcaster m_private_state_broadcaster
 
Broadcaster m_private_state_control_broadcaster
 
lldb::ListenerSP m_private_state_listener_sp
 
HostThread m_private_state_thread
 Thread ID for the thread that watches internal state events. More...
 
ProcessModID m_mod_id
 Tracks the state of the process over stops and other alterations. More...
 
uint32_t m_process_unique_id
 Each lldb_private::Process class that is created gets a unique integer ID that increments with each new instance. More...
 
uint32_t m_thread_index_id
 Each thread is created with a 1 based index that won't get re-used. More...
 
std::map< uint64_t, uint32_tm_thread_id_to_index_id_map
 
int m_exit_status
 The exit status of the process, or -1 if not set. More...
 
std::string m_exit_string
 A textual description of why a process exited. More...
 
std::mutex m_exit_status_mutex
 Mutex so m_exit_status m_exit_string can be safely accessed from multiple threads. More...
 
std::recursive_mutex m_thread_mutex
 
ThreadList m_thread_list_real
 The threads for this process as are known to the protocol we are debugging with. More...
 
ThreadList m_thread_list
 The threads for this process as the user will see them. More...
 
ThreadList m_extended_thread_list
 Owner for extended threads that may be generated, cleared on natural stops. More...
 
uint32_t m_extended_thread_stop_id
 The natural stop id when extended_thread_list was last updated. More...
 
QueueList m_queue_list
 The list of libdispatch queues at a given stop point. More...
 
uint32_t m_queue_list_stop_id
 The natural stop id when queue list was last fetched. More...
 
std::vector< Notificationsm_notifications
 The list of notifications that this process can deliver. More...
 
std::vector< lldb::addr_tm_image_tokens
 
lldb::ListenerSP m_listener_sp
 Shared pointer to the listener used for public events. More...
 
BreakpointSiteList m_breakpoint_site_list
 This is the list of breakpoint locations we intend to insert in the target. More...
 
lldb::DynamicLoaderUP m_dyld_up
 
lldb::JITLoaderListUP m_jit_loaders_up
 
lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_up
 The functions used by the expression parser to validate data that expressions use. More...
 
lldb::OperatingSystemUP m_os_up
 
lldb::SystemRuntimeUP m_system_runtime_up
 
lldb::UnixSignalsSP m_unix_signals_sp
 
lldb::ABISP m_abi_sp
 This is the current signal set for this process. More...
 
lldb::IOHandlerSP m_process_input_reader
 
Communication m_stdio_communication
 
std::recursive_mutex m_stdio_communication_mutex
 
bool m_stdin_forward
 
std::string m_stdout_data
 Remember if stdin must be forwarded to remote debug server. More...
 
std::string m_stderr_data
 
std::recursive_mutex m_profile_data_comm_mutex
 
std::vector< std::string > m_profile_data
 
Predicate< uint32_tm_iohandler_sync
 
MemoryCache m_memory_cache
 
AllocatedMemoryCache m_allocated_memory_cache
 
bool m_should_detach
 
LanguageRuntimeCollection m_language_runtimes
 Should we detach if the process object goes away with an explicit call to Kill or Detach? More...
 
InstrumentationRuntimeCollection m_instrumentation_runtimes
 
std::unique_ptr< NextEventActionm_next_event_action_up
 
std::vector< PreResumeCallbackAndBatonm_pre_resume_actions
 
ProcessRunLock m_public_run_lock
 
ProcessRunLock m_private_run_lock
 
bool m_currently_handling_do_on_removals
 
bool m_resume_requested
 
bool m_finalizing
 
bool m_finalize_called
 
bool m_clear_thread_plans_on_stop
 
bool m_force_next_event_delivery
 
lldb::StateType m_last_broadcast_state
 
std::map< lldb::addr_t, lldb::addr_tm_resolved_indirect_addresses
 This helps with the Public event coalescing in ShouldBroadcastEvent. More...
 
bool m_destroy_in_process
 
bool m_can_interpret_function_calls
 
WarningsCollection m_warnings_issued
 
std::mutex m_run_thread_plan_lock
 
StructuredDataPluginMap m_structured_data_plugin_map
 
enum lldb_private::Process:: { ... }  m_can_jit
 
std::unique_ptr< UtilityFunctionm_dlopen_utility_func_up
 
std::once_flag m_dlopen_utility_func_flag_once
 
- Protected Attributes inherited from lldb_private::ProcessProperties
Processm_process
 
- Protected Attributes inherited from lldb_private::Properties
lldb::OptionValuePropertiesSP m_collection_sp
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 

Friends

class FunctionCaller
 
class Debugger
 
class DynamicLoader
 
class ProcessEventData
 
class StopInfo
 
class Target
 
class ThreadList
 
class ProcessEventHijacker
 
class ProcessProperties
 

Detailed Description

A plug-in interface definition class for debugging a process.

Definition at line 353 of file Process.h.

Member Typedef Documentation

◆ LanguageRuntimeCollection

typedef std::map<lldb::LanguageType, lldb::LanguageRuntimeSP> lldb_private::Process::LanguageRuntimeCollection
protected

Definition at line 2608 of file Process.h.

◆ LoadRange

Definition at line 387 of file Process.h.

◆ PreResumeActionCallback

typedef bool() lldb_private::Process::PreResumeActionCallback(void *)

Definition at line 2253 of file Process.h.

◆ StopLocker

Definition at line 394 of file Process.h.

◆ StructuredDataPluginMap

using lldb_private::Process::StructuredDataPluginMap = std::map<ConstString, lldb::StructuredDataPluginSP>
protected

Definition at line 2624 of file Process.h.

◆ WarningsCollection

typedef std::map<uint64_t, WarningsPointerSet> lldb_private::Process::WarningsCollection
protected

Definition at line 2610 of file Process.h.

◆ WarningsPointerSet

typedef std::unordered_set<const void *> lldb_private::Process::WarningsPointerSet
protected

Definition at line 2609 of file Process.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Broadcaster event bits definitions.

Enumerator
eBroadcastBitStateChanged 
eBroadcastBitInterrupt 
eBroadcastBitSTDOUT 
eBroadcastBitSTDERR 
eBroadcastBitProfileData 
eBroadcastBitStructuredData 

Definition at line 369 of file Process.h.

◆ anonymous enum

anonymous enum
Enumerator
eBroadcastInternalStateControlStop 
eBroadcastInternalStateControlPause 
eBroadcastInternalStateControlResume 

Definition at line 378 of file Process.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
eCanJITDontKnow 
eCanJITYes 
eCanJITNo 

Definition at line 2733 of file Process.h.

◆ Warnings

Process warning types.

Enumerator
eWarningsOptimization 

Definition at line 385 of file Process.h.

Constructor & Destructor Documentation

◆ Process() [1/2]

lldb_private::Process::Process ( lldb::TargetSP  target_sp,
lldb::ListenerSP  listener_sp 
)

Construct with a shared pointer to a target, and the Process listener.

Uses the Host UnixSignalsSP by default.

Referenced by GetStaticBroadcasterClass().

◆ Process() [2/2]

lldb_private::Process::Process ( lldb::TargetSP  target_sp,
lldb::ListenerSP  listener_sp,
const lldb::UnixSignalsSP &  unix_signals_sp 
)

Construct with a shared pointer to a target, the Process listener, and the appropriate UnixSignalsSP for the process.

◆ ~Process()

Process::~Process ( )
override

Destructor.

The destructor is virtual since this class is designed to be inherited from by the plug-in instance.

Definition at line 595 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_OBJECT, and lldb_private::Log::Printf().

Member Function Documentation

◆ AddImageToken()

size_t Process::AddImageToken ( lldb::addr_t  image_ptr)

Definition at line 5784 of file Process.cpp.

References m_image_tokens.

Referenced by PlatformPOSIX::DoLoadImage().

◆ AddInvalidMemoryRegion()

void Process::AddInvalidMemoryRegion ( const LoadRange region)

◆ AddPreResumeAction()

void Process::AddPreResumeAction ( PreResumeActionCallback  callback,
void *  baton 
)

Definition at line 5547 of file Process.cpp.

References m_pre_resume_actions.

◆ AdvanceAddressToNextBranchInstruction()

Address Process::AdvanceAddressToNextBranchInstruction ( Address  default_stop_addr,
AddressRange  range_bounds 
)

Find the next branch instruction to set a breakpoint on.

When instruction stepping through a source line, instead of stepping through each instruction, we can put a breakpoint on the next branch instruction (within the range of instructions we are stepping through) and continue the process to there, yielding significant performance benefits over instruction stepping.

Parameters
[in]default_stop_addrThe address of the instruction where lldb would put a breakpoint normally.
[in]range_boundsThe range which the breakpoint must be contained within. Typically a source line.
Returns
The address of the next branch instruction, or the end of the range provided in range_bounds. If there are any problems with the disassembly or getting the instructions, the original default_stop_addr will be returned.

Definition at line 5801 of file Process.cpp.

References lldb_private::Disassembler::DisassembleRange(), lldb_private::Target::GetArchitecture(), lldb_private::InstructionList::GetIndexOfInstructionAtAddress(), lldb_private::InstructionList::GetIndexOfNextBranchInstruction(), lldb_private::InstructionList::GetInstructionAtIndex(), GetTarget(), lldb_private::TargetProperties::GetUseFastStepping(), lldb_private::Address::IsValid(), and UINT32_MAX.

◆ AllocateMemory()

addr_t Process::AllocateMemory ( size_t  size,
uint32_t  permissions,
Status error 
)

The public interface to allocating memory in the process.

This function will allocate memory in the process's address space. This can't rely on the generic function calling mechanism, since that requires this function.

Parameters
[in]sizeThe size of the allocation requested.
[in]permissionsOr together any of the lldb::Permissions bits. The permissions on a given memory allocation can't be changed after allocation. Note that a block that isn't set writable can still be written on from lldb, just not by the process itself.
[in,out]errorAn error object to fill in if things go wrong.
Returns
The address of the allocated buffer in the process, or LLDB_INVALID_ADDRESS if the allocation failed.

Definition at line 2344 of file Process.cpp.

References lldb::eStateStopped, lldb_private::GetLogIfAllCategoriesSet(), lldb_private::GetPermissionsAsCString(), LIBLLDB_LOG_PROCESS, LLDB_INVALID_ADDRESS, lldb_private::Log::Printf(), and lldb_private::Status::SetErrorToGenericError().

Referenced by PlatformPOSIX::DoLoadImage(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), and lldb_private::FunctionCaller::WriteFunctionArguments().

◆ AppendSTDERR()

void Process::AppendSTDERR ( const char *  s,
size_t  len 
)
protected

◆ AppendSTDOUT()

void Process::AppendSTDOUT ( const char *  s,
size_t  len 
)
protected

◆ AssignIndexIDToThread()

uint32_t Process::AssignIndexIDToThread ( uint64_t  thread_id)

◆ Attach()

Status Process::Attach ( ProcessAttachInfo attach_info)
virtual

Attach to an existing process using the process attach info.

This function is not meant to be overridden by Process subclasses. It will first call WillAttach (lldb::pid_t) or WillAttach (const char *), and if that returns true, DoAttach (lldb::pid_t) or DoAttach (const char *) will be called to actually do the attach. If DoAttach returns true, then Process::DidAttach() will be called.

Parameters
[in]pidThe process ID that we should attempt to attach to.
Returns
Returns pid if attaching was successful, or LLDB_INVALID_PROCESS_ID if attaching fails.

Definition at line 2793 of file Process.cpp.

References lldb_private::Status::AsCString(), DoAttachToProcessWithID(), DoAttachToProcessWithName(), lldb_private::ProcessInstanceInfo::DumpAsTableRow(), lldb_private::ProcessInstanceInfo::DumpTableHeader(), lldb_private::Equals, lldb::eStateAttaching, lldb_private::Status::Fail(), lldb_private::StreamString::GetData(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::UserID::GetID(), lldb_private::FileSpec::GetPath(), lldb_private::ProcessInfo::GetProcessID(), lldb_private::ProcessInstanceInfoList::GetProcessIDAtIndex(), lldb_private::ProcessInstanceInfoMatch::GetProcessInfo(), lldb_private::ProcessInstanceInfoList::GetProcessInfoAtIndex(), lldb_private::ProcessAttachInfo::GetResumeCount(), lldb_private::ProcessInstanceInfoList::GetSize(), GetTarget(), lldb_private::ProcessAttachInfo::GetWaitForLaunch(), LLDB_INVALID_PROCESS_ID, m_abi_sp, m_dyld_up, m_jit_loaders_up, m_os_up, m_process_input_reader, m_public_run_lock, m_should_detach, m_system_runtime_up, PATH_MAX, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), SetExitStatus(), lldb_private::UserID::SetID(), lldb_private::ProcessInstanceInfoMatch::SetNameMatchType(), SetNextEventAction(), SetPublicState(), StartPrivateStateThread(), lldb_private::Status::Success(), lldb_private::ProcessRunLock::TrySetRunning(), WillAttachToProcessWithID(), and WillAttachToProcessWithName().

◆ BroadcastAsyncProfileData()

void Process::BroadcastAsyncProfileData ( const std::string &  one_profile_data)
protected

◆ BroadcastStructuredData()

void Process::BroadcastStructuredData ( const StructuredData::ObjectSP object_sp,
const lldb::StructuredDataPluginSP &  plugin_sp 
)

Broadcasts the given structured data object from the given plugin.

StructuredDataPlugin instances can use this to optionally broadcast any of their data if they want to make it available for clients. The data will come in on the structured data event bit (eBroadcastBitStructuredData).

Parameters
[in]object_spThe structured data object to broadcast.
[in]plugin_spThe plugin that will be reported in the event's plugin parameter.

Definition at line 4249 of file Process.cpp.

References lldb_private::Broadcaster::BroadcastEvent(), and eBroadcastBitStructuredData.

Referenced by lldb_private::StructuredDataDarwinLog::HandleArrivalOfStructuredData().

◆ CalculateExecutionContext()

void Process::CalculateExecutionContext ( ExecutionContext exe_ctx)
overridevirtual

Reconstruct the object's execution context into sc.

The object should fill in as much of the ExecutionContextScope as it can so function calls that require a execution context can be made for the given object.

Parameters
[out]exe_ctxA reference to an execution context object that gets filled in.

Implements lldb_private::ExecutionContextScope.

Definition at line 4202 of file Process.cpp.

References GetTarget(), lldb_private::ExecutionContext::SetFramePtr(), lldb_private::ExecutionContext::SetProcessPtr(), lldb_private::ExecutionContext::SetTargetPtr(), and lldb_private::ExecutionContext::SetThreadPtr().

◆ CalculateProcess()

lldb::ProcessSP lldb_private::Process::CalculateProcess ( )
inlineoverridevirtual

◆ CalculateStackFrame()

lldb::StackFrameSP lldb_private::Process::CalculateStackFrame ( )
inlineoverridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 2228 of file Process.h.

◆ CalculateTarget()

lldb::TargetSP Process::CalculateTarget ( )
overridevirtual

◆ CalculateThread()

lldb::ThreadSP lldb_private::Process::CalculateThread ( )
inlineoverridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 2226 of file Process.h.

◆ CallocateMemory()

addr_t Process::CallocateMemory ( size_t  size,
uint32_t  permissions,
Status error 
)

The public interface to allocating memory in the process, this also clears the allocated memory.

This function will allocate memory in the process's address space. This can't rely on the generic function calling mechanism, since that requires this function.

Parameters
[in]sizeThe size of the allocation requested.
[in]permissionsOr together any of the lldb::Permissions bits. The permissions on a given memory allocation can't be changed after allocation. Note that a block that isn't set writable can still be written on from lldb, just not by the process itself.

Definition at line 2367 of file Process.cpp.

References lldb_private::Status::Success().

Referenced by PlatformPOSIX::DoLoadImage().

◆ CanDebug()

virtual bool lldb_private::Process::CanDebug ( lldb::TargetSP  target,
bool  plugin_specified_by_name 
)
pure virtual

Check if a plug-in instance can debug the file in module.

Each plug-in is given a chance to say whether it can debug the file in module. If the Process plug-in instance can debug a file on the current system, it should return true.

Returns
Returns true if this Process plug-in instance can debug the executable, false otherwise.

Implemented in lldb_private::process_gdb_remote::ProcessGDBRemote, lldb_private::ProcessWindows, ProcessFreeBSD, ProcessKDP, ProcessElfCore, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

◆ CanInterpretFunctionCalls()

bool lldb_private::Process::CanInterpretFunctionCalls ( )
inline

Determines whether executing function calls using the interpreter is possible for this process.

Returns
True if possible; false otherwise.

Definition at line 1836 of file Process.h.

Referenced by lldb_private::ClangExpressionParser::PrepareForExecution().

◆ CanJIT()

bool Process::CanJIT ( )

Determines whether executing JIT-compiled code in this process is possible.

Returns
True if execution of JIT code is possible; false otherwise.

Definition at line 2377 of file Process.cpp.

References lldb_private::Status::AsCString(), lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, lldb_private::Log::Printf(), and lldb_private::Status::Success().

Referenced by lldb_private::UserExpression::Evaluate().

◆ ClearBreakpointSiteByID()

Status Process::ClearBreakpointSiteByID ( lldb::user_id_t  break_id)

◆ ClearPreResumeAction()

void Process::ClearPreResumeAction ( PreResumeActionCallback  callback,
void *  baton 
)

Definition at line 5566 of file Process.cpp.

References m_pre_resume_actions.

◆ ClearPreResumeActions()

void Process::ClearPreResumeActions ( )

Definition at line 5564 of file Process.cpp.

References m_pre_resume_actions.

◆ CompleteAttach()

void Process::CompleteAttach ( )
protected

◆ ConfigureStructuredData()

Status Process::ConfigureStructuredData ( ConstString  type_name,
const StructuredData::ObjectSP config_sp 
)
virtual

Configure asynchronous structured data feature.

Each Process type that supports using an asynchronous StructuredData feature should implement this to enable/disable/configure the feature. The default implementation here will always return an error indiciating the feature is unsupported.

StructuredDataPlugin implementations will call this to configure a feature that has been reported as being supported.

Parameters
[in]type_nameThe StructuredData type name as previously discovered by the Process-derived instance.
[in]configConfiguration data for the feature being enabled. This config data, which may be null, will be passed along to the feature to process. The feature will dictate whether this is a dictionary, an array or some other object. If the feature needs to be set up properly before it can be enabled, then the config should also take an enable/disable flag.
Returns
Returns the result of attempting to configure the feature.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 5879 of file Process.cpp.

References lldb_private::Status.

◆ ConnectRemote()

Status Process::ConnectRemote ( Stream strm,
llvm::StringRef  remote_url 
)
virtual

Attach to a remote system via a URL.

Parameters
[in]strmA stream where output intended for the user (if the driver has a way to display that) generated during the connection. This may be nullptr if no output is needed.A
[in]remote_urlThe URL format that we are connecting to.
Returns
Returns an error object.

Definition at line 3034 of file Process.cpp.

References CompleteAttach(), DoConnectRemote(), lldb::eStateCrashed, lldb::eStateStopped, lldb_private::UserID::GetID(), HandlePrivateEvent(), LLDB_INVALID_PROCESS_ID, m_abi_sp, m_process_input_reader, lldb_private::None, PrivateStateThreadIsValid(), ResumePrivateStateThread(), StartPrivateStateThread(), lldb_private::Status::Success(), and WaitForProcessStopPrivate().

◆ CreateBreakpointSite()

lldb::break_id_t Process::CreateBreakpointSite ( const lldb::BreakpointLocationSP &  owner,
bool  use_hardware 
)

◆ CreateOSPluginThread()

ThreadSP Process::CreateOSPluginThread ( lldb::tid_t  tid,
lldb::addr_t  context 
)

Definition at line 1317 of file Process.cpp.

References lldb_private::OperatingSystem::CreateThread().

◆ DeallocateMemory()

Status Process::DeallocateMemory ( lldb::addr_t  ptr)

The public interface to deallocating memory in the process.

This function will deallocate memory in the process's address space that was allocated with AllocateMemory.

Parameters
[in]ptrA return value from AllocateMemory, pointing to the memory you want to deallocate.
Returns
if the memory was deallocated, otherwise.

Definition at line 2415 of file Process.cpp.

References lldb_private::Status::AsCString(), lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, lldb_private::Log::Printf(), and lldb_private::Status::SetErrorStringWithFormat().

Referenced by lldb_private::FunctionCaller::DeallocateFunctionResults(), lldb_private::AppleGetQueuesHandler::Detach(), lldb_private::AppleGetThreadItemInfoHandler::Detach(), lldb_private::AppleGetItemInfoHandler::Detach(), lldb_private::AppleGetPendingItemsHandler::Detach(), PlatformPOSIX::DoLoadImage(), and lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator().

◆ Destroy()

Status Process::Destroy ( bool  force_kill)

Kills the process and shuts down all threads that were spawned to track and monitor the process.

This function is not meant to be overridden by Process subclasses.

Parameters
[in]force_killWhether lldb should force a kill (instead of a detach) from the inferior process. Normally if lldb launched a binary and Destory is called, lldb kills it. If lldb attached to a running process and Destory is called, lldb detaches. If this behavior needs to be over-ridden, this is the bool that can be used.
Returns
Returns an error object.

Definition at line 3275 of file Process.cpp.

References lldb_private::Broadcaster::BroadcastEvent(), DestroyRequiresHalt(), Detach(), DidDestroy(), DisableAllBreakpointSites(), lldb_private::ThreadList::DiscardThreadPlans(), lldb_private::Communication::Disconnect(), DoDestroy(), lldb::eStateRunning, GetShouldDetach(), lldb_private::ThreadSafeValue< T >::GetValue(), m_destroy_in_process, m_process_input_reader, m_public_run_lock, m_public_state, m_should_detach, m_stdin_forward, m_stdio_communication, m_thread_list, lldb_private::ProcessRunLock::SetStopped(), StopForDestroyOrDetach(), StopPrivateStateThread(), lldb_private::Communication::StopReadThread(), lldb_private::Status::Success(), and WillDestroy().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), CommandObjectProcessKill::DoExecute(), Halt(), ApplicationDelegate::MenuDelegateAction(), CommandObjectProcessLaunchOrAttach::StopProcessIfNecessary(), and SourceFileWindowDelegate::WindowDelegateHandleChar().

◆ DestroyRequiresHalt()

virtual bool lldb_private::Process::DestroyRequiresHalt ( )
inlinevirtual

Reimplemented in lldb_private::ProcessWindows.

Definition at line 1156 of file Process.h.

Referenced by Destroy().

◆ Detach()

Status Process::Detach ( bool  keep_stopped)

◆ DetachRequiresHalt()

virtual bool lldb_private::Process::DetachRequiresHalt ( )
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1125 of file Process.h.

Referenced by Detach().

◆ DidAttach()

virtual void lldb_private::Process::DidAttach ( ArchSpec process_arch)
inlinevirtual

Called after attaching a process.

Parameters
[in]process_archIf you can figure out the process architecture after attach, fill it in here.

Allow Process plug-ins to execute some code after attaching to a process.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, and lldb_private::ProcessWindows.

Definition at line 973 of file Process.h.

References lldb_private::ArchSpec::Clear().

Referenced by CompleteAttach().

◆ DidDestroy()

virtual void lldb_private::Process::DidDestroy ( )
inlinevirtual

Definition at line 1154 of file Process.h.

Referenced by Destroy().

◆ DidDetach()

virtual void lldb_private::Process::DidDetach ( )
inlinevirtual

Called after detaching from a process.

Allow Process plug-ins to execute some code after detaching from a process.

Definition at line 1123 of file Process.h.

Referenced by Detach().

◆ DidExec()

void Process::DidExec ( )
virtual

◆ DidExit()

virtual void lldb_private::Process::DidExit ( )
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1327 of file Process.h.

◆ DidHalt()

virtual void lldb_private::Process::DidHalt ( )
inlinevirtual

Called after halting a process.

Allow Process plug-ins to execute some code after halting a process.

Definition at line 1095 of file Process.h.

Referenced by HaltPrivate().

◆ DidLaunch()

virtual void lldb_private::Process::DidLaunch ( )
inlinevirtual

Called after launching a process.

Allow Process plug-ins to execute some code after launching a process.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1023 of file Process.h.

◆ DidResume()

virtual void lldb_private::Process::DidResume ( )
inlinevirtual

Called after resuming a process.

Allow Process plug-ins to execute some code after resuming a process.

Definition at line 1059 of file Process.h.

Referenced by PrivateResume().

◆ DidSignal()

virtual void lldb_private::Process::DidSignal ( )
inlinevirtual

Called after sending a signal to a process.

Allow Process plug-ins to execute some code after sending a signal to a process.

Definition at line 1162 of file Process.h.

Referenced by Signal().

◆ DisableAllBreakpointSites()

void Process::DisableAllBreakpointSites ( )

◆ DisableBreakpointSite()

virtual Status lldb_private::Process::DisableBreakpointSite ( BreakpointSite bp_site)
inlinevirtual

◆ DisableBreakpointSiteByID()

Status Process::DisableBreakpointSiteByID ( lldb::user_id_t  break_id)

Definition at line 1630 of file Process.cpp.

References lldb_private::Status::SetErrorStringWithFormat().

◆ DisableSoftwareBreakpoint()

Status Process::DisableSoftwareBreakpoint ( BreakpointSite bp_site)
virtual

◆ DisableWatchpoint()

Status Process::DisableWatchpoint ( Watchpoint wp,
bool  notify = true 
)
virtual

◆ DoAllocateMemory()

virtual lldb::addr_t lldb_private::Process::DoAllocateMemory ( size_t  size,
uint32_t  permissions,
Status error 
)
inlinevirtual

Actually allocate memory in the process.

This function will allocate memory in the process's address space. This can't rely on the generic function calling mechanism, since that requires this function.

Parameters
[in]sizeThe size of the allocation requested.
Returns
The address of the allocated buffer in the process, or LLDB_INVALID_ADDRESS if the allocation failed.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1662 of file Process.h.

References LLDB_INVALID_ADDRESS, and lldb_private::Status::SetErrorStringWithFormat().

Referenced by lldb_private::AllocatedMemoryCache::AllocatePage().

◆ DoAttachToProcessWithID()

virtual Status lldb_private::Process::DoAttachToProcessWithID ( lldb::pid_t  pid,
const ProcessAttachInfo attach_info 
)
inlinevirtual

Attach to an existing process using a process ID.

Parameters
[in]pidThe process ID that we should attempt to attach to.
[in]attach_infoInformation on how to do the attach. For example, GetUserID() will return the uid to attach as.
Returns
Returns a successful Status attaching was successful, or an appropriate (possibly platform-specific) error code if attaching fails. hanming : need flag

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 935 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by Attach().

◆ DoAttachToProcessWithName()

virtual Status lldb_private::Process::DoAttachToProcessWithName ( const char *  process_name,
const ProcessAttachInfo attach_info 
)
inlinevirtual

Attach to an existing process using a partial process name.

Parameters
[in]process_nameThe name of the process to attach to.
[in]attach_infoInformation on how to do the attach. For example, GetUserID() will return the uid to attach as.
Returns
Returns a successful Status attaching was successful, or an appropriate (possibly platform-specific) error code if attaching fails.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, and ProcessKDP.

Definition at line 958 of file Process.h.

References lldb_private::Status::SetErrorString().

Referenced by Attach().

◆ DoConnectRemote()

virtual Status lldb_private::Process::DoConnectRemote ( Stream strm,
llvm::StringRef  remote_url 
)
inlinevirtual

Attach to a remote system via a URL.

Parameters
[in]strmA stream where output intended for the user (if the driver has a way to display that) generated during the connection. This may be nullptr if no output is needed.A
[in]remote_urlThe URL format that we are connecting to.
Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, and ProcessKDP.

Definition at line 915 of file Process.h.

References lldb_private::Status::SetErrorString().

Referenced by ConnectRemote().

◆ DoDeallocateMemory()

virtual Status lldb_private::Process::DoDeallocateMemory ( lldb::addr_t  ptr)
inlinevirtual

Actually deallocate memory in the process.

This function will deallocate memory in the process's address space that was allocated with AllocateMemory.

Parameters
[in]ptrA return value from AllocateMemory, pointing to the memory you want to deallocate.
Returns
if the memory was deallocated, otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1865 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by lldb_private::AllocatedMemoryCache::Clear().

◆ DoDestroy()

virtual Status lldb_private::Process::DoDestroy ( )
pure virtual

◆ DoDetach()

virtual Status lldb_private::Process::DoDetach ( bool  keep_stopped)
inlinevirtual

Detaches from a running or stopped process.

Returns
Returns true if the process successfully detaches, false otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1111 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by Detach().

◆ DoDidExec()

virtual void lldb_private::Process::DoDidExec ( )
inlinevirtual

Subclasses of Process should implement this function if they need to do anything after a process exec's itself.

Reimplemented in ProcessFreeBSD.

Definition at line 985 of file Process.h.

Referenced by DidExec().

◆ DoHalt()

virtual Status lldb_private::Process::DoHalt ( bool &  caused_stop)
inlinevirtual

Halts a running process.

DoHalt must produce one and only one stop StateChanged event if it actually stops the process. If the stop happens through some natural event (for instance a SIGSTOP), then forwarding that event will do. Otherwise, you must generate the event manually. This function is called from the context of the private state thread.

Parameters
[out]caused_stopIf true, then this Halt caused the stop, otherwise, the process was already stopped.
Returns
Returns true if the process successfully halts, false otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1084 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by HaltPrivate().

◆ DoLaunch()

virtual Status lldb_private::Process::DoLaunch ( Module exe_module,
ProcessLaunchInfo launch_info 
)
inlinevirtual

Launch a new process.

Launch a new process by spawning a new process using exe_module's file as the file to launch. Launch details are provided in launch_info.

Parameters
[in]exe_moduleThe module from which to extract the file specification and launch.
[in]launch_infoDetails (e.g. arguments, stdio redirection, etc.) for the requested launch.
Returns
An Status instance indicating success or failure of the operation.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessFreeBSD, ProcessKDP, and lldb_private::ProcessWindows.

Definition at line 1012 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

◆ DoLoadCore()

virtual Status lldb_private::Process::DoLoadCore ( )
inlinevirtual

◆ DoReadMemory()

virtual size_t lldb_private::Process::DoReadMemory ( lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
Status error 
)
pure virtual

Actually do the reading of memory from a process.

Subclasses must override this function and can return fewer bytes than requested when memory requests are too large. This class will break up the memory requests and keep advancing the arguments along as needed.

Parameters
[in]vm_addrA virtual load address that indicates where to start reading memory from.
[in]sizeThe number of bytes to read.
[out]bufA byte buffer that is at least size bytes long that will receive the memory bytes.
[out]errorAn error that indicates the success or failure of this operation. If error indicates success (error.Success()), then the value returned can be trusted, otherwise zero will be returned.
Returns
The number of bytes that were actually read into buf. Zero is returned in the case of an error.

Implemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessElfCore, ProcessFreeBSD, lldb_private::ProcessWindows, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Referenced by DynamicLoaderDarwinKernel::ReadMachHeader(), HexagonDYLDRendezvous::ReadStringFromMemory(), and updateSectionLoadAddress().

◆ DoResume()

virtual Status lldb_private::Process::DoResume ( )
inlinevirtual

Resumes all of a process's threads as configured using the Thread run control functions.

Threads for a process should be updated with one of the run control actions (resume, step, or suspend) that they should take when the process is resumed. If no run control action is given to a thread it will be resumed by default.

Returns
Returns true if the process successfully resumes using the thread run control actions, false otherwise.
See also
Thread:Resume()
Thread:Step()
Thread:Suspend()

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1048 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by PrivateResume().

◆ DoSignal()

virtual Status lldb_private::Process::DoSignal ( int  signal)
inlinevirtual

Sends a process a UNIX signal signal.

Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, and ProcessFreeBSD.

Definition at line 1142 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

Referenced by Signal().

◆ DoWriteMemory()

virtual size_t lldb_private::Process::DoWriteMemory ( lldb::addr_t  vm_addr,
const void *  buf,
size_t  size,
Status error 
)
inlinevirtual

Actually do the writing of memory to a process.

Parameters
[in]vm_addrA virtual load address that indicates where to start writing memory to.
[in]bufA byte buffer that is at least size bytes long that contains the data to write.
[in]sizeThe number of bytes to write.
[out]errorAn error value in case the memory write fails.
Returns
The number of bytes that were actually written.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1578 of file Process.h.

References lldb_private::Status::SetErrorStringWithFormat().

◆ EnableBreakpointSite()

virtual Status lldb_private::Process::EnableBreakpointSite ( BreakpointSite bp_site)
inlinevirtual

◆ EnableBreakpointSiteByID()

Status Process::EnableBreakpointSiteByID ( lldb::user_id_t  break_id)

Definition at line 1644 of file Process.cpp.

References lldb_private::Status::SetErrorStringWithFormat().

◆ EnableSoftwareBreakpoint()

Status Process::EnableSoftwareBreakpoint ( BreakpointSite bp_site)
virtual

◆ EnableWatchpoint()

Status Process::EnableWatchpoint ( Watchpoint wp,
bool  notify = true 
)
virtual

◆ ExecutionResultAsCString()

const char * Process::ExecutionResultAsCString ( lldb::ExpressionResults  result)
static

◆ Finalize()

void Process::Finalize ( )
virtual

◆ FindPlugin()

ProcessSP Process::FindPlugin ( lldb::TargetSP  target_sp,
llvm::StringRef  plugin_name,
lldb::ListenerSP  listener_sp,
const FileSpec crash_file_path 
)
static

Find a Process plug-in that can debug module using the currently selected architecture.

Scans all loaded plug-in interfaces that implement versions of the Process plug-in interface and returns the first instance that can debug the file.

Parameters
[in]module_spThe module shared pointer that this process will debug.
[in]plugin_nameIf nullptr, select the best plug-in for the binary. If non-nullptr then look for a plugin whose PluginInfo's name matches this string.
See also
Process::CanDebug ()

Definition at line 463 of file Process.cpp.

References lldb_private::PluginManager::GetProcessCreateCallbackAtIndex(), and lldb_private::PluginManager::GetProcessCreateCallbackForPluginName().

Referenced by lldb_private::Target::CreateProcess().

◆ Flush()

void Process::Flush ( )

Flush all data in the process.

Flush the memory caches, all threads, and any other cached data in the process.

This function can be called after a world changing event like adding a new symbol file, or after the process makes a large context switch (from boot ROM to booted into an OS).

Definition at line 5583 of file Process.cpp.

References lldb_private::QueueList::Clear(), lldb_private::ThreadList::Flush(), m_extended_thread_list, m_extended_thread_stop_id, m_queue_list, m_queue_list_stop_id, and m_thread_list.

Referenced by DidExec(), CommandObjectTargetModulesLoad::DoExecute(), and CommandObjectTargetSymbolsAdd::DoExecute().

◆ ForceNextEventDelivery()

void lldb_private::Process::ForceNextEventDelivery ( )
inlineprotected

Definition at line 2561 of file Process.h.

Referenced by RunThreadPlan().

◆ GetABI()

const lldb::ABISP & Process::GetABI ( )

◆ GetAddressByteSize()

uint32_t Process::GetAddressByteSize ( ) const

Definition at line 3370 of file Process.cpp.

References lldb_private::Communication::Disconnect(), lldb::eStateAttaching, lldb::eStateConnected, lldb::eStateCrashed, lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateLaunching, lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb::eStateUnloaded, lldb_private::eVoteNo, lldb_private::eVoteNoOpinion, lldb_private::eVoteYes, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::Process::ProcessEventData::GetInterruptedFromEvent(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::Process::ProcessEventData::GetRestartedFromEvent(), lldb_private::Process::ProcessEventData::GetStateFromEvent(), GetTarget(), LIBLLDB_LOG_EVENTS, LIBLLDB_LOG_PROCESS, m_force_next_event_delivery, m_last_broadcast_state, m_resume_requested, m_stdin_forward, m_stdio_communication, m_thread_list, lldb_private::Log::Printf(), PrivateResume(), RefreshStateAfterStop(), lldb_private::Process::ProcessEventData::SetRestartedInEvent(), lldb_private::ThreadList::ShouldReportRun(), lldb_private::ThreadList::ShouldReportStop(), lldb_private::ThreadList::ShouldStop(), lldb_private::StateAsCString(), lldb_private::Communication::StopReadThread(), lldb_private::Communication::SynchronizeWithReadThread(), and SynchronouslyNotifyStateChanged().

Referenced by lldb_private::formatters::Foundation1437::__NSArrayMSize(), lldb_private::formatters::Foundation1437::__NSArrayMSize_Impl(), lldb_private::formatters::Foundation1437::__NSDictionaryMSize(), lldb_private::formatters::Foundation1437::__NSDictionaryMSize_Impl(), lldb_private::formatters::Foundation1437::__NSSetMSize(), lldb_private::formatters::Foundation1437::__NSSetMSize_Impl(), AuxVector::AuxVector(), SystemRuntimeMacOSX::CompleteQueueItem(), CommandObjectProcessMinidumpDump::DoExecute(), CommandObjectMemoryFind::DoExecute(), PlatformPOSIX::DoLoadImage(), CommandObjectRegisterRead::DumpRegister(), ExtractRuntimeGlobalSymbol(), lldb_private::AppleObjCRuntime::GetBacktraceThreadFromException(), GetClassDataMask(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), lldb_private::ClassDescriptorV2::GetIVarAtIndex(), lldb_private::formatters::InferiorSizedWord::GetMaximum(), SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(), DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), lldb_private::ClangExpressionDeclMap::GetTargetInfo(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::InferiorCall(), lldb_private::InferiorCallMmap(), LoadValueFromConsecutiveGPRRegisters(), lldb_private::AppleObjCRuntimeV2::LookupRuntimeSymbol(), RemoteNXMapTable::ParseHeader(), SystemRuntimeMacOSX::PopulateQueueList(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), lldb_private::ProcessStructReader::ProcessStructReader(), DYLDRendezvous::ReadPointer(), HexagonDYLDRendezvous::ReadPointer(), ReadVBaseOffsetFromVTable(), HexagonDYLDRendezvous::Resolve(), DYLDRendezvous::Resolve(), ResolveRendezvousAddress(), DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(), NSIndexPathSyntheticFrontEnd::Impl::InlinedIndexes::SetIndexes(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), lldb_private::ValueObjectRegister::UpdateValue(), and lldb_private::FunctionCaller::WriteFunctionArguments().

◆ GetAsyncProfileData()

size_t Process::GetAsyncProfileData ( char *  buf,
size_t  buf_size,
Status error 
)
virtual

Get any available profile data.

Parameters
[out]bufA buffer that will receive any profile data bytes that are currently available.
[out]buf_sizeThe size in bytes for the buffer buf.
Returns
The number of bytes written into buf. If this value is equal to buf_size, another call to this function should be made to retrieve more profile data.

Definition at line 4265 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, m_profile_data, m_profile_data_comm_mutex, and lldb_private::Log::Printf().

◆ GetAuxvData()

const lldb::DataBufferSP Process::GetAuxvData ( )
virtual

◆ GetBreakpointSiteList() [1/2]

BreakpointSiteList & Process::GetBreakpointSiteList ( )

◆ GetBreakpointSiteList() [2/2]

const BreakpointSiteList & Process::GetBreakpointSiteList ( ) const

Definition at line 1610 of file Process.cpp.

◆ GetBroadcasterClass()

ConstString& lldb_private::Process::GetBroadcasterClass ( ) const
inlineoverridevirtual

Reimplemented from lldb_private::Broadcaster.

Definition at line 400 of file Process.h.

◆ GetByteOrder()

lldb::ByteOrder Process::GetByteOrder ( ) const

Definition at line 3366 of file Process.cpp.

References lldb_private::Target::GetArchitecture(), lldb_private::ArchSpec::GetByteOrder(), and GetTarget().

Referenced by AuxVector::AuxVector(), SystemRuntimeMacOSX::CompleteQueueItem(), CommandObjectMemoryFind::DoExecute(), lldb_private::ClangASTContext::DumpSummary(), lldb_private::DWARFExpression::Evaluate(), lldb_private::IRExecutionUnit::FreeNow(), RegisterContextPOSIX_s390x::GetByteOrder(), RegisterContextPOSIX_ppc64le::GetByteOrder(), RegisterContextPOSIX_mips64::GetByteOrder(), RegisterContextPOSIX_arm64::GetByteOrder(), RegisterContextPOSIX_arm::GetByteOrder(), RegisterContextPOSIX_x86::GetByteOrder(), RegisterContextPOSIX_powerpc::GetByteOrder(), GetClassDataMask(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), lldb_private::ClangExpressionDeclMap::GetTargetInfo(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), LoadValueFromConsecutiveGPRRegisters(), lldb_private::AppleObjCRuntimeV2::LookupRuntimeSymbol(), SystemRuntimeMacOSX::PopulateQueueList(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), lldb_private::ProcessStructReader::ProcessStructReader(), DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), and lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadList().

◆ GetCPPLanguageRuntime()

CPPLanguageRuntime * Process::GetCPPLanguageRuntime ( bool  retry_if_null = true)
virtual

◆ GetData()

virtual Status lldb_private::Process::GetData ( lldb::user_id_t  uid,
lldb::tid_t  thread_id,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
inlinevirtual

Provides the trace data as raw bytes.

A buffer needs to be supplied to copy the trace data. The exact behavior of this API may vary across trace technology, as some may support partial reading of the trace data from a specified offset while some may not. The thread_id should be used to select a particular thread for trace extraction.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2434 of file Process.h.

References lldb_private::Status.

◆ GetDynamicCheckers()

DynamicCheckerFunctions* lldb_private::Process::GetDynamicCheckers ( )
inline

◆ GetDynamicLoader()

DynamicLoader * Process::GetDynamicLoader ( )
virtual

Get the dynamic loader plug-in for this process.

The default action is to let the DynamicLoader plug-ins check the main executable and the DynamicLoader will select itself automatically. Subclasses can override this if inspecting the executable is not desired, or if Process subclasses can only use a specific DynamicLoader plug-in.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, lldb_private::ProcessWindows, ProcessKDP, ProcessElfCore, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Definition at line 2687 of file Process.cpp.

References lldb_private::DynamicLoader::FindPlugin().

Referenced by CompleteAttach(), PlatformPOSIX::EvaluateLibdlExpression(), and ObjectFileMachO::GetProcessSharedCacheUUID().

◆ GetEventsPrivate()

bool Process::GetEventsPrivate ( lldb::EventSP &  event_sp,
const Timeout< std::micro > &  timeout,
bool  control_only 
)
protected

Definition at line 1111 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, and LLDB_LOG.

Referenced by HaltPrivate().

◆ GetExitDescription()

const char * Process::GetExitDescription ( )

Get a textual description of what the process exited.

Returns
The textual description of why the process exited, or nullptr if there is no description available.

Definition at line 1136 of file Process.cpp.

References lldb::eStateExited.

Referenced by GetStatus(), and StatusBarWindowDelegate::WindowDelegateDraw().

◆ GetExitStatus()

int Process::GetExitStatus ( )

Get the exit status for a process.

Returns
The process's return code, or -1 if the current process state is not eStateExited.

Definition at line 1128 of file Process.cpp.

References lldb::eStateExited.

Referenced by GetStatus(), and StatusBarWindowDelegate::WindowDelegateDraw().

◆ GetExtendedThreadList()

ThreadList& lldb_private::Process::GetExtendedThreadList ( )
inline

◆ GetFileLoadAddress()

virtual Status lldb_private::Process::GetFileLoadAddress ( const FileSpec file,
bool &  is_loaded,
lldb::addr_t load_addr 
)
inlinevirtual

Try to find the load address of a file.

The load address is defined as the address of the first memory region what contains data mapped from the specified file.

Parameters
[in]fileThe name of the file whose load address we are looking for
[out]is_loadedTrue if the file is loaded into the memory and false otherwise.
[out]load_addrThe load address of the file if it is loaded into the processes address space, LLDB_INVALID_ADDRESS otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2313 of file Process.h.

References lldb_private::Status.

Referenced by lldb_private::DynamicLoaderWindowsDYLD::GetLoadAddress(), lldb_private::DynamicLoader::LoadModuleAtAddress(), and DYLDRendezvous::UpdateBaseAddrIfNecessary().

◆ GetGlobalProperties()

const ProcessPropertiesSP & Process::GetGlobalProperties ( )
static

◆ GetHistoryThreads()

ThreadCollectionSP Process::GetHistoryThreads ( lldb::addr_t  addr)

Definition at line 5752 of file Process.cpp.

References lldb_private::MemoryHistory::FindPlugin().

◆ GetHostOSVersion()

virtual llvm::VersionTuple lldb_private::Process::GetHostOSVersion ( )
inlinevirtual

Sometimes the connection to a process can detect the host OS version that the process is running on.

The current platform should be checked first in case the platform is connected, but clients can fall back onto this function if the platform fails to identify the host OS version. The platform should be checked first in case you are running a simulator platform that might itself be running natively, but have different heuristics for figuring out which OS is is emulating.

Returns
Returns the version tuple of the host OS. In case of failure an empty VersionTuple is returner.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1187 of file Process.h.

Referenced by lldb_private::Platform::GetOSVersion(), and lldb_private::DynamicLoaderDarwin::UseDYLDSPI().

◆ GetImageInfoAddress()

addr_t Process::GetImageInfoAddress ( )
virtual

Get the image information address for the current process.

Some runtimes have system functions that can help dynamic loaders locate the dynamic loader information needed to observe shared libraries being loaded or unloaded. This function is in the Process interface (as opposed to the DynamicLoader interface) to ensure that remote debugging can take advantage of this functionality.

Returns
The address of the dynamic loader information, or LLDB_INVALID_ADDRESS if this is not supported by this interface.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessFreeBSD, ProcessElfCore, lldb_private::ProcessWindows, ProcessKDP, and ProcessMachCore.

Definition at line 1539 of file Process.cpp.

References LLDB_INVALID_ADDRESS.

Referenced by lldb_private::DynamicLoaderWindowsDYLD::DidAttach(), DynamicLoaderMacOS::DoInitialImageFetch(), DynamicLoaderMacOSXDYLD::DoInitialImageFetch(), DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(), DynamicLoaderMacOS::ProcessDidExec(), DynamicLoaderMacOSXDYLD::ProcessDidExec(), ResolveRendezvousAddress(), and DynamicLoaderDarwinKernel::SearchForDarwinKernel().

◆ GetImagePtrFromToken()

lldb::addr_t Process::GetImagePtrFromToken ( size_t  token) const

Definition at line 5789 of file Process.cpp.

References LLDB_INVALID_IMAGE_TOKEN, and m_image_tokens.

Referenced by PlatformPOSIX::UnloadImage().

◆ GetInstrumentationRuntime()

InstrumentationRuntimeSP Process::GetInstrumentationRuntime ( lldb::InstrumentationRuntimeType  type)

Definition at line 5769 of file Process.cpp.

References m_instrumentation_runtimes.

◆ GetIOHandlerID()

uint32_t lldb_private::Process::GetIOHandlerID ( ) const
inline

◆ GetJITLoaders()

JITLoaderList & Process::GetJITLoaders ( )
protectedvirtual

Reimplemented in lldb_private::minidump::ProcessMinidump.

Definition at line 2695 of file Process.cpp.

References lldb_private::JITLoader::LoadPlugins().

Referenced by CompleteAttach(), and ModulesDidLoad().

◆ GetLanguageRuntime()

LanguageRuntime * Process::GetLanguageRuntime ( lldb::LanguageType  language,
bool  retry_if_null = true 
)
virtual

◆ GetLastNaturalStopID()

uint32_t lldb_private::Process::GetLastNaturalStopID ( ) const
inline

Definition at line 1345 of file Process.h.

◆ GetLastUserExpressionResumeID()

uint32_t lldb_private::Process::GetLastUserExpressionResumeID ( ) const
inline

Definition at line 1341 of file Process.h.

◆ GetLoadAddressPermissions()

bool Process::GetLoadAddressPermissions ( lldb::addr_t  load_addr,
uint32_t permissions 
)
virtual

Attempt to get the attributes for a region of memory in the process.

It may be possible for the remote debug server to inspect attributes for a region of memory in the process, such as whether there is a valid page of memory at a given address or whether that page is readable/writable/executable by the process.

Parameters
[in]load_addrThe address of interest in the process.
[out]permissionsIf this call returns successfully, this bitmask will have its Permissions bits set to indicate whether the region is readable/writable/executable. If this call fails, the bitmask values are undefined.
Returns
Returns true if it was able to determine the attributes of the memory region. False if not.

Definition at line 2454 of file Process.cpp.

References lldb_private::MemoryRegionInfo::eDontKnow, lldb_private::MemoryRegionInfo::eYes, lldb_private::MemoryRegionInfo::GetExecutable(), lldb_private::MemoryRegionInfo::GetReadable(), lldb_private::MemoryRegionInfo::GetWritable(), and lldb_private::Status::Success().

◆ GetLoadedDynamicLibrariesInfos() [1/3]

virtual lldb_private::StructuredData::ObjectSP lldb_private::Process::GetLoadedDynamicLibrariesInfos ( lldb::addr_t  image_list_address,
lldb::addr_t  image_count 
)
inlinevirtual

Retrieve the list of shared libraries that are loaded for this process This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre- watchOS 3 systems.

The following two methods are for newer versions of those OSes.

For certain platforms, the time it takes for the DynamicLoader plugin to read all of the shared libraries out of memory over a slow communication channel may be too long. In that instance, the gdb-remote stub may be able to retrieve the necessary information about the solibs out of memory and return a concise summary sufficient for the DynamicLoader plugin.

Parameters
[in]image_list_addressThe address where the table of shared libraries is stored in memory, if that is appropriate for this platform. Else this may be passed as LLDB_INVALID_ADDRESS.
[in]image_countThe number of shared libraries that are present in this process, if that is appropriate for this platofrm Else this may be passed as LLDB_INVALID_ADDRESS.
Returns
A StructureDataSP object which, if non-empty, will contain the information the DynamicLoader needs to get the initial scan of solibs resolved.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1270 of file Process.h.

Referenced by DynamicLoaderMacOS::AddBinaries(), DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress(), and DynamicLoaderMacOS::DoInitialImageFetch().

◆ GetLoadedDynamicLibrariesInfos() [2/3]

virtual lldb_private::StructuredData::ObjectSP lldb_private::Process::GetLoadedDynamicLibrariesInfos ( )
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1278 of file Process.h.

◆ GetLoadedDynamicLibrariesInfos() [3/3]

virtual lldb_private::StructuredData::ObjectSP lldb_private::Process::GetLoadedDynamicLibrariesInfos ( const std::vector< lldb::addr_t > &  load_addresses)
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 1284 of file Process.h.

◆ GetLoadImageUtilityFunction()

UtilityFunction * Process::GetLoadImageUtilityFunction ( Platform platform,
llvm::function_ref< std::unique_ptr< UtilityFunction >()>  factory 
)

Get the cached UtilityFunction that assists in loading binary images into the process.

Parameters
[in]platformThe platform fetching the UtilityFunction.
[in]factoryA function that will be called only once per-process in a thread-safe way to create the UtilityFunction if it has not been initialized yet.
Returns
The cached utility function or null if the platform is not the same as the target's platform.

Definition at line 6001 of file Process.cpp.

References GetTarget(), m_dlopen_utility_func_flag_once, and m_dlopen_utility_func_up.

Referenced by PlatformPOSIX::DoLoadImage().

◆ GetMemoryRegionInfo()

virtual Status lldb_private::Process::GetMemoryRegionInfo ( lldb::addr_t  load_addr,
MemoryRegionInfo range_info 
)
inlinevirtual

Locate the memory region that contains load_addr.

If load_addr is within the address space the process has mapped range_info will be filled in with the start and end of that range as well as the permissions for that range and range_info.GetMapped will return true.

If load_addr is outside any mapped region then range_info will have its start address set to load_addr and the end of the range will indicate the start of the next mapped range or be set to LLDB_INVALID_ADDRESS if there are no valid mapped ranges between load_addr and the end of the process address space.

GetMemoryRegionInfo will only return an error if it is unimplemented for the current process.

Parameters
[in]load_addrThe load address to query the range_info for.
[out]range_infoAn range_info value containing the details of the range.
Returns
An error value.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessElfCore, lldb_private::ProcessWindows, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Definition at line 1759 of file Process.h.

References lldb_private::Status::SetErrorString().

Referenced by GetMemoryRegions(), DynamicLoaderPOSIXDYLD::LoadInterpreterModule(), lldb_private::DynamicLoader::LoadModuleAtAddress(), and DynamicLoaderPOSIXDYLD::LoadVDSO().

◆ GetMemoryRegions()

Status Process::GetMemoryRegions ( lldb_private::MemoryRegionInfos region_list)
virtual

Obtain all the mapped memory regions within this process.

Parameters
[out]region_listA vector to contain MemoryRegionInfo objects for all mapped ranges.
Returns
An error value.

Reimplemented in lldb_private::minidump::ProcessMinidump.

Definition at line 5853 of file Process.cpp.

References lldb_private::MemoryRegionInfo::eYes, lldb_private::Status::Fail(), lldb_private::MemoryRegionInfo::GetMapped(), GetMemoryRegionInfo(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::Range< B, S >::GetRangeEnd(), and LLDB_INVALID_ADDRESS.

◆ GetMetaData()

virtual Status lldb_private::Process::GetMetaData ( lldb::user_id_t  uid,
lldb::tid_t  thread_id,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
inlinevirtual

Similar API as above except for obtaining meta data.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2441 of file Process.h.

References lldb_private::Status.

◆ GetModID()

ProcessModID lldb_private::Process::GetModID ( ) const
inline

Get the Modification ID of the process.

Returns
The modification ID of the process.

Definition at line 1333 of file Process.h.

Referenced by lldb_private::ValueObject::EvaluationPoint::~EvaluationPoint().

◆ GetModIDRef()

const ProcessModID& lldb_private::Process::GetModIDRef ( ) const
inline

Definition at line 1335 of file Process.h.

◆ GetModuleSpec()

bool Process::GetModuleSpec ( const FileSpec module_file_spec,
const ArchSpec arch,
ModuleSpec module_spec 
)
virtual

Try to fetch the module specification for a module with the given file name and architecture.

Process sub-classes have to override this method if they support platforms where the Platform object can't get the module spec for all module.

Parameters
[in]module_file_specThe file name of the module to get specification for.
[in]archThe architecture of the module to get specification for.
[out]module_specThe fetched module specification if the return value is true, unchanged otherwise.
Returns
Returns true if the module spec fetched successfully, false otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 5778 of file Process.cpp.

References lldb_private::ModuleSpec::Clear().

Referenced by lldb_private::Platform::GetCachedExecutable().

◆ GetNextEvent()

StateType Process::GetNextEvent ( lldb::EventSP &  event_sp)

◆ GetNextThreadIndexID()

uint32_t Process::GetNextThreadIndexID ( uint64_t  thread_id)

Definition at line 1324 of file Process.cpp.

◆ GetObjCLanguageRuntime()

ObjCLanguageRuntime * Process::GetObjCLanguageRuntime ( bool  retry_if_null = true)
virtual

◆ GetOperatingSystem()

OperatingSystem* lldb_private::Process::GetOperatingSystem ( )
inline

Definition at line 2179 of file Process.h.

◆ GetPluginCommandObject()

virtual CommandObject* lldb_private::Process::GetPluginCommandObject ( )
inlinevirtual

Return a multi-word command object that can be used to expose plug-in specific commands.

This object will be used to resolve plug-in commands and can be triggered by a call to:

(lldb) process command <args>
Returns
A CommandObject which can be one of the concrete subclasses of CommandObject like CommandObjectRaw, CommandObjectParsed, or CommandObjectMultiword.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, and lldb_private::minidump::ProcessMinidump.

Definition at line 595 of file Process.h.

Referenced by CommandObjectProcessPlugin::GetProxyCommandObject().

◆ GetPrivateState()

StateType Process::GetPrivateState ( )
protected

◆ GetProcessInfo()

bool Process::GetProcessInfo ( ProcessInstanceInfo info)
virtual

◆ GetQueueList()

QueueList& lldb_private::Process::GetQueueList ( )
inline

Definition at line 2071 of file Process.h.

◆ GetResumeID()

uint32_t lldb_private::Process::GetResumeID ( ) const
inline

Definition at line 1339 of file Process.h.

◆ GetRunLock()

ProcessRunLock & Process::GetRunLock ( )

◆ GetSharedCacheInfo()

virtual lldb_private::StructuredData::ObjectSP lldb_private::Process::GetSharedCacheInfo ( )
inlinevirtual

◆ GetShouldDetach()

bool lldb_private::Process::GetShouldDetach ( ) const
inline

◆ GetSoftwareBreakpointTrapOpcode()

size_t Process::GetSoftwareBreakpointTrapOpcode ( BreakpointSite bp_site)

◆ GetState()

StateType Process::GetState ( )

◆ GetStateChangedEvents()

StateType Process::GetStateChangedEvents ( lldb::EventSP &  event_sp,
const Timeout< std::micro > &  timeout,
lldb::ListenerSP  hijack_listener 
)

◆ GetStateChangedEventsPrivate()

StateType Process::GetStateChangedEventsPrivate ( lldb::EventSP &  event_sp,
const Timeout< std::micro > &  timeout 
)
protected

◆ GetStaticBroadcasterClass()

ConstString & Process::GetStaticBroadcasterClass ( )
static

◆ GetStatus()

void Process::GetStatus ( Stream ostrm)

◆ GetSTDERR()

size_t Process::GetSTDERR ( char *  buf,
size_t  buf_size,
Status error 
)
virtual

Get any available STDERR.

Calling this method is a valid operation only if all of the following conditions are true: 1) The process was launched, and not attached to. 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The process was launched without supplying a valid file path for STDERR.

Note that the implementation will probably need to start a read thread in the background to make sure that the pipe is drained and the STDERR buffered appropriately, to prevent the process from deadlocking trying to write to a full buffer.

Events will be queued indicating that there is STDERR available that can be retrieved using this function.

Parameters
[in]bufA buffer that will receive any STDERR bytes that are currently available.
[out]buf_sizeThe size in bytes for the buffer buf.
Returns
The number of bytes written into buf. If this value is equal to buf_size, another call to this function should be made to retrieve more STDERR data.

Reimplemented in lldb_private::ProcessWindows.

Definition at line 4311 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, m_stderr_data, m_stdio_communication_mutex, and lldb_private::Log::Printf().

Referenced by lldb_private::Debugger::GetProcessSTDERR().

◆ GetSTDOUT()

size_t Process::GetSTDOUT ( char *  buf,
size_t  buf_size,
Status error 
)
virtual

Get any available STDOUT.

Calling this method is a valid operation only if all of the following conditions are true: 1) The process was launched, and not attached to. 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The process was launched without supplying a valid file path for STDOUT.

Note that the implementation will probably need to start a read thread in the background to make sure that the pipe is drained and the STDOUT buffered appropriately, to prevent the process from deadlocking trying to write to a full buffer.

Events will be queued indicating that there is STDOUT available that can be retrieved using this function.

Parameters
[out]bufA buffer that will receive any STDOUT bytes that are currently available.
[in]buf_sizeThe size in bytes for the buffer buf.
Returns
The number of bytes written into buf. If this value is equal to buf_size, another call to this function should be made to retrieve more STDOUT data.

Reimplemented in lldb_private::ProcessWindows.

Definition at line 4291 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, m_stdio_communication_mutex, m_stdout_data, and lldb_private::Log::Printf().

Referenced by lldb_private::Debugger::GetProcessSTDOUT().

◆ GetStopEventForStopID()

lldb::EventSP lldb_private::Process::GetStopEventForStopID ( uint32_t  stop_id) const
inline

Definition at line 1349 of file Process.h.

◆ GetStopID()

uint32_t lldb_private::Process::GetStopID ( ) const
inline

◆ GetStructuredDataPlugin()

StructuredDataPluginSP Process::GetStructuredDataPlugin ( ConstString  type_name) const

Returns the StructuredDataPlugin associated with a given type name, if there is one.

There will only be a plugin for a given StructuredDataType if the debugged process monitor claims that the feature is supported. This is one way to tell whether a feature is available.

Returns
The plugin if one is available for the specified feature; otherwise, returns an empty shared pointer.

Definition at line 4257 of file Process.cpp.

References m_structured_data_plugin_map.

◆ GetSystemRuntime()

SystemRuntime * Process::GetSystemRuntime ( )
virtual

Get the system runtime plug-in for this process.

Returns
Returns a pointer to the SystemRuntime plugin for this Process if one is available. Else returns nullptr.

Reimplemented in lldb_private::minidump::ProcessMinidump.

Definition at line 2703 of file Process.cpp.

References lldb_private::SystemRuntime::FindPlugin().

Referenced by CompleteAttach(), lldb::SBThread::GetExtendedBacktraceThread(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetExtendedInfoForThread(), ModulesDidLoad(), and lldb_private::Thread::SafeToCallFunctions().

◆ GetTarget() [1/2]

Target& lldb_private::Process::GetTarget ( )
inline

Get the target object pointer for this module.

Returns
A Target object pointer to the target that owns this module.

Definition at line 1194 of file Process.h.

Referenced by lldb_private::DynamicLoaderDarwin::AddModulesUsingImageInfos(), AdvanceAddressToNextBranchInstruction(), lldb_private::AppleObjCRuntime::AppleObjCRuntime(), lldb_private::AppleObjCTypeEncodingParser::AppleObjCTypeEncodingParser(), lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), Attach(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::AvoidGPackets(), lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), CalculateExecutionContext(), lldb_private::AppleObjCRuntime::CalculateHasNewLiteralsAndIndexing(), DynamicLoaderMacOS::CanLoadImage(), DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(), DynamicLoaderMacOS::ClearNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::ClearNotificationBreakpoint(), CompleteAttach(), DynamicLoaderPOSIXDYLD::ComputeLoadOffset(), lldb_private::process_gdb_remote::ProcessGDBRemote::ConnectToDebugserver(), lldb_private::AppleObjCRuntime::CreateExceptionSearchFilter(), lldb_private::LanguageRuntime::CreateExceptionSearchFilter(), lldb_private::DynamicLoaderWindowsDYLD::CreateInstance(), DynamicLoaderHexagonDYLD::CreateInstance(), JITLoaderGDB::CreateInstance(), DynamicLoaderStatic::CreateInstance(), DynamicLoaderPOSIXDYLD::CreateInstance(), DynamicLoaderDarwinKernel::CreateInstance(), DynamicLoaderMacOS::CreateInstance(), SystemRuntimeMacOSX::CreateInstance(), DynamicLoaderMacOSXDYLD::CreateInstance(), OperatingSystemPython::CreateRegisterContextForThread(), OperatingSystemPython::CreateThread(), lldb_private::DynamicLoaderWindowsDYLD::DidAttach(), DynamicLoaderHexagonDYLD::DidAttach(), DynamicLoaderPOSIXDYLD::DidAttach(), JITLoaderGDB::DidAttach(), DidExec(), lldb_private::DynamicLoaderWindowsDYLD::DidLaunch(), DynamicLoaderStatic::DidLaunch(), DynamicLoaderPOSIXDYLD::DidLaunch(), JITLoaderGDB::DidLaunch(), lldb_private::process_gdb_remote::ProcessGDBRemote::DidLaunchOrAttach(), ProcessFreeBSD::DoAttachToProcessWithID(), DynamicLoaderMacOS::DoClear(), DynamicLoaderMacOSXDYLD::DoClear(), ProcessKDP::DoConnectRemote(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoConnectRemote(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), ProcessFreeBSD::DoDidExec(), DoesProcessHaveSharedCache(), CommandObjectProcessLoad::DoExecute(), CommandObjectMemoryFind::DoExecute(), CommandObjectProcessUnload::DoExecute(), CommandObjectMemoryWrite::DoExecute(), DynamicLoaderMacOSXDYLD::DoInitialImageFetch(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), ProcessMachCore::DoLoadCore(), lldb_private::minidump::ProcessMinidump::DoLoadCore(), ProcessElfCore::DoLoadCore(), PlatformPOSIX::DoLoadImage(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), DYLDRendezvous::DYLDRendezvous(), DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(), DynamicLoaderPOSIXDYLD::EntryBreakpointHit(), lldb_private::process_gdb_remote::ProcessGDBRemote::EstablishConnectionIfNeeded(), lldb_private::ExecutionContext::ExecutionContext(), ExtractRuntimeGlobalSymbol(), HexagonDYLDRendezvous::FindMetadata(), DYLDRendezvous::FindMetadata(), findSymbolAddress(), lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(), lldb_private::FormatEntity::Format(), GetAddressByteSize(), ProcessElfCore::GetArchitecture(), ProcessFreeBSD::GetAuxvData(), GetByteOrder(), DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(), OperatingSystemPython::GetDynamicRegisterInfo(), DynamicLoaderHexagonDYLD::GetEntryPoint(), DynamicLoaderPOSIXDYLD::GetEntryPoint(), SystemRuntimeMacOSX::GetExtendedBacktraceForQueueItem(), lldb_private::AppleObjCRuntime::GetFoundationVersion(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBServerRegisterInfo(), lldb_private::ProcessWindows::GetImageInfoAddress(), ProcessElfCore::GetImageInfoAddress(), ProcessFreeBSD::GetImageInfoAddress(), lldb::SBThread::GetInfoItemByPathAsString(), lldb_private::AppleObjCRuntimeV1::GetISAHashTablePointer(), lldb_private::platform_android::PlatformAndroid::GetLibdlFunctionDeclarations(), GetLoadImageUtilityFunction(), lldb_private::AppleObjCRuntime::GetObjCModule(), lldb_private::AppleObjCRuntime::GetObjCVersion(), lldb_private::minidump::ProcessMinidump::GetPluginCommandObject(), ProcessKDP::GetPluginCommandObject(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetPluginCommandObject(), lldb_private::AppleObjCRuntime::GetPrintForDebuggerAddr(), lldb_private::minidump::ProcessMinidump::GetProcessInfo(), ProcessElfCore::GetProcessInfo(), GetProcessInfo(), lldb_private::DynamicLoaderDarwin::GetPThreadLibraryModule(), SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(), ProcessFreeBSD::GetSoftwareBreakpointTrapOpcode(), lldb_private::DynamicLoaderWindowsDYLD::GetStepThroughTrampolinePlan(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), DynamicLoaderHexagonDYLD::GetTargetExecutable(), lldb_private::DynamicLoader::GetTargetExecutable(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::Value::GetValueAsData(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetWatchpointSupportInfo(), lldb_private::StructuredDataDarwinLog::HandleArrivalOfStructuredData(), HandlePrivateEvent(), HexagonDYLDRendezvous::HexagonDYLDRendezvous(), lldb_private::InferiorCall(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos(), lldb_private::RenderScriptRuntime::Initiate(), ProcessFreeBSD::IsSoftwareStepBreakpoint(), lldb_private::RegisterContextLLDB::IsTrapHandlerFrame(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), DynamicLoaderHexagonDYLD::LoadAllCurrentModules(), DynamicLoaderPOSIXDYLD::LoadAllCurrentModules(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageAtFileAddress(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(), DynamicLoaderPOSIXDYLD::LoadInterpreterModule(), DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded(), lldb_private::DynamicLoader::LoadModuleAtAddress(), lldb_private::process_gdb_remote::ProcessGDBRemote::LoadModules(), DynamicLoaderPOSIXDYLD::LoadVDSO(), lldb_private::ObjCLanguageRuntime::LookupInCompleteClassCache(), PlatformPOSIX::MakeLoadImageUtilityFunction(), JITLoaderGDB::ModulesDidLoad(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), lldb_private::ProcessWindows::OnDebuggerConnected(), lldb_private::DynamicLoaderWindowsDYLD::OnLoadModule(), lldb_private::DynamicLoaderWindowsDYLD::OnUnloadModule(), DynamicLoaderDarwinKernel::ParseKextSummaries(), lldb_private::process_gdb_remote::ProcessGDBRemote::ParsePythonTargetDefinition(), PopProcessIOHandler(), SystemRuntimeMacOSX::PopulatePendingItemsForQueue(), PrintWarning(), lldb_private::DynamicLoaderDarwin::PrivateInitialize(), DynamicLoaderPOSIXDYLD::ProbeEntry(), ProcessFreeBSD::ProcessFreeBSD(), ProcessIOHandlerIsActive(), PushProcessIOHandler(), DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure(), DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback(), DynamicLoaderDarwinKernel::ReadKextSummaries(), DynamicLoaderDarwinKernel::ReadKextSummaryHeader(), DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(), lldb_private::minidump::ProcessMinidump::ReadModuleList(), DYLDRendezvous::ReadSOEntryFromMemory(), DynamicLoaderHexagonDYLD::RefreshModules(), DynamicLoaderPOSIXDYLD::RefreshModules(), lldb_private::RegisterContextLLDB::RegisterContextLLDB(), DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(), lldb_private::BreakpointLocation::ResolveBreakpointSite(), DynamicLoaderPOSIXDYLD::ResolveExecutableModule(), ResolveIndirectFunction(), ResolveRendezvousAddress(), DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(), DynamicLoaderDarwinKernel::SearchForKernelNearPC(), DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ServeSymbolLookups(), lldb_private::AppleObjCRuntime::SetExceptionBreakpoints(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetLastStopPacket(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint(), DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded(), DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint(), DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint(), ProcessFreeBSD::SetSoftwareSingleStepBreakpoint(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo(), ProcessFreeBSD::SetupSoftwareSingleStepping(), DYLDRendezvous::SOEntryIsMainExecutable(), lldb_private::process_gdb_remote::ProcessGDBRemote::StartNoticingNewThreads(), ProcessFreeBSD::SupportHardwareSingleStepping(), JITLoaderGDB::Terminate(), lldb_private::DynamicLoaderDarwin::UnloadAllImages(), lldb_private::DynamicLoaderDarwin::UnloadImages(), lldb_private::DynamicLoaderDarwin::UnloadModuleSections(), DynamicLoaderHexagonDYLD::UnloadSections(), lldb_private::DynamicLoader::UnloadSectionsCommon(), DYLDRendezvous::UpdateBaseAddrIfNecessary(), lldb_private::DynamicLoaderDarwin::UpdateDYLDImageInfoFromNewImageInfo(), DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(), lldb_private::DynamicLoaderDarwin::UpdateImageLoadAddress(), DynamicLoaderHexagonDYLD::UpdateLoadedSections(), lldb_private::DynamicLoader::UpdateLoadedSectionsCommon(), updateSectionLoadAddress(), lldb_private::DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(), OperatingSystemPython::UpdateThreadList(), lldb_private::DynamicLoaderDarwin::UseDYLDSPI(), lldb_private::FunctionCaller::WriteFunctionWrapper(), lldb_private::AppleObjCTrampolineHandler::~AppleObjCTrampolineHandler(), DynamicLoaderHexagonDYLD::~DynamicLoaderHexagonDYLD(), DynamicLoaderMacOS::~DynamicLoaderMacOS(), DynamicLoaderMacOSXDYLD::~DynamicLoaderMacOSXDYLD(), DynamicLoaderPOSIXDYLD::~DynamicLoaderPOSIXDYLD(), JITLoaderGDB::~JITLoaderGDB(), and lldb_private::StructuredDataDarwinLog::~StructuredDataDarwinLog().

◆ GetTarget() [2/2]

const Target& lldb_private::Process::GetTarget ( ) const
inline

Get the const target object pointer for this module.

Returns
A const Target object pointer to the target that owns this module.

Definition at line 1201 of file Process.h.

◆ GetThreadList()

ThreadList& lldb_private::Process::GetThreadList ( )
inline

Definition at line 2045 of file Process.h.

Referenced by CommandObjectIterateOverThreads::BucketThread(), SystemRuntimeMacOSX::CompleteQueueItem(), OperatingSystemPython::CreateThread(), ProcessKDP::DoConnectRemote(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoConnectRemote(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), CommandObjectIterateOverThreads::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadSelect::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), PlatformPOSIX::EvaluateLibdlExpression(), lldb_private::CommandObject::GetDefaultThread(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), lldb::SBThread::GetInfoItemByPathAsString(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::Thread::GetStatus(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), GetThreadStatus(), lldb_private::InferiorCall(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), ProcessFreeBSD::IsSoftwareStepBreakpoint(), ApplicationDelegate::MenuDelegateAction(), lldb_private::Process::AttachCompletionHandler::PerformAction(), SystemRuntimeMacOSX::PopulateQueueList(), DynamicLoaderMacOS::ProcessDidExec(), DynamicLoaderMacOSXDYLD::ProcessDidExec(), ProcessFreeBSD::RefreshStateAfterStop(), RunThreadPlan(), DynamicLoaderDarwinKernel::SearchForKernelNearPC(), lldb_private::Thread::StepIn(), lldb_private::Thread::StepOut(), and lldb_private::Thread::StepOver().

◆ GetThreadStatus()

size_t Process::GetThreadStatus ( Stream ostrm,
bool  only_threads_with_stop_reason,
uint32_t  start_frame,
uint32_t  num_frames,
uint32_t  num_frames_with_source,
bool  stop_format 
)

◆ GetTraceConfig()

virtual Status lldb_private::Process::GetTraceConfig ( lldb::user_id_t  uid,
TraceOptions options 
)
inlinevirtual

API to obtain the trace configuration used by a trace instance.

Configurations that may be specific to some trace technology should be stored in the custom parameters. The options are transported to the server, which shall interpret accordingly. The thread_id can be specified in the options to obtain the configuration used by a specific thread. The thread_id specified should also match the uid otherwise an error will be returned.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2454 of file Process.h.

References lldb_private::Status.

◆ GetUniqueID()

uint32_t lldb_private::Process::GetUniqueID ( ) const
inline

◆ GetUnixSignals()

const lldb::UnixSignalsSP & Process::GetUnixSignals ( )

◆ GetWatchpointSupportInfo() [1/2]

virtual Status lldb_private::Process::GetWatchpointSupportInfo ( uint32_t num)
inlinevirtual

◆ GetWatchpointSupportInfo() [2/2]

virtual Status lldb_private::Process::GetWatchpointSupportInfo ( uint32_t num,
bool &  after 
)
inlinevirtual

◆ Halt()

Status Process::Halt ( bool  clear_thread_plans = false,
bool  use_run_lock = true 
)

Halts a running process.

This function is not meant to be overridden by Process subclasses. If the process is successfully halted, a eStateStopped process event with GetInterrupted will be broadcast. If false, we will halt the process with no events generated by the halt.

Parameters
[in]clear_thread_plansIf true, when the process stops, clear all thread plans.
[in]use_run_lockWhether to release the run lock after the stop.
Returns
Returns an error object. If the error is empty, the process is halted. otherwise the halt has failed.

Definition at line 3127 of file Process.cpp.

References lldb_private::Broadcaster::BroadcastEvent(), Destroy(), lldb::eStateAttaching, lldb::eStateInvalid, GetState(), lldb_private::ThreadSafeValue< T >::GetValue(), HijackProcessEvents(), m_clear_thread_plans_on_stop, m_public_state, lldb_private::Listener::MakeListener(), RestoreProcessEvents(), SendAsyncInterrupt(), SetExitStatus(), SIGKILL, lldb_private::StateAsCString(), lldb_private::StateIsRunningState(), lldb_private::Status, and WaitForProcessToStop().

Referenced by CommandObjectProcessInterrupt::DoExecute(), lldb_private::CommandInterpreter::IOHandlerInterrupt(), ApplicationDelegate::MenuDelegateAction(), and RunThreadPlan().

◆ HaltPrivate()

Status Process::HaltPrivate ( )
protected

◆ HandlePrivateEvent()

void Process::HandlePrivateEvent ( lldb::EventSP &  event_sp)
protected

◆ HandleProcessStateChangedEvent()

bool Process::HandleProcessStateChangedEvent ( const lldb::EventSP &  event_sp,
Stream stream,
bool &  pop_process_io_handler 
)
static

Centralize the code that handles and prints descriptions for process state changes.

Parameters
[in]event_spThe process state changed event
[in]streamThe output stream to get the state change description
[in,out]pop_process_io_handlerIf this value comes in set to true, then pop the Process IOHandler if needed. Else this variable will be set to true or false to indicate if the process needs to have its process IOHandler popped.
Returns
true if the event describes a process state changed event, false otherwise.

Definition at line 830 of file Process.cpp.

References lldb::eDescriptionLevelBrief, lldb::eStateAttaching, lldb::eStateConnected, lldb::eStateCrashed, lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateLaunching, lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb::eStateUnloaded, lldb::eStopReasonBreakpoint, lldb::eStopReasonException, lldb::eStopReasonExec, lldb::eStopReasonInstrumentation, lldb::eStopReasonInvalid, lldb::eStopReasonNone, lldb::eStopReasonPlanComplete, lldb::eStopReasonSignal, lldb::eStopReasonThreadExiting, lldb::eStopReasonTrace, lldb::eStopReasonWatchpoint, lldb_private::StopInfo::GetCrashingDereference(), lldb_private::TargetList::GetIndexOfTarget(), lldb_private::ThreadList::GetMutex(), lldb_private::Process::ProcessEventData::GetNumRestartedReasons(), lldb_private::Process::ProcessEventData::GetProcessFromEvent(), lldb_private::Process::ProcessEventData::GetRestartedFromEvent(), lldb_private::Process::ProcessEventData::GetRestartedReasonAtIndex(), lldb_private::TargetList::GetSelectedTarget(), lldb_private::ThreadList::GetSelectedThread(), lldb_private::ThreadList::GetSize(), lldb_private::Process::ProcessEventData::GetStateFromEvent(), lldb_private::Debugger::GetTargetList(), lldb_private::ThreadList::GetThreadAtIndex(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::ThreadList::SetSelectedThreadByID(), lldb_private::StateAsCString(), and UINT32_MAX.

Referenced by lldb_private::Debugger::HandleProcessEvent(), and WaitForProcessToStop().

◆ HasAssignedIndexIDToThread()

bool Process::HasAssignedIndexIDToThread ( uint64_t  sb_thread_id)

◆ HijackProcessEvents()

bool Process::HijackProcessEvents ( lldb::ListenerSP  listener_sp)

If you need to ensure that you and only you will hear about some public event, then make a new listener, set to listen to process events, and then call this with that listener.

Then you will have to wait on that listener explicitly for events (rather than using the GetNextEvent & WaitFor* calls above. Be sure to call RestoreProcessEvents when you are done.

Parameters
[in]listenerThis is the new listener to whom all process events will be delivered.
Returns
Returns true if the new listener could be installed, false otherwise.

Definition at line 1037 of file Process.cpp.

Referenced by Halt(), lldb_private::Process::ProcessEventHijacker::ProcessEventHijacker(), and StopForDestroyOrDetach().

◆ IsAlive()

bool Process::IsAlive ( )
virtual

◆ IsPossibleDynamicValue()

bool Process::IsPossibleDynamicValue ( ValueObject in_value)

◆ IsRunning()

bool Process::IsRunning ( ) const

Definition at line 1124 of file Process.cpp.

References lldb_private::StateIsRunningState().

◆ IsValid()

bool lldb_private::Process::IsValid ( ) const
inline

Return whether this object is valid (i.e.

has not been finalized.)

Returns
Returns true if this Process has not been finalized and false otherwise.

Definition at line 581 of file Process.h.

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoConnectRemote(), and ProcessMachCore::DoLoadCore().

◆ Launch()

Status Process::Launch ( ProcessLaunchInfo launch_info)
virtual

Launch a new process.

Launch a new process by spawning a new process using the target object's executable module's file as the file to launch.

This function is not meant to be overridden by Process subclasses. It will first call Process::WillLaunch (Module *) and if that returns true, Process::DoLaunch (Module*, char const *[],char const *[],const char *,const char *, const char *) will be called to actually do the launching. If DoLaunch returns true, then Process::DidLaunch() will be called.

Parameters
[in]launch_infoDetails regarding the environment, STDIN/STDOUT/STDERR redirection, working path, etc. related to the requested launch.
Returns
An error object. Call GetID() to get the process ID if the error object is success.

Definition at line 2521 of file Process.cpp.

References lldb_private::Status::AsCString(), lldb_private::SystemRuntime::DidLaunch(), lldb_private::DynamicLoader::DidLaunch(), lldb::eStateCrashed, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateLaunching, lldb::eStateStopped, lldb_private::Status::Fail(), lldb_private::Module::GetFileSpec(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::FileSpec::GetPath(), lldb_private::Module::GetPlatformFileSpec(), lldb_private::FileSystem::Instance(), LLDB_INVALID_PROCESS_ID, PATH_MAX, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::Status::Success(), and lldb_private::Flags::Test().

◆ LoadCore()

Status Process::LoadCore ( )
virtual

◆ LoadModules() [1/2]

virtual size_t lldb_private::Process::LoadModules ( )
inlinevirtual

Sometimes processes know how to retrieve and load shared libraries.

This is normally done by DynamicLoader plug-ins, but sometimes the connection to the process allows retrieving this information. The dynamic loader plug-ins can use this function if they can't determine the current shared library load state.

Returns
The number of shared libraries that were loaded

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 684 of file Process.h.

Referenced by lldb_private::DynamicLoaderWindowsDYLD::DidAttach(), DynamicLoaderPOSIXDYLD::DidAttach(), lldb_private::DynamicLoaderWindowsDYLD::DidLaunch(), and DYLDRendezvous::UpdateSOEntries().

◆ LoadModules() [2/2]

virtual size_t lldb_private::Process::LoadModules ( LoadedModuleInfoList )
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 686 of file Process.h.

◆ LoadOperatingSystemPlugin()

void Process::LoadOperatingSystemPlugin ( bool  flush)
protected

◆ MapSupportedStructuredDataPlugins()

void Process::MapSupportedStructuredDataPlugins ( const StructuredData::Array supported_type_names)
protected

Loads any plugins associated with asynchronous structured data and maps the relevant supported type name to the plugin.

Processes can receive asynchronous structured data from the process monitor. This method will load and map any structured data plugins that support the given set of supported type names. Later, if any of these features are enabled, the process monitor is free to generate asynchronous structured data. The data must come in as a single StructuredData::Dictionary. That dictionary must have a string field named 'type', with a value that equals the relevant type name string (one of the values in supported_type_names).

Parameters
[in]supported_type_namesAn array of zero or more type names. Each must be unique. For each entry in the list, a StructuredDataPlugin will be searched for that supports the structured data type name.

Definition at line 5887 of file Process.cpp.

References lldb_private::StructuredData::Array::ForEach(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::StructuredData::Array::GetSize(), lldb_private::PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(), LIBLLDB_LOG_PROCESS, LLDB_LOG, m_structured_data_plugin_map, and lldb_private::Log::Printf().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DidLaunchOrAttach().

◆ ModulesDidLoad()

void Process::ModulesDidLoad ( ModuleList module_list)
virtual

◆ PausePrivateStateThread()

void Process::PausePrivateStateThread ( )
protected

Definition at line 3575 of file Process.cpp.

References eBroadcastInternalStateControlPause.

◆ PeekAtStateChangedEvents()

Event * Process::PeekAtStateChangedEvents ( )

◆ PopProcessIOHandler()

bool Process::PopProcessIOHandler ( )
protected

◆ PrefetchModuleSpecs()

virtual void lldb_private::Process::PrefetchModuleSpecs ( llvm::ArrayRef< FileSpec module_file_specs,
const llvm::Triple &  triple 
)
inlinevirtual

◆ PrintWarning()

void Process::PrintWarning ( uint64_t  warning_type,
const void *  repeat_key,
const char *  fmt,
  ... 
)
protected

Print a user-visible warning one time per Process.

A facility for printing a warning to the user once per repeat_key.

warning_type is from the Process::Warnings enums. repeat_key is a pointer value that will be used to ensure that the warning message is not printed multiple times. For instance, with a warning about a function being optimized, you can pass the CompileUnit pointer to have the warning issued for only the first function in a CU, or the Function pointer to have it issued once for every function, or a Module pointer to have it issued once per Module.

Classes outside Process should call a specific PrintWarning method so that the warning strings are all centralized in Process, instead of calling PrintWarning() directly.

Parameters
[in]warning_typeOne of the types defined in Process::Warnings.
[in]repeat_keyA pointer value used to ensure that the warning is only printed once. May be nullptr, indicating that the warning is printed unconditionally every time.
[in]fmtprintf style format string

Definition at line 5698 of file Process.cpp.

References eWarningsOptimization, lldb_private::Debugger::GetAsyncOutputStream(), lldb_private::Target::GetDebugger(), GetTarget(), lldb_private::ProcessProperties::GetWarningsOptimization(), and m_warnings_issued.

Referenced by PrintWarningOptimization().

◆ PrintWarningOptimization()

void Process::PrintWarningOptimization ( const SymbolContext sc)

Print a user-visible warning about a module being built with optimization.

Prints a async warning message to the user one time per Module where a function is found that was compiled with optimization, per Process.

Parameters
[in]scA SymbolContext with eSymbolContextFunction and eSymbolContextModule pre-computed.

Definition at line 5731 of file Process.cpp.

References lldb_private::SymbolContext::function, lldb_private::Function::GetIsOptimized(), lldb_private::ProcessProperties::GetWarningsOptimization(), lldb_private::SymbolContext::module_sp, and PrintWarning().

◆ PrivateResume()

Status Process::PrivateResume ( )
protected

◆ PrivateStateThreadIsValid()

bool lldb_private::Process::PrivateStateThreadIsValid ( ) const
inlineprotected

◆ ProcessIOHandlerExists()

bool lldb_private::Process::ProcessIOHandlerExists ( ) const
inlineprotected

Definition at line 2810 of file Process.h.

◆ ProcessIOHandlerIsActive()

bool Process::ProcessIOHandlerIsActive ( )
protected

◆ PushProcessIOHandler()

bool Process::PushProcessIOHandler ( )
protected

◆ PutSTDIN()

virtual size_t lldb_private::Process::PutSTDIN ( const char *  buf,
size_t  buf_size,
Status error 
)
inlinevirtual

Puts data into this process's STDIN.

Calling this method is a valid operation only if all of the following conditions are true: 1) The process was launched, and not attached to. 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The process was launched without supplying a valid file path for STDIN.

Parameters
[in]bufA buffer that contains the data to write to the process's STDIN.
[in]buf_sizeThe size in bytes for the buffer buf.
Returns
The number of bytes written into buf. If this value is less than buf_size, another call to this function should be made to write the rest of the data.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessFreeBSD, and lldb_private::ProcessWindows.

Definition at line 1962 of file Process.h.

References lldb_private::Status::SetErrorString().

◆ Queues()

QueueList::QueueIterable lldb_private::Process::Queues ( )
inline

Definition at line 2076 of file Process.h.

◆ ReadCStringFromMemory() [1/2]

size_t Process::ReadCStringFromMemory ( lldb::addr_t  vm_addr,
char *  cstr,
size_t  cstr_max_len,
Status error 
)

Read a NULL terminated C string from memory.

This function will read a cache page at a time until the NULL C string terminator is found. It will stop reading if the NULL termination byte isn't found before reading cstr_max_len bytes, and the results are always guaranteed to be NULL terminated (at most cstr_max_len - 1 bytes will be read).

Definition at line 2080 of file Process.cpp.

References lldb_private::Status::Clear(), and lldb_private::Status::SetErrorString().

Referenced by lldb_private::RenderScriptRuntime::CreateExceptionResolver(), PlatformPOSIX::DoLoadImage(), GetClassDataMask(), lldb_private::AppleObjCRuntime::GetObjectDescription(), SystemRuntimeMacOSX::GetQueueNameFromThreadQAddress(), DynamicLoaderMacOSXDYLD::ReadImageInfos(), and DYLDRendezvous::ReadStringFromMemory().

◆ ReadCStringFromMemory() [2/2]

size_t Process::ReadCStringFromMemory ( lldb::addr_t  vm_addr,
std::string &  out_str,
Status error 
)

Definition at line 2007 of file Process.cpp.

References ReadCStringFromMemory().

◆ ReadMemory()

size_t Process::ReadMemory ( lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
Status error 
)
virtual

Read of memory from a process.

This function will read memory from the current process's address space and remove any traps that may have been inserted into the memory.

This function is not meant to be overridden by Process subclasses, the subclasses should implement Process::DoReadMemory (lldb::addr_t, size_t, void *).

Parameters
[in]vm_addrA virtual load address that indicates where to start reading memory from.
[out]bufA byte buffer that is at least size bytes long that will receive the memory bytes.
[in]sizeThe number of bytes to read.
[out]errorAn error that indicates the success or failure of this operation. If error indicates success (error.Success()), then the value returned can be trusted, otherwise zero will be returned.
Returns
The number of bytes that were actually read into buf. If the returned number is greater than zero, yet less than size, then this function will get called again with vm_addr, buf, and size updated appropriately. Zero is returned in the case of an error.

Reimplemented in ProcessElfCore, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Definition at line 1966 of file Process.cpp.

References lldb_private::Status::Clear(), lldb_private::ProcessProperties::GetDisableMemoryCache(), and lldb_private::Status::Success().

Referenced by lldb_private::formatters::Foundation1437::__NSArrayMSize_Impl(), lldb_private::formatters::Foundation1437::__NSDictionaryMSize_Impl(), lldb_private::formatters::Foundation1437::__NSSetMSize_Impl(), SystemRuntimeMacOSX::CompleteQueueItem(), UnwindMacOSXFrameBackchain::DoCreateRegisterContextForFrame(), CommandObjectMemoryFind::DoExecute(), DynamicLoaderMacOSXDYLD::DoInitialImageFetch(), lldb_private::ClangASTContext::DumpSummary(), lldb_private::DWARFExpression::Evaluate(), lldb_private::IRExecutionUnit::FreeNow(), GetClassDataMask(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), lldb_private::ValueObject::GetPointeeData(), SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(), SystemRuntimeMacOSX::GetQueueNameFromThreadQAddress(), DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), lldb_private::Value::GetValueAsData(), LoadValueFromConsecutiveGPRRegisters(), lldb_private::AppleObjCRuntimeV2::LookupRuntimeSymbol(), SystemRuntimeMacOSX::PopulateQueueList(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure(), lldb_private::Type::ReadFromMemory(), lldb_private::CompilerType::ReadFromMemory(), DynamicLoaderMacOSXDYLD::ReadImageInfos(), DynamicLoaderMacOSXDYLD::ReadMachHeader(), and lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded().

◆ ReadMemoryFromInferior()

size_t Process::ReadMemoryFromInferior ( lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
Status error 
)

Read of memory from a process.

This function has the same semantics of ReadMemory except that it bypasses caching.

Parameters
[in]vm_addrA virtual load address that indicates where to start reading memory from.
[out]bufA byte buffer that is at least size bytes long that will receive the memory bytes.
[in]sizeThe number of bytes to read.
[out]errorAn error that indicates the success or failure of this operation. If error indicates success (error.Success()), then the value returned can be trusted, otherwise zero will be returned.
Returns
The number of bytes that were actually read into buf. If the returned number is greater than zero, yet less than size, then this function will get called again with vm_addr, buf, and size updated appropriately. Zero is returned in the case of an error.

Definition at line 2126 of file Process.cpp.

References DoReadMemory().

Referenced by lldb_private::ProcessStructReader::ProcessStructReader(), lldb_private::MemoryCache::Read(), and DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints().

◆ ReadModuleFromMemory()

ModuleSP Process::ReadModuleFromMemory ( const FileSpec file_spec,
lldb::addr_t  header_addr,
size_t  size_to_read = 512 
)

◆ ReadPointerFromMemory()

addr_t Process::ReadPointerFromMemory ( lldb::addr_t  vm_addr,
Status error 
)

◆ ReadScalarIntegerFromMemory()

size_t Process::ReadScalarIntegerFromMemory ( lldb::addr_t  addr,
uint32_t  byte_size,
bool  is_signed,
Scalar scalar,
Status error 
)

◆ ReadSignedIntegerFromMemory()

int64_t Process::ReadSignedIntegerFromMemory ( lldb::addr_t  load_addr,
size_t  byte_size,
int64_t  fail_value,
Status error 
)

Definition at line 2161 of file Process.cpp.

References lldb_private::Scalar::SLongLong().

Referenced by ReadVBaseOffsetFromVTable().

◆ ReadStringFromMemory()

size_t Process::ReadStringFromMemory ( lldb::addr_t  vm_addr,
char *  str,
size_t  max_bytes,
Status error,
size_t  type_width = 1 
)

Read a NULL terminated string from memory.

This function will read a cache page at a time until a NULL string terminator is found. It will stop reading if an aligned sequence of NULL termination type_width bytes is not found before reading cstr_max_len bytes. The results are always guaranteed to be NULL terminated, and that no more than (max_bytes - type_width) bytes will be read.

Parameters
[in]vm_addrThe virtual load address to start the memory read.
[in]strA character buffer containing at least max_bytes.
[in]max_bytesThe maximum number of bytes to read.
[in]errorThe error status of the read operation.
[in]type_widthThe size of the null terminator (1 to 4 bytes per character). Defaults to 1.
Returns
The error status or the number of bytes prior to the null terminator.

Definition at line 2027 of file Process.cpp.

References lldb_private::Status::Clear(), lldb_private::Status::SetErrorString(), and lldb_private::Status::Success().

◆ ReadUnsignedIntegerFromMemory()

uint64_t Process::ReadUnsignedIntegerFromMemory ( lldb::addr_t  load_addr,
size_t  byte_size,
uint64_t  fail_value,
Status error 
)

Reads an unsigned integer of the specified byte size from process memory.

Parameters
[in]load_addrA load address of the integer to read.
[in]byte_sizeThe size in byte of the integer to read.
[in]fail_valueThe value to return if we fail to read an integer.
[out]errorAn error that indicates the success or failure of this operation. If error indicates success (error.Success()), then the value returned can be trusted, otherwise zero will be returned.
Returns
The unsigned integer that was read from the process memory space. If the integer was smaller than a uint64_t, any unused upper bytes will be zero filled. If the process byte order differs from the host byte order, the integer value will be appropriately byte swapped into host byte order.

Definition at line 2150 of file Process.cpp.

References lldb_private::Scalar::ULongLong().

Referenced by DynamicLoaderMacOS::CanLoadImage(), ExtractRuntimeGlobalSymbol(), lldb_private::FunctionCaller::FetchFunctionResults(), HexagonDYLDRendezvous::FindMetadata(), DYLDRendezvous::FindMetadata(), GetClassDataMask(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), SystemRuntimeMacOSX::GetExtendedBacktraceForQueueItem(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(), SystemRuntimeMacOSX::GetQueueKind(), DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), DynamicLoaderMacOS::NotifyBreakpointHit(), ReadInt(), lldb_private::DynamicLoader::ReadUnsignedIntWithSizeInBytes(), DYLDRendezvous::ReadWord(), and HexagonDYLDRendezvous::ReadWord().

◆ RefreshStateAfterStop()

virtual void lldb_private::Process::RefreshStateAfterStop ( )
pure virtual

Currently called as part of ShouldStop.

FIXME: Should really happen when the target stops before the event is taken from the queue...

This callback is called as the event is about to be queued up to allow Process plug-ins to execute some code prior to clients being notified that a process was stopped. Common operations include updating the thread list, invalidating any thread state (registers, stack, etc) prior to letting the notification go out.

Implemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, ProcessFreeBSD, ProcessElfCore, lldb_private::ProcessWindows, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Referenced by GetAddressByteSize().

◆ RegisterNotificationCallbacks()

void Process::RegisterNotificationCallbacks ( const Process::Notifications callbacks)

Register for process and thread notifications.

Clients can register notification callbacks by filling out a Process::Notifications structure and calling this function.

Parameters
[in]callbacksA structure that contains the notification baton and callback functions.
See also
Process::Notifications

Definition at line 690 of file Process.cpp.

References lldb_private::Process::Notifications::baton, and lldb_private::Process::Notifications::initialize.

◆ RemoveBreakpointOpcodesFromBuffer()

size_t Process::RemoveBreakpointOpcodesFromBuffer ( lldb::addr_t  addr,
size_t  size,
uint8_t *  buf 
) const
protected

◆ RemoveInvalidMemoryRange()

bool Process::RemoveInvalidMemoryRange ( const LoadRange region)

◆ RemoveOwnerFromBreakpointSite()

void Process::RemoveOwnerFromBreakpointSite ( lldb::user_id_t  owner_id,
lldb::user_id_t  owner_loc_id,
lldb::BreakpointSiteSP &  bp_site_sp 
)

Definition at line 1747 of file Process.cpp.

◆ ResetImageToken()

void Process::ResetImageToken ( size_t  token)

Definition at line 5795 of file Process.cpp.

References LLDB_INVALID_IMAGE_TOKEN, and m_image_tokens.

Referenced by PlatformPOSIX::UnloadImage().

◆ ResolveIndirectFunction()

addr_t Process::ResolveIndirectFunction ( const Address address,
Status error 
)
virtual

Resolve dynamically loaded indirect functions.

Parameters
[in]addressThe load address of the indirect function to resolve.
[out]errorAn error value in case the resolve fails.
Returns
The address of the resolved function. LLDB_INVALID_ADDRESS if the resolution failed.

Definition at line 5623 of file Process.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Address::CalculateSymbolContextSymbol(), lldb_private::Address::GetLoadAddress(), lldb_private::Symbol::GetName(), GetTarget(), lldb_private::InferiorCall(), LLDB_INVALID_ADDRESS, m_resolved_indirect_addresses, lldb_private::Status::SetErrorString(), and lldb_private::Status::SetErrorStringWithFormat().

◆ RestoreProcessEvents()

void Process::RestoreProcessEvents ( )

Restores the process event broadcasting to its normal state.

Definition at line 1045 of file Process.cpp.

Referenced by Halt(), StopForDestroyOrDetach(), and lldb_private::Process::ProcessEventHijacker::~ProcessEventHijacker().

◆ Resume()

Status Process::Resume ( )

Resumes all of a process's threads as configured using the Thread run control functions.

Threads for a process should be updated with one of the run control actions (resume, step, or suspend) that they should take when the process is resumed. If no run control action is given to a thread it will be resumed by default.

This function is not meant to be overridden by Process subclasses. This function will take care of disabling any breakpoints that threads may be stopped at, single stepping, and re-enabling breakpoints, and enabling the basic flow control that the plug-in instances need not worry about.

N.B. This function also sets the Write side of the Run Lock, which is unset when the corresponding stop event is pulled off the Public Event Queue. If you need to resume the process without setting the Run Lock, use PrivateResume (though you should only do that from inside the Process class.

Returns
Returns an error object.
See also
Thread:Resume()
Thread:Step()
Thread:Suspend()

Definition at line 1385 of file Process.cpp.

References lldb_private::GetLogIfAnyCategoriesSet(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_STATE, lldb_private::Log::Printf(), and lldb_private::Status::Success().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb::SBThread::GetInfoItemByPathAsString(), ApplicationDelegate::MenuDelegateAction(), lldb_private::Thread::StepIn(), lldb_private::Thread::StepOut(), lldb_private::Thread::StepOver(), and SourceFileWindowDelegate::WindowDelegateHandleChar().

◆ ResumePrivateStateThread()

void Process::ResumePrivateStateThread ( )
protected

◆ ResumeSynchronous()

Status Process::ResumeSynchronous ( Stream stream)

◆ RouteAsyncStructuredData()

bool Process::RouteAsyncStructuredData ( const StructuredData::ObjectSP  object_sp)
protected

Route the incoming structured data dictionary to the right plugin.

The incoming structured data must be a dictionary, and it must have a key named 'type' that stores a string value. The string value must be the name of the structured data feature that knows how to handle it.

Parameters
[in]object_spWhen non-null and pointing to a dictionary, the 'type' key's string value is used to look up the plugin that was registered for that structured data type. It then calls the following method on the StructuredDataPlugin instance:

virtual void HandleArrivalOfStructuredData(Process &process, ConstString type_name, const StructuredData::ObjectSP &object_sp)

Returns
True if the structured data was routed to a plugin; otherwise, false.

Definition at line 5966 of file Process.cpp.

References lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), and m_structured_data_plugin_map.

Referenced by ParseStructuredDataPacket().

◆ RunPreResumeActions()

bool Process::RunPreResumeActions ( )

◆ RunThreadPlan()

ExpressionResults Process::RunThreadPlan ( ExecutionContext exe_ctx,
lldb::ThreadPlanSP &  thread_plan_sp,
const EvaluateExpressionOptions options,
DiagnosticManager diagnostic_manager 
)

Definition at line 4648 of file Process.cpp.

References lldb_private::Status::AsCString(), lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Thread::DiscardThreadPlansUpToPlan(), lldb_private::EvaluateExpressionOptions::DoesIgnoreBreakpoints(), lldb_private::EvaluateExpressionOptions::DoesUnwindOnError(), eBroadcastBitInterrupt, lldb::eDescriptionLevelVerbose, lldb_private::eDiagnosticSeverityError, lldb_private::eDiagnosticSeverityRemark, lldb::eExpressionCompleted, lldb::eExpressionDiscarded, lldb::eExpressionHitBreakpoint, lldb::eExpressionInterrupted, lldb::eExpressionSetupError, lldb::eExpressionStoppedForDebug, lldb_private::HostThread::EqualsThread(), lldb::eStateExited, lldb::eStateInvalid, lldb::eStateRunning, lldb::eStateStopped, lldb_private::ThreadList::FindThreadByIndexID(), lldb_private::Thread::Flush(), ForceNextEventDelivery(), lldb_private::Host::GetCurrentThread(), lldb_private::StreamString::GetData(), lldb_private::EvaluateExpressionOptions::GetDebug(), lldb_private::Process::ProcessEventData::GetEventDataFromEvent(), GetExpressionTimeout(), lldb_private::Thread::GetFrameWithStackID(), lldb_private::UserID::GetID(), lldb_private::Thread::GetIndexID(), lldb_private::Process::ProcessEventData::GetInterruptedFromEvent(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::EvaluateExpressionOptions::GetOneThreadTimeout(), lldb_private::RegisterContext::GetPC(), lldb_private::Thread::GetPrivateStopInfo(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Process::ProcessEventData::GetProcessSP(), lldb_private::Thread::GetRegisterContext(), lldb_private::Process::ProcessEventData::GetRestartedFromEvent(), lldb_private::Thread::GetSelectedFrame(), lldb_private::ThreadList::GetSelectedThread(), lldb_private::ThreadList::GetSize(), lldb_private::Thread::GetStackFrameStatus(), lldb_private::Process::ProcessEventData::GetStateFromEvent(), lldb_private::EvaluateExpressionOptions::GetStopOthers(), lldb_private::StreamString::GetString(), lldb_private::ThreadList::GetThreadAtIndex(), GetThreadList(), lldb_private::ExecutionContext::GetThreadPtr(), lldb_private::EvaluateExpressionOptions::GetTimeout(), lldb_private::EvaluateExpressionOptions::GetTryAllThreads(), lldb_private::ProcessProperties::GetUtilityExpressionTimeout(), lldb_private::ThreadSafeValue< T >::GetValue(), Halt(), HandleStoppedEvent(), lldb_private::EvaluateExpressionOptions::IsForUtilityExpr(), lldb_private::HostThread::IsJoinable(), lldb_private::Thread::IsThreadPlanDone(), lldb_private::StackID::IsValid(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_STEP, LLDB_INVALID_THREAD_ID, LLDB_LOG, m_private_state, m_private_state_thread, m_public_state, m_run_thread_plan_lock, lldb_private::Listener::MakeListener(), lldb_private::DiagnosticManager::Printf(), lldb_private::Log::Printf(), lldb_private::Stream::Printf(), PrivateResume(), lldb_private::Log::PutCString(), lldb_private::Stream::PutCString(), lldb_private::Log::PutString(), lldb_private::DiagnosticManager::PutString(), lldb_private::Thread::QueueThreadPlan(), lldb_private::ExecutionContext::SetFrameSP(), lldb_private::Thread::SetSelectedFrame(), lldb_private::ThreadList::SetSelectedThreadByIndexID(), lldb_private::ThreadSafeValue< T >::SetValueNoLock(), StartPrivateStateThread(), lldb_private::StateAsCString(), StopPrivateStateThread(), lldb_private::Status::Success(), UINT32_MAX, usleep(), and lldb_private::Thread::WasThreadPlanDiscarded().

Referenced by lldb_private::LLVMUserExpression::DoExecute(), lldb_private::FunctionCaller::ExecuteFunction(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::InferiorCall(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), and IRInterpreter::Interpret().

◆ SendAsyncInterrupt()

void Process::SendAsyncInterrupt ( )

◆ SendEventData()

virtual Status lldb_private::Process::SendEventData ( const char *  data)
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2265 of file Process.h.

◆ SetCanInterpretFunctionCalls()

void lldb_private::Process::SetCanInterpretFunctionCalls ( bool  can_interpret_function_calls)
inline

Sets whether executing function calls using the interpreter is possible for this process.

Parameters
[in]can_interpret_function_callsTrue if possible; false otherwise.

Definition at line 1843 of file Process.h.

Referenced by DynamicLoaderHexagonDYLD::DidAttach().

◆ SetCanJIT()

void Process::SetCanJIT ( bool  can_jit)

Sets whether executing JIT-compiled code in this process is possible.

Parameters
[in]can_jitTrue if execution of JIT code is possible; false otherwise.

Definition at line 2406 of file Process.cpp.

Referenced by DynamicLoaderHexagonDYLD::DidAttach(), DynamicLoaderStatic::DidLaunch(), ProcessKDP::DoConnectRemote(), ProcessMachCore::DoLoadCore(), and ProcessElfCore::DoLoadCore().

◆ SetCanRunCode()

void Process::SetCanRunCode ( bool  can_run_code)

Sets whether executing code in this process is possible.

This could be either through JIT or interpreting.

Parameters
[in]can_run_codeTrue if execution of code is possible; false otherwise.

Definition at line 2410 of file Process.cpp.

Referenced by DynamicLoaderDarwinKernel::CreateInstance().

◆ SetDynamicCheckers()

void Process::SetDynamicCheckers ( DynamicCheckerFunctions dynamic_checkers)

◆ SetExitStatus()

bool Process::SetExitStatus ( int  exit_status,
const char *  cstr 
)
virtual

Set accessor for the process exit status (return code).

Sometimes a child exits and the exit can be detected by global functions (signal handler for SIGCHLD for example). This accessor allows the exit status to be set from an external source.

Setting this will cause a eStateExited event to be posted to the process event queue.

Parameters
[in]exit_statusThe value for the process's return code.
See also
lldb::StateType

Definition at line 1144 of file Process.cpp.

References lldb::eStateExited, lldb_private::GetLogIfAnyCategoriesSet(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_STATE, and lldb_private::Log::Printf().

Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), Attach(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoAttachToProcessWithID(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoAttachToProcessWithName(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), Halt(), and HandlePrivateEvent().

◆ SetNextEventAction()

void lldb_private::Process::SetNextEventAction ( Process::NextEventAction next_event_action)
inlineprotected

Definition at line 2532 of file Process.h.

Referenced by Attach(), and HandlePrivateEvent().

◆ SetPrivateState()

void Process::SetPrivateState ( lldb::StateType  state)
protected

◆ SetProcessExitStatus()

bool Process::SetProcessExitStatus ( lldb::pid_t  pid,
bool  exited,
int  signo,
int  status 
)
static

Static function that can be used with the host function Host::StartMonitoringChildProcess ().

This function can be used by lldb_private::Process subclasses when they want to watch for a local process and have its exit status automatically set when the host child process exits. Subclasses should call Host::StartMonitoringChildProcess () with: callback = Process::SetHostProcessExitStatus pid = Process::GetID() monitor_signals = false

Definition at line 1202 of file Process.cpp.

References lldb_private::Debugger::FindTargetWithProcessID(), lldb_private::GetLogIfAnyCategoriesSet(), LIBLLDB_LOG_PROCESS, and lldb_private::Log::Printf().

Referenced by lldb_private::ProcessWindows::OnExitProcess().

◆ SetPublicState()

void Process::SetPublicState ( lldb::StateType  new_state,
bool  restarted 
)
protected

◆ SetRunningUserExpression()

void Process::SetRunningUserExpression ( bool  on)

◆ SetRunningUtilityFunction()

void Process::SetRunningUtilityFunction ( bool  on)

◆ SetShouldDetach()

void lldb_private::Process::SetShouldDetach ( bool  b)
inline

Definition at line 731 of file Process.h.

◆ SetState()

void lldb_private::Process::SetState ( lldb::EventSP &  event_sp)
protected

◆ SetSTDIOFileDescriptor()

void Process::SetSTDIOFileDescriptor ( int  file_descriptor)

◆ SettingsInitialize()

void Process::SettingsInitialize ( )
static

◆ SettingsTerminate()

void Process::SettingsTerminate ( )
static

◆ SetUnixSignals()

void Process::SetUnixSignals ( lldb::UnixSignalsSP &&  signals_sp)

◆ Signal()

Status Process::Signal ( int  signal)

Sends a process a UNIX signal signal.

This function is not meant to be overridden by Process subclasses.

Returns
Returns an error object.

Definition at line 3346 of file Process.cpp.

References DidSignal(), DoSignal(), lldb_private::Status::Success(), and WillSignal().

Referenced by CommandObjectProcessSignal::DoExecute(), and lldb_private::TargetList::SignalIfRunning().

◆ StartNoticingNewThreads()

virtual bool lldb_private::Process::StartNoticingNewThreads ( )
inlinevirtual

Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts.

This is useful when you are trying to run only one thread, but either that thread or the kernel is creating new threads in the process. If you stop when the thread is created, you can immediately suspend it, and keep executing only the one thread you intend.

Returns
Returns true if we were able to start up the notification false otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2209 of file Process.h.

Referenced by lldb_private::ThreadList::WillResume().

◆ StartPrivateStateThread()

bool Process::StartPrivateStateThread ( bool  is_secondary_thread = false)
protected

◆ StartTrace()

virtual lldb::user_id_t lldb_private::Process::StartTrace ( const TraceOptions options,
Status error 
)
inlinevirtual

Starts tracing with the configuration provided in options.

To enable tracing on the complete process the thread_id in the options should be set to LLDB_INVALID_THREAD_ID. The API returns a user_id which is needed by other API's that manipulate the trace instance. The handling of erroneous or unsupported configuration is left to the trace technology implementations in the server, as they could be returned as an error, or rounded to a valid configuration to start tracing. In the later case the GetTraceConfig should supply the actual used trace configuration.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2413 of file Process.h.

References LLDB_INVALID_UID, and lldb_private::Status::SetErrorString().

◆ StateChangedIsExternallyHijacked()

bool Process::StateChangedIsExternallyHijacked ( )

Definition at line 1443 of file Process.cpp.

References g_resume_sync_name.

◆ StateChangedIsHijackedForSynchronousResume()

bool Process::StateChangedIsHijackedForSynchronousResume ( )

Definition at line 1453 of file Process.cpp.

References g_resume_sync_name.

◆ STDIOReadThreadBytesReceived()

void Process::STDIOReadThreadBytesReceived ( void *  baton,
const void *  src,
size_t  src_len 
)
staticprotected

Definition at line 4331 of file Process.cpp.

References AppendSTDOUT().

Referenced by SetSTDIOFileDescriptor().

◆ StopForDestroyOrDetach()

Status Process::StopForDestroyOrDetach ( lldb::EventSP &  exit_event_sp)
protected

◆ StopNoticingNewThreads()

virtual bool lldb_private::Process::StopNoticingNewThreads ( )
inlinevirtual

Call this to turn off the stop & notice new threads mode.

Returns
Returns true if we were able to start up the notification false otherwise.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2216 of file Process.h.

Referenced by lldb_private::ThreadList::WillResume().

◆ StopPrivateStateThread()

void Process::StopPrivateStateThread ( )
protected

◆ StopTrace()

virtual Status lldb_private::Process::StopTrace ( lldb::user_id_t  uid,
lldb::tid_t  thread_id 
)
inlinevirtual

Stops the tracing instance leading to deletion of the trace data.

The tracing instance is identified by the user_id which is obtained when tracing was started from the StartTrace. In case tracing of the complete process needs to be stopped the thread_id should be set to LLDB_INVALID_THREAD_ID. In the other case that tracing on an individual thread needs to be stopped a thread_id can be supplied.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 2425 of file Process.h.

References lldb_private::Status.

◆ SynchronouslyNotifyStateChanged()

void Process::SynchronouslyNotifyStateChanged ( lldb::StateType  state)
protected

Definition at line 709 of file Process.cpp.

Referenced by GetAddressByteSize().

◆ SyncIOHandler()

void Process::SyncIOHandler ( uint32_t  iohandler_id,
const Timeout< std::micro > &  timeout 
)

Waits for the process state to be running within a given msec timeout.

The main purpose of this is to implement an interlock waiting for HandlePrivateEvent to push an IOHandler.

Parameters
[in]timeoutThe maximum time length to wait for the process to transition to the eStateRunning state.

Definition at line 741 of file Process.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, and LLDB_LOG.

Referenced by CommandObjectThreadStepWithTypeAndScope::DoExecute(), and CommandObjectProcessContinue::DoExecute().

◆ Threads()

ThreadList::ThreadIterable lldb_private::Process::Threads ( )
inline

◆ UnregisterNotificationCallbacks()

bool Process::UnregisterNotificationCallbacks ( const Process::Notifications callbacks)

Unregister for process and thread notifications.

Clients can unregister notification callbacks by passing a copy of the original baton and callbacks in callbacks.

Parameters
[in]callbacksA structure that contains the notification baton and callback functions.
Returns
Returns true if the notification callbacks were successfully removed from the process, false otherwise.
See also
Process::Notifications

Definition at line 696 of file Process.cpp.

References lldb_private::Process::Notifications::baton, lldb_private::Process::Notifications::initialize, and lldb_private::Process::Notifications::process_state_changed.

◆ UpdateAutomaticSignalFiltering()

Status Process::UpdateAutomaticSignalFiltering ( )
protectedvirtual

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 5995 of file Process.cpp.

References lldb_private::Status.

Referenced by PrivateResume().

◆ UpdateQueueListIfNeeded()

void Process::UpdateQueueListIfNeeded ( )

Definition at line 1304 of file Process.cpp.

References lldb_private::StateIsStoppedState().

◆ UpdateThreadList()

virtual bool lldb_private::Process::UpdateThreadList ( ThreadList old_thread_list,
ThreadList new_thread_list 
)
pure virtual

◆ UpdateThreadListIfNeeded()

void Process::UpdateThreadListIfNeeded ( )

◆ WaitForProcessStopPrivate()

StateType Process::WaitForProcessStopPrivate ( lldb::EventSP &  event_sp,
const Timeout< std::micro > &  timeout 
)
protected

Definition at line 2492 of file Process.cpp.

References lldb::eStateInvalid, and lldb_private::StateIsStoppedState().

Referenced by ConnectRemote().

◆ WaitForProcessToStop()

StateType Process::WaitForProcessToStop ( const Timeout< std::micro > &  timeout,
lldb::EventSP *  event_sp_ptr = nullptr,
bool  wait_always = true,
lldb::ListenerSP  hijack_listener = lldb::ListenerSP(),
Stream stream = nullptr,
bool  use_run_lock = true 
)

◆ WarnBeforeDetach()

virtual bool lldb_private::Process::WarnBeforeDetach ( ) const
inlinevirtual

Before lldb detaches from a process, it warns the user that they are about to lose their debug session.

In some cases, this warning doesn't need to be emitted – for instance, with core file debugging where the user can reconstruct the "state" by simply re-running the debugger on the core file.

Returns

Reimplemented in ProcessElfCore, lldb_private::minidump::ProcessMinidump, and ProcessMachCore.

Definition at line 1383 of file Process.h.

References DoReadMemory(), and ReadCStringFromMemory().

◆ WillAttachToProcessWithID()

virtual Status lldb_private::Process::WillAttachToProcessWithID ( lldb::pid_t  pid)
inlinevirtual

Called before attaching to a process.

Allow Process plug-ins to execute some code before attaching a process.

Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, and ProcessKDP.

Definition at line 890 of file Process.h.

References lldb_private::Status.

Referenced by Attach().

◆ WillAttachToProcessWithName()

virtual Status lldb_private::Process::WillAttachToProcessWithName ( const char *  process_name,
bool  wait_for_launch 
)
inlinevirtual

Called before attaching to a process.

Allow Process plug-ins to execute some code before attaching a process.

Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, and ProcessKDP.

Definition at line 898 of file Process.h.

References lldb_private::Status.

Referenced by Attach().

◆ WillDestroy()

virtual Status lldb_private::Process::WillDestroy ( )
inlinevirtual

Definition at line 1150 of file Process.h.

References lldb_private::Status.

Referenced by Destroy().

◆ WillDetach()

virtual Status lldb_private::Process::WillDetach ( )
inlinevirtual

Called before detaching from a process.

Allow Process plug-ins to execute some code before detaching from a process.

Returns
Returns an error object.

Definition at line 1104 of file Process.h.

References lldb_private::Status.

Referenced by Detach().

◆ WillHalt()

virtual Status lldb_private::Process::WillHalt ( )
inlinevirtual

Called before halting to a process.

Allow Process plug-ins to execute some code before halting a process.

Returns
Returns an error object.

Definition at line 1067 of file Process.h.

References lldb_private::Status.

Referenced by HaltPrivate().

◆ WillLaunch()

virtual Status lldb_private::Process::WillLaunch ( Module module)
inlinevirtual

Called before launching to a process.

Allow Process plug-ins to execute some code before launching a process.

Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessFreeBSD, and ProcessKDP.

Definition at line 993 of file Process.h.

References lldb_private::Status.

◆ WillPublicStop()

virtual void lldb_private::Process::WillPublicStop ( )
inlinevirtual

Called when the process is about to broadcast a public stop.

There are public and private stops. Private stops are when the process is doing things like stepping and the client doesn't need to know about starts and stop that implement a thread plan. Single stepping over a source line in code might end up being implemented by one or more process starts and stops. Public stops are when clients will be notified that the process is stopped. These events typically trigger UI updates (thread stack frames to be displayed, variables to be displayed, and more). This function can be overriden and allows process subclasses to do something before the eBroadcastBitStateChanged event is sent to public clients.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote.

Definition at line 759 of file Process.h.

◆ WillResume()

virtual Status lldb_private::Process::WillResume ( )
inlinevirtual

Called before resuming to a process.

Allow Process plug-ins to execute some code before resuming a process.

Returns
Returns an error object.

Reimplemented in lldb_private::process_gdb_remote::ProcessGDBRemote, ProcessKDP, lldb_private::minidump::ProcessMinidump, ProcessElfCore, and ProcessFreeBSD.

Definition at line 1031 of file Process.h.

References lldb_private::Status.

Referenced by PrivateResume().

◆ WillSignal()

virtual Status lldb_private::Process::WillSignal ( )
inlinevirtual

Called before sending a signal to a process.

Allow Process plug-ins to execute some code before sending a signal to a process.

Returns
Returns no error if it is safe to proceed with a call to Process::DoSignal(int), otherwise an error describing what prevents the signal from being sent.

Definition at line 1136 of file Process.h.

References lldb_private::Status.

Referenced by Signal().

◆ WriteMemory()

size_t Process::WriteMemory ( lldb::addr_t  vm_addr,
const void *  buf,
size_t  size,
Status error 
)

Write memory to a process.

This function will write memory to the current process's address space and maintain any traps that might be present due to software breakpoints.

This function is not meant to be overridden by Process subclasses, the subclasses should implement Process::DoWriteMemory (lldb::addr_t, size_t, void *).

Parameters
[in]vm_addrA virtual load address that indicates where to start writing memory to.
[in]bufA byte buffer that is at least size bytes long that contains the data to write.
[in]sizeThe number of bytes to write.
Returns
The number of bytes that were actually written.

Definition at line 2208 of file Process.cpp.

References lldb_private::Status::Fail(), lldb_private::BreakpointSiteList::ForEach(), lldb_private::BreakpointSite::GetSavedOpcodeBytes(), lldb_private::BreakpointSite::IntersectsRange(), lldb_private::BreakpointSiteList::IsEmpty(), lldb_private::Status::SetErrorToGenericError(), lldb_private::Status::Success(), and UNUSED_IF_ASSERT_DISABLED.

Referenced by CommandObjectMemoryWrite::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::ValueObject::SetData(), and lldb_private::CompilerType::WriteToMemory().

◆ WriteMemoryPrivate()

size_t Process::WriteMemoryPrivate ( lldb::addr_t  addr,
const void *  buf,
size_t  size,
Status error 
)
protected

Definition at line 2192 of file Process.cpp.

References DoWriteMemory().

◆ WriteObjectFile()

Status Process::WriteObjectFile ( std::vector< ObjectFile::LoadableData entries)
virtual

◆ WritePointerToMemory()

bool Process::WritePointerToMemory ( lldb::addr_t  vm_addr,
lldb::addr_t  ptr_value,
Status error 
)

Definition at line 2180 of file Process.cpp.

◆ WriteScalarToMemory()

size_t Process::WriteScalarToMemory ( lldb::addr_t  vm_addr,
const Scalar scalar,
size_t  size,
Status error 
)

Write all or part of a scalar value to memory.

The value contained in scalar will be swapped to match the byte order of the process that is being debugged. If size is less than the size of scalar, the least significant size bytes from scalar will be written. If size is larger than the byte size of scalar, then the extra space will be padded with zeros and the scalar value will be placed in the least significant bytes in memory.

Parameters
[in]vm_addrA virtual load address that indicates where to start writing memory to.
[in]scalarThe scalar to write to the debugged process.
[in]sizeThis value can be smaller or larger than the scalar value itself. If size is smaller than the size of scalar, the least significant bytes in scalar will be used. If size is larger than the byte size of scalar, then the extra space will be padded with zeros. If size is set to UINT32_MAX, then the size of scalar will be used.
[out]errorAn error value in case the memory write fails.
Returns
The number of bytes that were actually written.

Definition at line 2284 of file Process.cpp.

References lldb_private::Scalar::GetAsMemoryData(), lldb_private::Scalar::GetByteSize(), lldb_private::Status::SetErrorString(), and UINT32_MAX.

Referenced by lldb_private::ValueObject::SetValueFromCString(), and lldb_private::FunctionCaller::WriteFunctionArguments().

Friends And Related Function Documentation

◆ Debugger

friend class Debugger
friend

Definition at line 360 of file Process.h.

◆ DynamicLoader

friend class DynamicLoader
friend

Definition at line 361 of file Process.h.

◆ FunctionCaller

friend class FunctionCaller
friend

Definition at line 359 of file Process.h.

◆ ProcessEventData

friend class ProcessEventData
friend

Definition at line 362 of file Process.h.

◆ ProcessEventHijacker

friend class ProcessEventHijacker
friend

Definition at line 2152 of file Process.h.

◆ ProcessProperties

friend class ProcessProperties
friend

Definition at line 2153 of file Process.h.

◆ StopInfo

friend class StopInfo
friend

Definition at line 363 of file Process.h.

◆ Target

friend class Target
friend

Definition at line 364 of file Process.h.

◆ ThreadList

friend class ThreadList
friend

Definition at line 365 of file Process.h.

Member Data Documentation

◆ m_abi_sp

lldb::ABISP lldb_private::Process::m_abi_sp
protected

This is the current signal set for this process.

Definition at line 2688 of file Process.h.

Referenced by Attach(), ConnectRemote(), and DidExec().

◆ m_allocated_memory_cache

AllocatedMemoryCache lldb_private::Process::m_allocated_memory_cache
protected

Definition at line 2700 of file Process.h.

Referenced by DidExec().

◆ m_breakpoint_site_list

BreakpointSiteList lldb_private::Process::m_breakpoint_site_list
protected

This is the list of breakpoint locations we intend to insert in the target.

Definition at line 2674 of file Process.h.

◆ m_can_interpret_function_calls

bool lldb_private::Process::m_can_interpret_function_calls
protected

Definition at line 2725 of file Process.h.

◆ m_can_jit

enum { ... } lldb_private::Process::m_can_jit

◆ m_clear_thread_plans_on_stop

bool lldb_private::Process::m_clear_thread_plans_on_stop
protected

Definition at line 2718 of file Process.h.

Referenced by Halt(), and HaltPrivate().

◆ m_currently_handling_do_on_removals

bool lldb_private::Process::m_currently_handling_do_on_removals
protected

Definition at line 2709 of file Process.h.

◆ m_destroy_in_process

bool lldb_private::Process::m_destroy_in_process
protected

Definition at line 2724 of file Process.h.

Referenced by Destroy(), Detach(), ProcessKDP::DisableBreakpointSite(), and ProcessKDP::DoHalt().

◆ m_dlopen_utility_func_flag_once

std::once_flag lldb_private::Process::m_dlopen_utility_func_flag_once
protected

Definition at line 2736 of file Process.h.

Referenced by GetLoadImageUtilityFunction().

◆ m_dlopen_utility_func_up

std::unique_ptr<UtilityFunction> lldb_private::Process::m_dlopen_utility_func_up
protected

Definition at line 2735 of file Process.h.

Referenced by GetLoadImageUtilityFunction().

◆ m_dyld_up

lldb::DynamicLoaderUP lldb_private::Process::m_dyld_up
protected

◆ m_dynamic_checkers_up

lldb::DynamicCheckerFunctionsUP lldb_private::Process::m_dynamic_checkers_up
protected

The functions used by the expression parser to validate data that expressions use.

Definition at line 2679 of file Process.h.

Referenced by DidExec().

◆ m_exit_status

int lldb_private::Process::m_exit_status
protected

The exit status of the process, or -1 if not set.

Definition at line 2650 of file Process.h.

◆ m_exit_status_mutex

std::mutex lldb_private::Process::m_exit_status_mutex
protected

Mutex so m_exit_status m_exit_string can be safely accessed from multiple threads.

Definition at line 2652 of file Process.h.

◆ m_exit_string

std::string lldb_private::Process::m_exit_string
protected

A textual description of why a process exited.

Definition at line 2651 of file Process.h.

◆ m_extended_thread_list

ThreadList lldb_private::Process::m_extended_thread_list
protected

Owner for extended threads that may be generated, cleared on natural stops.

Definition at line 2661 of file Process.h.

Referenced by Flush().

◆ m_extended_thread_stop_id

uint32_t lldb_private::Process::m_extended_thread_stop_id
protected

The natural stop id when extended_thread_list was last updated.

Definition at line 2663 of file Process.h.

Referenced by Flush().

◆ m_finalize_called

bool lldb_private::Process::m_finalize_called
protected

Definition at line 2717 of file Process.h.

◆ m_finalizing

bool lldb_private::Process::m_finalizing
protected

Definition at line 2714 of file Process.h.

◆ m_force_next_event_delivery

bool lldb_private::Process::m_force_next_event_delivery
protected

Definition at line 2719 of file Process.h.

Referenced by GetAddressByteSize().

◆ m_image_tokens

std::vector<lldb::addr_t> lldb_private::Process::m_image_tokens
protected

Definition at line 2671 of file Process.h.

Referenced by AddImageToken(), DidExec(), GetImagePtrFromToken(), and ResetImageToken().

◆ m_instrumentation_runtimes

InstrumentationRuntimeCollection lldb_private::Process::m_instrumentation_runtimes
protected

Definition at line 2704 of file Process.h.

Referenced by DidExec(), GetInstrumentationRuntime(), and ModulesDidLoad().

◆ m_iohandler_sync

Predicate<uint32_t> lldb_private::Process::m_iohandler_sync
protected

Definition at line 2698 of file Process.h.

Referenced by HandlePrivateEvent().

◆ m_jit_loaders_up

lldb::JITLoaderListUP lldb_private::Process::m_jit_loaders_up
protected

◆ m_language_runtimes

LanguageRuntimeCollection lldb_private::Process::m_language_runtimes
protected

Should we detach if the process object goes away with an explicit call to Kill or Detach?

Definition at line 2703 of file Process.h.

Referenced by DidExec(), and ModulesDidLoad().

◆ m_last_broadcast_state

lldb::StateType lldb_private::Process::m_last_broadcast_state
protected

Definition at line 2720 of file Process.h.

Referenced by GetAddressByteSize(), and HaltPrivate().

◆ m_listener_sp

lldb::ListenerSP lldb_private::Process::m_listener_sp
protected

Shared pointer to the listener used for public events.

Can not be empty.

Definition at line 2672 of file Process.h.

Referenced by lldb_private::ProcessAttachInfo::GetListenerForProcess().

◆ m_memory_cache

MemoryCache lldb_private::Process::m_memory_cache
protected

◆ m_mod_id

ProcessModID lldb_private::Process::m_mod_id
protected

Tracks the state of the process over stops and other alterations.

Definition at line 2642 of file Process.h.

Referenced by PrivateResume(), and PushProcessIOHandler().

◆ m_next_event_action_up

std::unique_ptr<NextEventAction> lldb_private::Process::m_next_event_action_up
protected

Definition at line 2705 of file Process.h.

Referenced by HandlePrivateEvent().

◆ m_notifications

std::vector<Notifications> lldb_private::Process::m_notifications
protected

The list of notifications that this process can deliver.

Definition at line 2669 of file Process.h.

◆ m_os_up

lldb::OperatingSystemUP lldb_private::Process::m_os_up
protected

Definition at line 2684 of file Process.h.

Referenced by Attach(), CompleteAttach(), DidExec(), and ModulesDidLoad().

◆ m_pre_resume_actions

std::vector<PreResumeCallbackAndBaton> lldb_private::Process::m_pre_resume_actions
protected

◆ m_private_run_lock

ProcessRunLock lldb_private::Process::m_private_run_lock
protected

Definition at line 2708 of file Process.h.

Referenced by GetRunLock().

◆ m_private_state

ThreadSafeValue<lldb::StateType> lldb_private::Process::m_private_state
protected

Definition at line 2630 of file Process.h.

Referenced by PrivateResume(), RunThreadPlan(), and StopForDestroyOrDetach().

◆ m_private_state_broadcaster

Broadcaster lldb_private::Process::m_private_state_broadcaster
protected

Definition at line 2631 of file Process.h.

Referenced by SendAsyncInterrupt().

◆ m_private_state_control_broadcaster

Broadcaster lldb_private::Process::m_private_state_control_broadcaster
protected

Definition at line 2634 of file Process.h.

Referenced by HaltPrivate(), and StopPrivateStateThread().

◆ m_private_state_listener_sp

lldb::ListenerSP lldb_private::Process::m_private_state_listener_sp
protected

Definition at line 2638 of file Process.h.

◆ m_private_state_thread

HostThread lldb_private::Process::m_private_state_thread
protected

Thread ID for the thread that watches internal state events.

Definition at line 2640 of file Process.h.

Referenced by GetRunLock(), RunThreadPlan(), StartPrivateStateThread(), and StopPrivateStateThread().

◆ m_process_input_reader

lldb::IOHandlerSP lldb_private::Process::m_process_input_reader
protected

◆ m_process_unique_id

uint32_t lldb_private::Process::m_process_unique_id
protected

Each lldb_private::Process class that is created gets a unique integer ID that increments with each new instance.

Definition at line 2644 of file Process.h.

◆ m_profile_data

std::vector<std::string> lldb_private::Process::m_profile_data
protected

Definition at line 2697 of file Process.h.

Referenced by BroadcastAsyncProfileData(), and GetAsyncProfileData().

◆ m_profile_data_comm_mutex

std::recursive_mutex lldb_private::Process::m_profile_data_comm_mutex
protected

Definition at line 2696 of file Process.h.

Referenced by BroadcastAsyncProfileData(), and GetAsyncProfileData().

◆ m_public_run_lock

ProcessRunLock lldb_private::Process::m_public_run_lock
protected

Definition at line 2707 of file Process.h.

Referenced by Attach(), Destroy(), Detach(), GetRunLock(), and HaltPrivate().

◆ m_public_state

ThreadSafeValue<lldb::StateType> lldb_private::Process::m_public_state
protected

◆ m_queue_list

QueueList lldb_private::Process::m_queue_list
protected

The list of libdispatch queues at a given stop point.

Definition at line 2666 of file Process.h.

Referenced by Flush().

◆ m_queue_list_stop_id

uint32_t lldb_private::Process::m_queue_list_stop_id
protected

The natural stop id when queue list was last fetched.

Definition at line 2667 of file Process.h.

Referenced by Flush().

◆ m_resolved_indirect_addresses

std::map<lldb::addr_t, lldb::addr_t> lldb_private::Process::m_resolved_indirect_addresses
protected

This helps with the Public event coalescing in ShouldBroadcastEvent.

Definition at line 2723 of file Process.h.

Referenced by ResolveIndirectFunction().

◆ m_resume_requested

bool lldb_private::Process::m_resume_requested
protected

◆ m_run_thread_plan_lock

std::mutex lldb_private::Process::m_run_thread_plan_lock
protected

Definition at line 2730 of file Process.h.

Referenced by RunThreadPlan().

◆ m_should_detach

bool lldb_private::Process::m_should_detach
protected

Definition at line 2701 of file Process.h.

Referenced by Attach(), and Destroy().

◆ m_stderr_data

std::string lldb_private::Process::m_stderr_data
protected

Definition at line 2695 of file Process.h.

Referenced by AppendSTDERR(), and GetSTDERR().

◆ m_stdin_forward

bool lldb_private::Process::m_stdin_forward
protected

◆ m_stdio_communication

Communication lldb_private::Process::m_stdio_communication
protected

◆ m_stdio_communication_mutex

std::recursive_mutex lldb_private::Process::m_stdio_communication_mutex
protected

Definition at line 2691 of file Process.h.

Referenced by AppendSTDERR(), AppendSTDOUT(), GetSTDERR(), and GetSTDOUT().

◆ m_stdout_data

std::string lldb_private::Process::m_stdout_data
protected

Remember if stdin must be forwarded to remote debug server.

Definition at line 2694 of file Process.h.

Referenced by AppendSTDOUT(), and GetSTDOUT().

◆ m_structured_data_plugin_map

StructuredDataPluginMap lldb_private::Process::m_structured_data_plugin_map
protected

◆ m_system_runtime_up

lldb::SystemRuntimeUP lldb_private::Process::m_system_runtime_up
protected

Definition at line 2685 of file Process.h.

Referenced by Attach(), and DidExec().

◆ m_target_wp

std::weak_ptr<Target> lldb_private::Process::m_target_wp
protected

The target that owns this process.

Definition at line 2627 of file Process.h.

Referenced by CalculateTarget().

◆ m_thread_id_to_index_id_map

std::map<uint64_t, uint32_t> lldb_private::Process::m_thread_id_to_index_id_map
protected

◆ m_thread_index_id

uint32_t lldb_private::Process::m_thread_index_id
protected

Each thread is created with a 1 based index that won't get re-used.

Definition at line 2647 of file Process.h.

◆ m_thread_list

ThreadList lldb_private::Process::m_thread_list
protected

◆ m_thread_list_real

ThreadList lldb_private::Process::m_thread_list_real
protected

◆ m_thread_mutex

std::recursive_mutex lldb_private::Process::m_thread_mutex
protected

Definition at line 2654 of file Process.h.

Referenced by lldb_private::ThreadList::GetMutex().

◆ m_unix_signals_sp

lldb::UnixSignalsSP lldb_private::Process::m_unix_signals_sp
protected

◆ m_warnings_issued

WarningsCollection lldb_private::Process::m_warnings_issued
protected

Definition at line 2728 of file Process.h.

Referenced by PrintWarning().


The documentation for this class was generated from the following files: