LLDB  mainline
Classes | 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_gdb_remote::ProcessGDBRemote Class Reference

#include <ProcessGDBRemote.h>

Inheritance diagram for lldb_private::process_gdb_remote::ProcessGDBRemote:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::process_gdb_remote::ProcessGDBRemote:
Collaboration graph
[legend]

Public Member Functions

 ProcessGDBRemote (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp)
 
 ~ProcessGDBRemote () override
 
bool CanDebug (lldb::TargetSP target_sp, bool plugin_specified_by_name) override
 Check if a plug-in instance can debug the file in module. More...
 
CommandObjectGetPluginCommandObject () override
 Return a multi-word command object that can be used to expose plug-in specific commands. More...
 
Status WillLaunch (Module *module) override
 Called before launching to a process. More...
 
Status DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) override
 Launch a new process. More...
 
void DidLaunch () override
 Called after launching a process. More...
 
Status WillAttachToProcessWithID (lldb::pid_t pid) override
 Called before attaching to a process. More...
 
Status WillAttachToProcessWithName (const char *process_name, bool wait_for_launch) override
 Called before attaching to a process. More...
 
Status DoConnectRemote (Stream *strm, llvm::StringRef remote_url) override
 Attach to a remote system via a URL. More...
 
Status WillLaunchOrAttach ()
 
Status DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info) override
 Attach to an existing process using a process ID. More...
 
Status DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info) override
 Attach to an existing process using a partial process name. More...
 
void DidAttach (ArchSpec &process_arch) override
 Called after attaching a process. More...
 
ConstString GetPluginName () override
 
uint32_t GetPluginVersion () override
 
Status WillResume () override
 Called before resuming to a process. More...
 
Status DoResume () override
 Resumes all of a process's threads as configured using the Thread run control functions. More...
 
Status DoHalt (bool &caused_stop) override
 Halts a running process. More...
 
Status DoDetach (bool keep_stopped) override
 Detaches from a running or stopped process. More...
 
bool DetachRequiresHalt () override
 
Status DoSignal (int signal) override
 Sends a process a UNIX signal signal. More...
 
Status DoDestroy () override
 
void RefreshStateAfterStop () override
 Currently called as part of ShouldStop. More...
 
void SetUnixSignals (const lldb::UnixSignalsSP &signals_sp)
 
bool IsAlive () override
 Check if a process is still alive. More...
 
lldb::addr_t GetImageInfoAddress () override
 Get the image information address for the current process. More...
 
void WillPublicStop () override
 Called when the process is about to broadcast a public stop. More...
 
size_t DoReadMemory (lldb::addr_t addr, void *buf, size_t size, Status &error) override
 Actually do the reading of memory from a process. More...
 
Status WriteObjectFile (std::vector< ObjectFile::LoadableData > entries) override
 
size_t DoWriteMemory (lldb::addr_t addr, const void *buf, size_t size, Status &error) override
 Actually do the writing of memory to a process. More...
 
lldb::addr_t DoAllocateMemory (size_t size, uint32_t permissions, Status &error) override
 Actually allocate memory in the process. More...
 
Status GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &region_info) override
 Locate the memory region that contains load_addr. More...
 
Status DoDeallocateMemory (lldb::addr_t ptr) override
 Actually deallocate memory in the process. More...
 
size_t PutSTDIN (const char *buf, size_t buf_size, Status &error) override
 Puts data into this process's STDIN. More...
 
Status EnableBreakpointSite (BreakpointSite *bp_site) override
 
Status DisableBreakpointSite (BreakpointSite *bp_site) override
 
Status EnableWatchpoint (Watchpoint *wp, bool notify=true) override
 
Status DisableWatchpoint (Watchpoint *wp, bool notify=true) override
 
Status GetWatchpointSupportInfo (uint32_t &num) override
 
lldb::user_id_t StartTrace (const TraceOptions &options, Status &error) override
 Starts tracing with the configuration provided in options. More...
 
Status StopTrace (lldb::user_id_t uid, lldb::tid_t thread_id) override
 Stops the tracing instance leading to deletion of the trace data. More...
 
Status GetData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0) override
 Provides the trace data as raw bytes. More...
 
Status GetMetaData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0) override
 Similar API as above except for obtaining meta data. More...
 
Status GetTraceConfig (lldb::user_id_t uid, TraceOptions &options) override
 API to obtain the trace configuration used by a trace instance. More...
 
Status GetWatchpointSupportInfo (uint32_t &num, bool &after) override
 
bool StartNoticingNewThreads () override
 Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts. More...
 
bool StopNoticingNewThreads () override
 Call this to turn off the stop & notice new threads mode. More...
 
GDBRemoteCommunicationClientGetGDBRemote ()
 
Status SendEventData (const char *data) override
 
void DidExit () override
 
void SetUserSpecifiedMaxMemoryTransferSize (uint64_t user_specified_max)
 
bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec) override
 Try to fetch the module specification for a module with the given file name and architecture. More...
 
void PrefetchModuleSpecs (llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple) override
 
llvm::VersionTuple GetHostOSVersion () override
 Sometimes the connection to a process can detect the host OS version that the process is running on. More...
 
size_t LoadModules (LoadedModuleInfoList &module_list) override
 
size_t LoadModules () override
 Sometimes processes know how to retrieve and load shared libraries. More...
 
Status GetFileLoadAddress (const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr) override
 Try to find the load address of a file. More...
 
void ModulesDidLoad (ModuleList &module_list) override
 
StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_address, lldb::addr_t image_count) override
 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...
 
Status ConfigureStructuredData (ConstString type_name, const StructuredData::ObjectSP &config_sp) override
 Configure asynchronous structured data feature. More...
 
StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos () override
 
StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (const std::vector< lldb::addr_t > &load_addresses) override
 
StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos_sender (StructuredData::ObjectSP args)
 
StructuredData::ObjectSP GetSharedCacheInfo () override
 
std::string HarmonizeThreadIdsForProfileData (StringExtractorGDBRemote &inputStringExtractor)
 
- Public Member Functions inherited from lldb_private::Process
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 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 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 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)
 
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 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 void DidResume ()
 Called after resuming a process. More...
 
virtual Status WillHalt ()
 Called before halting to a process. More...
 
virtual void DidHalt ()
 Called after halting a process. More...
 
virtual Status WillDetach ()
 Called before detaching from a process. More...
 
virtual void DidDetach ()
 Called after detaching from a process. More...
 
virtual Status WillSignal ()
 Called before sending a signal to a process. More...
 
virtual Status WillDestroy ()
 
virtual void DidDestroy ()
 
virtual bool DestroyRequiresHalt ()
 
virtual void DidSignal ()
 Called after sending a signal to a process. 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 ()
 
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...
 
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 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 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)
 
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...
 
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 GetMemoryRegions (lldb_private::MemoryRegionInfos &region_list)
 Obtain all the mapped memory regions within this process. More...
 
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...
 
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 GetAsyncProfileData (char *buf, size_t buf_size, Status &error)
 Get any available profile data. More...
 
size_t GetSoftwareBreakpointTrapOpcode (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)
 
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)
 
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 ()
 
lldb::ThreadCollectionSP GetHistoryThreads (lldb::addr_t addr)
 
lldb::InstrumentationRuntimeSP GetInstrumentationRuntime (lldb::InstrumentationRuntimeType type)
 
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...
 
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...
 
- 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 ()
 

Static Public Member Functions

static lldb::ProcessSP CreateInstance (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path)
 
static void Initialize ()
 
static void DebuggerInitialize (Debugger &debugger)
 
static void Terminate ()
 
static ConstString GetPluginNameStatic ()
 
static const char * GetPluginDescriptionStatic ()
 
- Static Public Member Functions inherited from lldb_private::Process
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  { eBroadcastBitAsyncContinue = (1 << 0), eBroadcastBitAsyncThreadShouldExit = (1 << 1), eBroadcastBitAsyncThreadDidExit = (1 << 2) }
 Broadcaster event bits definitions. More...
 
typedef std::vector< lldb::tid_ttid_collection
 
typedef std::vector< std::pair< lldb::tid_t, int > > tid_sig_collection
 
typedef std::map< lldb::addr_t, lldb::addr_tMMapMap
 
typedef std::map< uint32_t, std::string > ExpeditedRegisterMap
 
using FlashRangeVector = lldb_private::RangeVector< lldb::addr_t, size_t >
 
using FlashRange = FlashRangeVector::Entry
 
- Protected Types inherited from lldb_private::Process
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

bool IsRunning (lldb::StateType state)
 
bool IsStepping (lldb::StateType state)
 
bool CanResume (lldb::StateType state)
 
bool HasExited (lldb::StateType state)
 
bool ProcessIDIsValid () const
 
void Clear ()
 
bool UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) override
 
Status ConnectToReplayServer (repro::Loader *loader)
 
Status EstablishConnectionIfNeeded (const ProcessInfo &process_info)
 
Status LaunchAndConnectToDebugserver (const ProcessInfo &process_info)
 
void KillDebugserverProcess ()
 
void BuildDynamicRegisterInfo (bool force)
 
void SetLastStopPacket (const StringExtractorGDBRemote &response)
 
bool ParsePythonTargetDefinition (const FileSpec &target_definition_fspec)
 
const lldb::DataBufferSP GetAuxvData () override
 
StructuredData::ObjectSP GetExtendedInfoForThread (lldb::tid_t tid)
 
void GetMaxMemorySize ()
 
bool CalculateThreadStopInfo (ThreadGDBRemote *thread)
 
size_t UpdateThreadPCsFromStopReplyThreadsValue (std::string &value)
 
size_t UpdateThreadIDsFromStopReplyThreadsValue (std::string &value)
 
bool HandleNotifyPacket (StringExtractorGDBRemote &packet)
 
bool StartAsyncThread ()
 
void StopAsyncThread ()
 
lldb::StateType SetThreadStopInfo (StringExtractor &stop_packet)
 
bool GetThreadStopInfoFromJSON (ThreadGDBRemote *thread, const StructuredData::ObjectSP &thread_infos_sp)
 
lldb::ThreadSP SetThreadStopInfo (StructuredData::Dictionary *thread_dict)
 
lldb::ThreadSP SetThreadStopInfo (lldb::tid_t tid, ExpeditedRegisterMap &expedited_register_map, uint8_t signo, const std::string &thread_name, const std::string &reason, const std::string &description, uint32_t exc_type, const std::vector< lldb::addr_t > &exc_data, lldb::addr_t thread_dispatch_qaddr, bool queue_vars_valid, lldb_private::LazyBool associated_with_libdispatch_queue, lldb::addr_t dispatch_queue_t, std::string &queue_name, lldb::QueueKind queue_kind, uint64_t queue_serial)
 
void HandleStopReplySequence ()
 
void ClearThreadIDList ()
 
bool UpdateThreadIDList ()
 
void DidLaunchOrAttach (ArchSpec &process_arch)
 
Status ConnectToDebugserver (llvm::StringRef host_port)
 
const char * GetDispatchQueueNameForThread (lldb::addr_t thread_dispatch_qaddr, std::string &dispatch_queue_name)
 
DynamicLoaderGetDynamicLoader () override
 Get the dynamic loader plug-in for this process. More...
 
bool GetGDBServerRegisterInfo (ArchSpec &arch)
 
Status GetLoadedModuleList (LoadedModuleInfoList &)
 
lldb::ModuleSP LoadModuleAtAddress (const FileSpec &file, lldb::addr_t link_map, lldb::addr_t base_addr, bool value_is_offset)
 
Status UpdateAutomaticSignalFiltering () override
 
Status FlashErase (lldb::addr_t addr, size_t size)
 
Status FlashDone ()
 
bool HasErased (FlashRange range)
 
- Protected Member Functions inherited from lldb_private::Process
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)
 
void LoadOperatingSystemPlugin (bool flush)
 
- Protected Member Functions inherited from lldb_private::Broadcaster
BroadcasterImplSP GetBroadcasterImpl ()
 
const char * GetHijackingListenerName ()
 

Static Protected Member Functions

static lldb::thread_result_t AsyncThread (void *arg)
 
static bool MonitorDebugserverProcess (std::weak_ptr< ProcessGDBRemote > process_wp, lldb::pid_t pid, bool exited, int signo, int exit_status)
 
- Static Protected Member Functions inherited from lldb_private::Process
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

GDBRemoteCommunicationClient m_gdb_comm
 
GDBRemoteCommunicationReplayServer m_gdb_replay_server
 
std::atomic< lldb::pid_tm_debugserver_pid
 
std::vector< StringExtractorGDBRemotem_stop_packet_stack
 
std::recursive_mutex m_last_stop_packet_mutex
 
GDBRemoteDynamicRegisterInfo m_register_info
 
Broadcaster m_async_broadcaster
 
lldb::ListenerSP m_async_listener_sp
 
HostThread m_async_thread
 
std::recursive_mutex m_async_thread_state_mutex
 
tid_collection m_thread_ids
 
std::vector< lldb::addr_tm_thread_pcs
 
StructuredData::ObjectSP m_jstopinfo_sp
 
StructuredData::ObjectSP m_jthreadsinfo_sp
 
tid_collection m_continue_c_tids
 
tid_sig_collection m_continue_C_tids
 
tid_collection m_continue_s_tids
 
tid_sig_collection m_continue_S_tids
 
uint64_t m_max_memory_size
 
uint64_t m_remote_stub_max_memory_size
 
MMapMap m_addr_to_mmap_size
 
lldb::BreakpointSP m_thread_create_bp_sp
 
bool m_waiting_for_attach
 
bool m_destroy_tried_resuming
 
lldb::CommandObjectSP m_command_sp
 
int64_t m_breakpoint_pc_offset
 
lldb::tid_t m_initial_tid
 
bool m_replay_mode
 
bool m_allow_flash_writes
 
FlashRangeVector m_erased_flash_ranges
 
- Protected Attributes inherited from lldb_private::Process
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 ThreadGDBRemote
 
class GDBRemoteCommunicationClient
 
class GDBRemoteRegisterContext
 

Additional Inherited Members

- Public Types inherited from lldb_private::Process
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 *)
 

Detailed Description

Definition at line 49 of file ProcessGDBRemote.h.

Member Typedef Documentation

◆ ExpeditedRegisterMap

Definition at line 261 of file ProcessGDBRemote.h.

◆ FlashRange

Definition at line 290 of file ProcessGDBRemote.h.

◆ FlashRangeVector

Definition at line 289 of file ProcessGDBRemote.h.

◆ MMapMap

Definition at line 260 of file ProcessGDBRemote.h.

◆ tid_collection

Definition at line 258 of file ProcessGDBRemote.h.

◆ tid_sig_collection

Definition at line 259 of file ProcessGDBRemote.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Broadcaster event bits definitions.

Enumerator
eBroadcastBitAsyncContinue 
eBroadcastBitAsyncThreadShouldExit 
eBroadcastBitAsyncThreadDidExit 

Definition at line 239 of file ProcessGDBRemote.h.

Constructor & Destructor Documentation

◆ ProcessGDBRemote()

ProcessGDBRemote::ProcessGDBRemote ( lldb::TargetSP  target_sp,
lldb::ListenerSP  listener_sp 
)

◆ ~ProcessGDBRemote()

ProcessGDBRemote::~ProcessGDBRemote ( )
override

Member Function Documentation

◆ AsyncThread()

thread_result_t ProcessGDBRemote::AsyncThread ( void *  arg)
staticprotected

Definition at line 3733 of file ProcessGDBRemote.cpp.

References lldb_private::Status::AsCString(), ClearThreadIDList(), eBroadcastBitAsyncContinue, eBroadcastBitAsyncThreadShouldExit, lldb_private::process_gdb_remote::GDBRemoteCommunication::eBroadcastBitGdbReadThreadGotNotify, lldb::eStateCrashed, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateRunning, lldb::eStateStopped, lldb::eStateSuspended, lldb_private::Status::Fail(), GDBR_LOG_PROCESS, lldb_private::EventDataBytes::GetBytes(), lldb_private::EventDataBytes::GetByteSize(), StringExtractor::GetBytesLeft(), StringExtractor::GetChar(), StringExtractorGDBRemote::GetError(), lldb_private::EventDataBytes::GetEventDataFromEvent(), GetGDBRemote(), StringExtractor::GetHexByteString(), StringExtractor::GetHexU8(), lldb_private::UserID::GetID(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::GetLogIfAllCategoriesSet(), StringExtractor::GetNameColonValue(), lldb_private::TargetProperties::GetNonStopModeEnabled(), StringExtractorGDBRemote::GetStatus(), lldb_private::Process::GetTarget(), lldb_private::Process::GetUnixSignals(), HandleNotifyPacket(), LIBLLDB_LOG_STEP, m_async_broadcaster, m_async_listener_sp, m_gdb_comm, lldb_private::process_gdb_remote::None, lldb_private::Log::Printf(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendvContPacket(), lldb_private::Process::SetExitStatus(), StringExtractor::SetFilePos(), SetLastStopPacket(), and lldb_private::Process::SetPrivateState().

Referenced by StartAsyncThread().

◆ BuildDynamicRegisterInfo()

void ProcessGDBRemote::BuildDynamicRegisterInfo ( bool  force)
protected

Definition at line 471 of file ProcessGDBRemote.cpp.

References DynamicRegisterInfo::AddRegister(), AugmentRegisterInfoViaABI(), DynamicRegisterInfo::Clear(), lldb::eEncodingInvalid, lldb::eEncodingUint, lldb::eFormatBinary, lldb::eFormatDecimal, lldb::eFormatFloat, lldb::eFormatHex, lldb::eFormatInvalid, lldb::eFormatVectorOfFloat32, lldb::eFormatVectorOfSInt16, lldb::eFormatVectorOfSInt32, lldb::eFormatVectorOfSInt8, lldb::eFormatVectorOfUInt128, lldb::eFormatVectorOfUInt16, lldb::eFormatVectorOfUInt32, lldb::eFormatVectorOfUInt64, lldb::eFormatVectorOfUInt8, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, lldb::eRegisterKindGeneric, StringExtractorGDBRemote::eResponse, DynamicRegisterInfo::Finalize(), lldb_private::ABI::FindPlugin(), lldb_private::Target::GetArchitecture(), lldb_private::Debugger::GetAsyncOutputStream(), lldb_private::Target::GetDebugger(), GetGDBServerRegisterInfo(), StringExtractor::GetHexBytesAvail(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostArchitecture(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostDefaultPacketTimeout(), StringExtractor::GetNameColonValue(), DynamicRegisterInfo::GetNumRegisters(), lldb_private::FileSpec::GetPath(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetProcessArchitecture(), StringExtractorGDBRemote::GetResponseType(), lldb_private::Process::GetTarget(), lldb_private::process_gdb_remote::GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(), lldb_private::FileSystem::Instance(), lldb_private::ArchSpec::IsValid(), LLDB_INVALID_REGNUM, m_gdb_comm, m_register_info, ParsePythonTargetDefinition(), lldb_private::FileSystem::Resolve(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(), lldb_private::ConstString::SetString(), SplitCommaSeparatedRegisterNumberString(), lldb_private::Args::StringToEncoding(), lldb_private::Args::StringToGenericRegister(), lldb_private::process_gdb_remote::GDBRemoteCommunication::Success, lldb_private::Success, lldb_private::OptionArgParser::ToFormat(), UINT32_MAX, and UNUSED_IF_ASSERT_DISABLED.

Referenced by DidLaunchOrAttach(), HarmonizeThreadIdsForProfileData(), SetLastStopPacket(), and SetThreadStopInfo().

◆ CalculateThreadStopInfo()

bool ProcessGDBRemote::CalculateThreadStopInfo ( ThreadGDBRemote thread)
protected

◆ CanDebug()

bool ProcessGDBRemote::CanDebug ( lldb::TargetSP  target,
bool  plugin_specified_by_name 
)
overridevirtual

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.

Implements lldb_private::Process.

Definition at line 260 of file ProcessGDBRemote.cpp.

References lldb_private::Module::GetFileSpec(), lldb_private::Module::GetObjectFile(), and lldb_private::ObjectFile::GetType().

◆ CanResume()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::CanResume ( lldb::StateType  state)
inlineprotected

Definition at line 302 of file ProcessGDBRemote.h.

References lldb::eStateStopped.

◆ Clear()

void ProcessGDBRemote::Clear ( )
protected

◆ ClearThreadIDList()

void ProcessGDBRemote::ClearThreadIDList ( )
protected

◆ ConfigureStructuredData()

Status ProcessGDBRemote::ConfigureStructuredData ( ConstString  type_name,
const StructuredData::ObjectSP config_sp 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 4207 of file ProcessGDBRemote.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(), and m_gdb_comm.

◆ ConnectToDebugserver()

Status ProcessGDBRemote::ConnectToDebugserver ( llvm::StringRef  host_port)
protected

Definition at line 1012 of file ProcessGDBRemote.cpp.

References lldb_private::Communication::Disconnect(), lldb::eConnectionStatusSuccess, lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::EnableErrorStringInPacket(), GDBR_LOG_PROCESS, lldb_private::Args::GetArgumentCount(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetDefaultThreadId(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetEchoSupported(), lldb_private::ProcessProperties::GetExtraStartupCommands(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetListThreadsInStopReplySupported(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::Process::GetTarget(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadSuffixSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVAttachOrWaitSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVContSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::HandshakeWithServer(), lldb_private::Communication::IsConnected(), m_gdb_comm, m_initial_tid, lldb_private::Log::Printf(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(), lldb_private::Communication::SetConnection(), lldb_private::Status::SetErrorString(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetNonStopMode(), lldb_private::TargetProperties::SetNonStopModeEnabled(), lldb_private::Communication::StartReadThread(), lldb_private::Status::Success(), usleep(), and lldb_private::Status::WasInterrupted().

Referenced by ConnectToReplayServer(), DoConnectRemote(), and LaunchAndConnectToDebugserver().

◆ ConnectToReplayServer()

Status ProcessGDBRemote::ConnectToReplayServer ( repro::Loader loader)
protected

◆ CreateInstance()

lldb::ProcessSP ProcessGDBRemote::CreateInstance ( lldb::TargetSP  target_sp,
lldb::ListenerSP  listener_sp,
const FileSpec crash_file_path 
)
static

Definition at line 251 of file ProcessGDBRemote.cpp.

Referenced by Initialize().

◆ DebuggerInitialize()

void ProcessGDBRemote::DebuggerInitialize ( Debugger debugger)
static

◆ DetachRequiresHalt()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::DetachRequiresHalt ( )
inlineoverridevirtual

Reimplemented from lldb_private::Process.

Definition at line 115 of file ProcessGDBRemote.h.

References DoReadMemory(), and DoWriteMemory().

◆ DidAttach()

void ProcessGDBRemote::DidAttach ( ArchSpec process_arch)
overridevirtual

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 from lldb_private::Process.

Definition at line 1318 of file ProcessGDBRemote.cpp.

References lldb_private::ArchSpec::Clear(), and DidLaunchOrAttach().

◆ DidExit()

void ProcessGDBRemote::DidExit ( )
overridevirtual

Reimplemented from lldb_private::Process.

Definition at line 1313 of file ProcessGDBRemote.cpp.

References lldb_private::Communication::Disconnect(), and m_gdb_comm.

◆ DidLaunch()

void ProcessGDBRemote::DidLaunch ( )
overridevirtual

Called after launching a process.

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

Reimplemented from lldb_private::Process.

Definition at line 1215 of file ProcessGDBRemote.cpp.

References DidLaunchOrAttach().

◆ DidLaunchOrAttach()

void ProcessGDBRemote::DidLaunchOrAttach ( ArchSpec process_arch)
protected

◆ DisableBreakpointSite()

Status ProcessGDBRemote::DisableBreakpointSite ( BreakpointSite bp_site)
overridevirtual

◆ DisableWatchpoint()

Status ProcessGDBRemote::DisableWatchpoint ( Watchpoint wp,
bool  notify = true 
)
overridevirtual

◆ DoAllocateMemory()

lldb::addr_t ProcessGDBRemote::DoAllocateMemory ( size_t  size,
uint32_t  permissions,
Status error 
)
overridevirtual

◆ DoAttachToProcessWithID()

Status ProcessGDBRemote::DoAttachToProcessWithID ( lldb::pid_t  pid,
const ProcessAttachInfo attach_info 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 1220 of file ProcessGDBRemote.cpp.

References lldb_private::Status::AsCString(), lldb_private::Broadcaster::BroadcastEvent(), Clear(), eBroadcastBitAsyncContinue, EstablishConnectionIfNeeded(), GDBR_LOG_PROCESS, lldb_private::ProcessAttachInfo::GetDetachOnError(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), LLDB_INVALID_PROCESS_ID, m_async_broadcaster, m_gdb_comm, lldb_private::Log::Printf(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDetachOnError(), lldb_private::Process::SetExitStatus(), lldb_private::UserID::SetID(), and lldb_private::Status::Success().

◆ DoAttachToProcessWithName()

Status ProcessGDBRemote::DoAttachToProcessWithName ( const char *  process_name,
const ProcessAttachInfo attach_info 
)
overridevirtual

◆ DoConnectRemote()

Status ProcessGDBRemote::DoConnectRemote ( Stream strm,
llvm::StringRef  remote_url 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 706 of file ProcessGDBRemote.cpp.

References ConnectToDebugserver(), lldb_private::UnixSignals::Create(), lldb::eStateConnected, lldb::eStateInvalid, lldb_private::Status::Fail(), GDBR_LOG_PROCESS, lldb_private::Target::GetArchitecture(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostArchitecture(), lldb_private::UserID::GetID(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::Target::GetPlatform(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetProcessArchitecture(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetStopReply(), lldb_private::Process::GetTarget(), lldb_private::Process::GetThreadList(), HandleStopReplySequence(), lldb_private::ArchSpec::IsValid(), lldb_private::Process::IsValid(), LLDB_INVALID_PROCESS_ID, m_gdb_comm, lldb_private::Log::Printf(), lldb_private::Target::SetArchitecture(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::UserID::SetID(), SetLastStopPacket(), lldb_private::Process::SetPrivateState(), SetThreadStopInfo(), SetUnixSignals(), StartAsyncThread(), lldb_private::StateAsCString(), lldb_private::Status::Success(), and WillLaunchOrAttach().

◆ DoDeallocateMemory()

Status ProcessGDBRemote::DoDeallocateMemory ( lldb::addr_t  ptr)
overridevirtual

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 from lldb_private::Process.

Definition at line 3089 of file ProcessGDBRemote.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DeallocateMemory(), lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::InferiorCallMunmap(), m_addr_to_mmap_size, m_gdb_comm, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SupportsAllocDeallocMemory().

◆ DoDestroy()

Status ProcessGDBRemote::DoDestroy ( )
overridevirtual

Implements lldb_private::Process.

Definition at line 2502 of file ProcessGDBRemote.cpp.

References ClearThreadIDList(), lldb_private::Process::Destroy(), lldb_private::Process::DisableAllBreakpointSites(), lldb_private::ThreadList::DiscardThreadPlans(), lldb::eStateAttaching, lldb::eStateRunning, lldb::eStateSuspended, lldb::eStopReasonBreakpoint, lldb::eStopReasonException, lldb::eStopReasonInvalid, GDBR_LOG_PROCESS, StringExtractor::GetChar(), StringExtractor::GetHexU8(), lldb_private::UserID::GetID(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::ThreadList::GetMutex(), lldb_private::Target::GetPlatform(), PlatformRemoteiOS::GetPluginNameStatic(), lldb_private::ThreadList::GetSize(), StringExtractor::GetStringRef(), lldb_private::Process::GetTarget(), lldb_private::ThreadList::GetThreadAtIndex(), lldb_private::Process::GetThreadList(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadSuffixSupported(), lldb_private::ThreadSafeValue< T >::GetValue(), lldb_private::Communication::IsConnected(), KillDebugserverProcess(), m_destroy_tried_resuming, m_gdb_comm, lldb_private::Process::m_public_state, lldb_private::Process::m_thread_list, lldb_private::Log::Printf(), lldb_private::Log::PutCString(), lldb_private::Process::Resume(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(), lldb_private::Process::SetExitStatus(), SetLastStopPacket(), StopAsyncThread(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::Success.

◆ DoDetach()

Status ProcessGDBRemote::DoDetach ( bool  keep_stopped)
overridevirtual

◆ DoHalt()

Status ProcessGDBRemote::DoHalt ( bool &  caused_stop)
overridevirtual

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 from lldb_private::Process.

Definition at line 2461 of file ProcessGDBRemote.cpp.

References lldb_private::Communication::Disconnect(), lldb::eStateAttaching, lldb_private::ThreadSafeValue< T >::GetValue(), lldb_private::process_gdb_remote::GDBRemoteClientBase::Interrupt(), m_gdb_comm, and lldb_private::Process::m_public_state.

◆ DoLaunch()

Status ProcessGDBRemote::DoLaunch ( lldb_private::Module exe_module,
ProcessLaunchInfo launch_info 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 807 of file ProcessGDBRemote.cpp.

References lldb_private::Status::AsCString(), lldb_private::ConstString::AsCString(), lldb_private::FileSystem::DEV_NULL, lldb_private::FileAction::eFileActionOpen, EstablishConnectionIfNeeded(), GDBR_LOG_PROCESS, lldb_private::Flags::Get(), lldb_private::FileAction::GetAction(), lldb_private::Module::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessLaunchInfo::GetFileActionForFD(), lldb_private::FileSpec::GetFilename(), lldb_private::FileAction::GetFileSpec(), lldb_private::Module::GetFileSpec(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetHostArchitecture(), lldb_private::UserID::GetID(), lldb_private::ProcessLaunchInfo::GetLaunchEventData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetLaunchSuccess(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::PseudoTerminal::GetMasterFileDescriptor(), lldb_private::Module::GetObjectFile(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetProcessArchitecture(), lldb_private::PseudoTerminal::GetSlaveName(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetStopReply(), lldb_private::Process::GetTarget(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), HandleStopReplySequence(), lldb_private::PseudoTerminal::invalid_fd, lldb_private::ArchSpec::IsValid(), KillDebugserverProcess(), LLDB_INVALID_PROCESS_ID, m_gdb_comm, lldb_private::Process::m_stdin_forward, lldb_private::Target::MergeArchitecture(), O_NOCTTY, lldb_private::PseudoTerminal::OpenFirstAvailableMaster(), lldb_private::Log::Printf(), lldb_private::PseudoTerminal::ReleaseMasterFileDescriptor(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendArgumentsPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendEnvironment(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendLaunchArchPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendLaunchEventDataPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDisableASLR(), lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::UserID::SetID(), SetLastStopPacket(), lldb_private::Process::SetPrivateState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDIN(), lldb_private::Process::SetSTDIOFileDescriptor(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDOUT(), SetThreadStopInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetWorkingDir(), and lldb_private::Status::Success().

◆ DoReadMemory()

size_t ProcessGDBRemote::DoReadMemory ( lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
Status error 
)
overridevirtual

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.

Implements lldb_private::Process.

Definition at line 2764 of file ProcessGDBRemote.cpp.

References lldb_private::Status::Clear(), StringExtractor::GetBytesLeft(), StringExtractor::GetHexBytes(), GetMaxMemorySize(), StringExtractor::GetStringRef(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetxPacketSupported(), StringExtractorGDBRemote::IsErrorResponse(), StringExtractorGDBRemote::IsNormalResponse(), StringExtractorGDBRemote::IsUnsupportedResponse(), m_gdb_comm, m_max_memory_size, lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::process_gdb_remote::GDBRemoteCommunication::Success, and UNUSED_IF_ASSERT_DISABLED.

◆ DoResume()

Status ProcessGDBRemote::DoResume ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 1334 of file ProcessGDBRemote.cpp.

References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::StreamString::Clear(), eBroadcastBitAsyncContinue, eBroadcastBitAsyncThreadDidExit, lldb_private::process_gdb_remote::GDBRemoteCommunication::eBroadcastBitRunPacketSent, GDBR_LOG_PROCESS, lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::TargetProperties::GetNonStopModeEnabled(), lldb_private::StreamString::GetSize(), lldb_private::ThreadList::GetSize(), lldb_private::StreamString::GetString(), lldb_private::Process::GetTarget(), lldb_private::Process::GetThreadList(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetVContSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::HasAnyVContSupport(), lldb_private::HostThread::IsJoinable(), m_async_broadcaster, m_async_thread, m_continue_c_tids, m_continue_C_tids, m_continue_s_tids, m_continue_S_tids, m_gdb_comm, lldb_private::Listener::MakeListener(), lldb_private::Log::Printf(), lldb_private::Stream::Printf(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetCurrentThreadForRun(), and lldb_private::Status::SetErrorString().

◆ DoSignal()

Status ProcessGDBRemote::DoSignal ( int  signal)
overridevirtual

◆ DoWriteMemory()

size_t ProcessGDBRemote::DoWriteMemory ( lldb::addr_t  vm_addr,
const void *  buf,
size_t  size,
Status error 
)
overridevirtual

◆ EnableBreakpointSite()

Status ProcessGDBRemote::EnableBreakpointSite ( BreakpointSite bp_site)
overridevirtual

◆ EnableWatchpoint()

Status ProcessGDBRemote::EnableWatchpoint ( Watchpoint wp,
bool  notify = true 
)
overridevirtual

◆ EstablishConnectionIfNeeded()

Status ProcessGDBRemote::EstablishConnectionIfNeeded ( const ProcessInfo process_info)
protected

◆ FlashDone()

Status ProcessGDBRemote::FlashDone ( )
protected

◆ FlashErase()

Status ProcessGDBRemote::FlashErase ( lldb::addr_t  addr,
size_t  size 
)
protected

◆ GetAuxvData()

const DataBufferSP ProcessGDBRemote::GetAuxvData ( )
overrideprotectedvirtual

◆ GetData()

Status ProcessGDBRemote::GetData ( lldb::user_id_t  uid,
lldb::tid_t  thread_id,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 1296 of file ProcessGDBRemote.cpp.

References m_gdb_comm, and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGetDataPacket().

◆ GetDispatchQueueNameForThread()

const char* lldb_private::process_gdb_remote::ProcessGDBRemote::GetDispatchQueueNameForThread ( lldb::addr_t  thread_dispatch_qaddr,
std::string &  dispatch_queue_name 
)
protected

◆ GetDynamicLoader()

DynamicLoader * ProcessGDBRemote::GetDynamicLoader ( )
overrideprotectedvirtual

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 from lldb_private::Process.

Definition at line 4026 of file ProcessGDBRemote.cpp.

References lldb_private::DynamicLoader::FindPlugin(), and lldb_private::Process::m_dyld_up.

Referenced by LoadModuleAtAddress().

◆ GetExtendedInfoForThread()

StructuredData::ObjectSP ProcessGDBRemote::GetExtendedInfoForThread ( lldb::tid_t  tid)
protected

◆ GetFileLoadAddress()

Status ProcessGDBRemote::GetFileLoadAddress ( const FileSpec file,
bool &  is_loaded,
lldb::addr_t load_addr 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 4913 of file ProcessGDBRemote.cpp.

References StringExtractorGDBRemote::GetError(), StringExtractor::GetHexMaxU64(), lldb_private::FileSpec::GetPath(), lldb_private::StreamString::GetString(), StringExtractorGDBRemote::IsErrorResponse(), StringExtractorGDBRemote::IsNormalResponse(), LLDB_INVALID_ADDRESS, m_gdb_comm, lldb_private::Stream::PutCString(), lldb_private::Stream::PutStringAsRawHex8(), lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::Success.

◆ GetGDBRemote()

GDBRemoteCommunicationClient& lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBRemote ( )
inline

◆ GetGDBServerRegisterInfo()

bool ProcessGDBRemote::GetGDBServerRegisterInfo ( ArchSpec arch)
protected

◆ GetHostOSVersion()

llvm::VersionTuple ProcessGDBRemote::GetHostOSVersion ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 4326 of file ProcessGDBRemote.cpp.

References DynamicRegisterInfo::AddRegister(), AugmentRegisterInfoViaABI(), lldb::eEncodingIEEE754, lldb::eEncodingUint, lldb::eFormatAddressInfo, lldb::eFormatFloat, lldb::eFormatHex, lldb::eFormatInvalid, lldb::eFormatVectorOfFloat32, lldb::eFormatVectorOfSInt16, lldb::eFormatVectorOfSInt32, lldb::eFormatVectorOfSInt8, lldb::eFormatVectorOfUInt128, lldb::eFormatVectorOfUInt16, lldb::eFormatVectorOfUInt32, lldb::eFormatVectorOfUInt64, lldb::eFormatVectorOfUInt8, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, lldb::eRegisterKindGeneric, lldb::eRegisterKindProcessPlugin, lldb_private::XMLNode::ForEachAttribute(), lldb_private::XMLNode::ForEachChildElementWithName(), StringExtractor::GetHexBytesAvail(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetOSVersion(), StringExtractor::GetStringRef(), LLDB_INVALID_REGNUM, m_gdb_comm, lldb_private::ConstString::SetCString(), lldb_private::ConstString::SetString(), SplitCommaSeparatedRegisterNumberString(), lldb_private::Args::StringToEncoding(), lldb_private::Args::StringToGenericRegister(), lldb_private::Success, lldb_private::OptionArgParser::ToFormat(), lldb_private::StringConvert::ToUInt32(), UINT32_MAX, and UNUSED_IF_ASSERT_DISABLED.

◆ GetImageInfoAddress()

addr_t ProcessGDBRemote::GetImageInfoAddress ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 2725 of file ProcessGDBRemote.cpp.

References GetLoadedModuleList(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetShlibInfoAddr(), LLDB_INVALID_ADDRESS, m_gdb_comm, lldb_private::LoadedModuleInfoList::m_link_map, and lldb_private::Success.

◆ GetLoadedDynamicLibrariesInfos() [1/3]

StructuredData::ObjectSP ProcessGDBRemote::GetLoadedDynamicLibrariesInfos ( lldb::addr_t  image_list_address,
lldb::addr_t  image_count 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 4102 of file ProcessGDBRemote.cpp.

References GetLoadedDynamicLibrariesInfos_sender().

◆ GetLoadedDynamicLibrariesInfos() [2/3]

StructuredData::ObjectSP ProcessGDBRemote::GetLoadedDynamicLibrariesInfos ( )
overridevirtual

Reimplemented from lldb_private::Process.

Definition at line 4113 of file ProcessGDBRemote.cpp.

References GetLoadedDynamicLibrariesInfos_sender().

◆ GetLoadedDynamicLibrariesInfos() [3/3]

StructuredData::ObjectSP ProcessGDBRemote::GetLoadedDynamicLibrariesInfos ( const std::vector< lldb::addr_t > &  load_addresses)
overridevirtual

Reimplemented from lldb_private::Process.

Definition at line 4121 of file ProcessGDBRemote.cpp.

References GetLoadedDynamicLibrariesInfos_sender().

◆ GetLoadedDynamicLibrariesInfos_sender()

StructuredData::ObjectSP ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender ( StructuredData::ObjectSP  args)

◆ GetLoadedModuleList()

Status ProcessGDBRemote::GetLoadedModuleList ( LoadedModuleInfoList list)
protected

Definition at line 4650 of file ProcessGDBRemote.cpp.

References lldb_private::LoadedModuleInfoList::add(), lldb_private::LoadedModuleInfoList::clear(), lldb::eErrorTypeGeneric, lldb_private::XMLNode::FindFirstChildElementWithName(), lldb_private::XMLNode::ForEachAttribute(), lldb_private::XMLNode::ForEachChildElementWithName(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::get_base(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::get_base_is_offset(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::get_dynamic(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::get_link_map(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::get_name(), lldb_private::XMLNode::GetAttributeValue(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetQXferLibrariesReadSupported(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetQXferLibrariesSVR4ReadSupported(), lldb_private::XMLDocument::GetRootElement(), LIBLLDB_LOG_PROCESS, LLDB_INVALID_ADDRESS, m_gdb_comm, lldb_private::LoadedModuleInfoList::m_link_map, lldb_private::LoadedModuleInfoList::m_list, lldb_private::XMLDocument::ParseMemory(), lldb_private::Log::Printf(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::ReadExtFeature(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::set_base(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::set_base_is_offset(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::set_dynamic(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::set_link_map(), lldb_private::LoadedModuleInfoList::LoadedModuleInfo::set_name(), lldb_private::StringConvert::ToUInt64(), and lldb_private::XMLDocument::XMLEnabled().

Referenced by GetImageInfoAddress(), and LoadModules().

◆ GetMaxMemorySize()

void ProcessGDBRemote::GetMaxMemorySize ( )
protected

◆ GetMemoryRegionInfo()

Status ProcessGDBRemote::GetMemoryRegionInfo ( lldb::addr_t  load_addr,
MemoryRegionInfo range_info 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 3070 of file ProcessGDBRemote.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetMemoryRegionInfo(), and m_gdb_comm.

Referenced by DoWriteMemory(), and FlashErase().

◆ GetMetaData()

Status ProcessGDBRemote::GetMetaData ( lldb::user_id_t  uid,
lldb::tid_t  thread_id,
llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)
overridevirtual

Similar API as above except for obtaining meta data.

Reimplemented from lldb_private::Process.

Definition at line 1302 of file ProcessGDBRemote.cpp.

References m_gdb_comm, and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGetMetaDataPacket().

◆ GetModuleSpec()

bool ProcessGDBRemote::GetModuleSpec ( const FileSpec module_file_spec,
const ArchSpec arch,
ModuleSpec module_spec 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 4280 of file ProcessGDBRemote.cpp.

References lldb_private::ModuleSpec::Dump(), lldb_private::StreamString::GetData(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModuleInfo(), lldb_private::FileSpec::GetPath(), lldb_private::ArchSpec::GetTriple(), LIBLLDB_LOG_PLATFORM, m_gdb_comm, and lldb_private::Log::Printf().

◆ GetPluginCommandObject()

CommandObject * ProcessGDBRemote::GetPluginCommandObject ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 5418 of file ProcessGDBRemote.cpp.

References lldb_private::Debugger::GetCommandInterpreter(), lldb_private::Target::GetDebugger(), lldb_private::Process::GetTarget(), and m_command_sp.

◆ GetPluginDescriptionStatic()

const char * ProcessGDBRemote::GetPluginDescriptionStatic ( )
static

Definition at line 242 of file ProcessGDBRemote.cpp.

Referenced by Initialize().

◆ GetPluginName()

ConstString ProcessGDBRemote::GetPluginName ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 373 of file ProcessGDBRemote.cpp.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

ConstString ProcessGDBRemote::GetPluginNameStatic ( )
static

Definition at line 237 of file ProcessGDBRemote.cpp.

Referenced by GetPluginName(), and Initialize().

◆ GetPluginVersion()

uint32_t ProcessGDBRemote::GetPluginVersion ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 375 of file ProcessGDBRemote.cpp.

◆ GetSharedCacheInfo()

StructuredData::ObjectSP ProcessGDBRemote::GetSharedCacheInfo ( )
overridevirtual

◆ GetThreadStopInfoFromJSON()

bool ProcessGDBRemote::GetThreadStopInfoFromJSON ( ThreadGDBRemote thread,
const StructuredData::ObjectSP thread_infos_sp 
)
protected

◆ GetTraceConfig()

Status ProcessGDBRemote::GetTraceConfig ( lldb::user_id_t  uid,
TraceOptions options 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 1308 of file ProcessGDBRemote.cpp.

References m_gdb_comm, and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendGetTraceConfigPacket().

◆ GetWatchpointSupportInfo() [1/2]

Status ProcessGDBRemote::GetWatchpointSupportInfo ( uint32_t num)
overridevirtual

◆ GetWatchpointSupportInfo() [2/2]

Status ProcessGDBRemote::GetWatchpointSupportInfo ( uint32_t num,
bool &  after 
)
overridevirtual

◆ HandleNotifyPacket()

bool ProcessGDBRemote::HandleNotifyPacket ( StringExtractorGDBRemote packet)
protected

◆ HandleStopReplySequence()

void ProcessGDBRemote::HandleStopReplySequence ( )
protected

◆ HarmonizeThreadIdsForProfileData()

std::string ProcessGDBRemote::HarmonizeThreadIdsForProfileData ( StringExtractorGDBRemote inputStringExtractor)

◆ HasErased()

bool ProcessGDBRemote::HasErased ( FlashRange  range)
protected

◆ HasExited()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::HasExited ( lldb::StateType  state)
inlineprotected

Definition at line 304 of file ProcessGDBRemote.h.

References lldb::eStateExited.

◆ Initialize()

void ProcessGDBRemote::Initialize ( )
static

◆ IsAlive()

bool ProcessGDBRemote::IsAlive ( )
overridevirtual

Check if a process is still alive.

Returns
Returns true if the process is still valid, false otherwise.

Reimplemented from lldb_private::Process.

Definition at line 2721 of file ProcessGDBRemote.cpp.

References lldb_private::Process::IsAlive(), lldb_private::Communication::IsConnected(), and m_gdb_comm.

◆ IsRunning()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::IsRunning ( lldb::StateType  state)
inlineprotected

Definition at line 294 of file ProcessGDBRemote.h.

References lldb::eStateRunning.

◆ IsStepping()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::IsStepping ( lldb::StateType  state)
inlineprotected

Definition at line 298 of file ProcessGDBRemote.h.

References lldb::eStateStepping.

◆ KillDebugserverProcess()

void ProcessGDBRemote::KillDebugserverProcess ( )
protected

◆ LaunchAndConnectToDebugserver()

Status ProcessGDBRemote::LaunchAndConnectToDebugserver ( const ProcessInfo process_info)
protected

◆ LoadModuleAtAddress()

lldb::ModuleSP ProcessGDBRemote::LoadModuleAtAddress ( const FileSpec file,
lldb::addr_t  link_map,
lldb::addr_t  base_addr,
bool  value_is_offset 
)
protected

◆ LoadModules() [1/2]

size_t ProcessGDBRemote::LoadModules ( LoadedModuleInfoList module_list)
overridevirtual

◆ LoadModules() [2/2]

size_t ProcessGDBRemote::LoadModules ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 4908 of file ProcessGDBRemote.cpp.

Referenced by SetThreadStopInfo().

◆ ModulesDidLoad()

void ProcessGDBRemote::ModulesDidLoad ( ModuleList module_list)
overridevirtual

◆ MonitorDebugserverProcess()

bool ProcessGDBRemote::MonitorDebugserverProcess ( std::weak_ptr< ProcessGDBRemote process_wp,
lldb::pid_t  pid,
bool  exited,
int  signo,
int  exit_status 
)
staticprotected

◆ ParsePythonTargetDefinition()

bool ProcessGDBRemote::ParsePythonTargetDefinition ( const FileSpec target_definition_fspec)
protected

◆ PrefetchModuleSpecs()

void ProcessGDBRemote::PrefetchModuleSpecs ( llvm::ArrayRef< FileSpec module_file_specs,
const llvm::Triple &  triple 
)
overridevirtual

◆ ProcessIDIsValid()

bool lldb_private::process_gdb_remote::ProcessGDBRemote::ProcessIDIsValid ( ) const
protected

◆ PutSTDIN()

size_t ProcessGDBRemote::PutSTDIN ( const char *  buf,
size_t  buf_size,
Status error 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 3125 of file ProcessGDBRemote.cpp.

References lldb_private::Communication::IsConnected(), m_gdb_comm, lldb_private::Process::m_stdin_forward, lldb_private::Process::m_stdio_communication, lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStdinNotification(), and lldb_private::Communication::Write().

◆ RefreshStateAfterStop()

void ProcessGDBRemote::RefreshStateAfterStop ( )
overridevirtual

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.

Implements lldb_private::Process.

Definition at line 2418 of file ProcessGDBRemote.cpp.

References lldb_private::ThreadList::GetMutex(), LLDB_INVALID_THREAD_ID, m_initial_tid, m_last_stop_packet_mutex, m_stop_packet_stack, m_thread_ids, lldb_private::Process::m_thread_list, lldb_private::Process::m_thread_list_real, m_thread_pcs, lldb_private::ThreadList::RefreshStateAfterStop(), lldb_private::ThreadList::SetSelectedThreadByID(), SetThreadStopInfo(), and UpdateThreadIDList().

◆ SendEventData()

Status ProcessGDBRemote::SendEventData ( const char *  data)
overridevirtual

◆ SetLastStopPacket()

void ProcessGDBRemote::SetLastStopPacket ( const StringExtractorGDBRemote response)
protected

◆ SetThreadStopInfo() [1/3]

StateType ProcessGDBRemote::SetThreadStopInfo ( StringExtractor stop_packet)
protected

◆ SetThreadStopInfo() [2/3]

lldb::ThreadSP ProcessGDBRemote::SetThreadStopInfo ( StructuredData::Dictionary thread_dict)
protected

◆ SetThreadStopInfo() [3/3]

ThreadSP ProcessGDBRemote::SetThreadStopInfo ( lldb::tid_t  tid,
ExpeditedRegisterMap expedited_register_map,
uint8_t  signo,
const std::string &  thread_name,
const std::string &  reason,
const std::string &  description,
uint32_t  exc_type,
const std::vector< lldb::addr_t > &  exc_data,
lldb::addr_t  thread_dispatch_qaddr,
bool  queue_vars_valid,
lldb_private::LazyBool  associated_with_libdispatch_queue,
lldb::addr_t  dispatch_queue_t,
std::string &  queue_name,
lldb::QueueKind  queue_kind,
uint64_t  queue_serial 
)
protected

Definition at line 1804 of file ProcessGDBRemote.cpp.

References lldb_private::ThreadCollection::AddThread(), lldb_private::process_gdb_remote::ThreadGDBRemote::ClearQueueInfo(), lldb_private::StopInfo::CreateStopReasonToTrace(), lldb_private::StopInfo::CreateStopReasonWithBreakpointSiteID(), lldb_private::StopInfo::CreateStopReasonWithException(), lldb_private::StopInfo::CreateStopReasonWithExec(), lldb_private::StopInfoMachException::CreateStopReasonWithMachException(), lldb_private::StopInfo::CreateStopReasonWithSignal(), lldb_private::StopInfo::CreateStopReasonWithWatchpointID(), lldb_private::ArchSpec::eCore_arm_aarch64, lldb_private::ArchSpec::eCore_arm_generic, lldb::eStateStepping, lldb_private::WatchpointList::FindByAddress(), lldb_private::ThreadList::FindThreadByProtocolID(), GDBR_LOG_WATCHPOINTS, lldb_private::Target::GetArchitecture(), lldb_private::ThreadList::GetBackingThread(), lldb_private::ArchSpec::GetCore(), StringExtractor::GetHexBytes(), lldb_private::process_gdb_remote::ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(), lldb_private::ThreadList::GetMutex(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetRegisterContext(), StringExtractor::GetStringRef(), lldb_private::Process::GetTarget(), StringExtractor::GetU64(), lldb_private::Target::GetWatchpointList(), lldb_private::ArchSpec::kCore_mips_first, lldb_private::ArchSpec::kCore_mips_last, LLDB_INVALID_ADDRESS, LLDB_INVALID_INDEX32, LLDB_INVALID_THREAD_ID, LLDB_INVALID_WATCH_ID, m_breakpoint_pc_offset, m_thread_ids, lldb_private::Process::m_thread_list, lldb_private::Process::m_thread_list_real, pc, lldb_private::Log::Printf(), lldb_private::process_gdb_remote::ThreadGDBRemote::PrivateSetRegisterValue(), lldb_private::process_gdb_remote::ThreadGDBRemote::SetAssociatedWithLibdispatchQueue(), lldb_private::process_gdb_remote::ThreadGDBRemote::SetQueueInfo(), lldb_private::process_gdb_remote::ThreadGDBRemote::SetQueueLibdispatchQueueAddress(), lldb_private::process_gdb_remote::ThreadGDBRemote::SetThreadDispatchQAddr(), and SIGTRAP.

◆ SetUnixSignals()

void ProcessGDBRemote::SetUnixSignals ( const lldb::UnixSignalsSP &  signals_sp)

Definition at line 2715 of file ProcessGDBRemote.cpp.

References lldb_private::Process::SetUnixSignals().

Referenced by DoConnectRemote().

◆ SetUserSpecifiedMaxMemoryTransferSize()

void ProcessGDBRemote::SetUserSpecifiedMaxMemoryTransferSize ( uint64_t  user_specified_max)

◆ StartAsyncThread()

bool ProcessGDBRemote::StartAsyncThread ( )
protected

◆ StartNoticingNewThreads()

bool ProcessGDBRemote::StartNoticingNewThreads ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 3988 of file ProcessGDBRemote.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Process::GetTarget(), lldb_private::Log::GetVerbose(), LIBLLDB_LOG_STEP, m_thread_create_bp_sp, and lldb_private::Log::Printf().

◆ StartTrace()

lldb::user_id_t ProcessGDBRemote::StartTrace ( const TraceOptions options,
Status error 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 1287 of file ProcessGDBRemote.cpp.

References m_gdb_comm, and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStartTracePacket().

◆ StopAsyncThread()

void ProcessGDBRemote::StopAsyncThread ( )
protected

◆ StopNoticingNewThreads()

bool ProcessGDBRemote::StopNoticingNewThreads ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 4015 of file ProcessGDBRemote.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Log::GetVerbose(), LIBLLDB_LOG_STEP, m_thread_create_bp_sp, and lldb_private::Log::Printf().

◆ StopTrace()

Status ProcessGDBRemote::StopTrace ( lldb::user_id_t  uid,
lldb::tid_t  thread_id 
)
overridevirtual

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 from lldb_private::Process.

Definition at line 1292 of file ProcessGDBRemote.cpp.

References m_gdb_comm, and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendStopTracePacket().

◆ Terminate()

void ProcessGDBRemote::Terminate ( )
static

◆ UpdateAutomaticSignalFiltering()

Status ProcessGDBRemote::UpdateAutomaticSignalFiltering ( )
overrideprotectedvirtual

◆ UpdateThreadIDList()

bool ProcessGDBRemote::UpdateThreadIDList ( )
protected

◆ UpdateThreadIDsFromStopReplyThreadsValue()

size_t ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue ( std::string &  value)
protected

◆ UpdateThreadList()

bool ProcessGDBRemote::UpdateThreadList ( ThreadList old_thread_list,
ThreadList new_thread_list 
)
overrideprotectedvirtual

◆ UpdateThreadPCsFromStopReplyThreadsValue()

size_t ProcessGDBRemote::UpdateThreadPCsFromStopReplyThreadsValue ( std::string &  value)
protected

◆ WillAttachToProcessWithID()

Status ProcessGDBRemote::WillAttachToProcessWithID ( lldb::pid_t  pid)
overridevirtual

Called before attaching to a process.

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

Returns
Returns an error object.

Reimplemented from lldb_private::Process.

Definition at line 697 of file ProcessGDBRemote.cpp.

References WillLaunchOrAttach().

◆ WillAttachToProcessWithName()

Status ProcessGDBRemote::WillAttachToProcessWithName ( const char *  process_name,
bool  wait_for_launch 
)
overridevirtual

Called before attaching to a process.

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

Returns
Returns an error object.

Reimplemented from lldb_private::Process.

Definition at line 701 of file ProcessGDBRemote.cpp.

References WillLaunchOrAttach().

◆ WillLaunch()

Status ProcessGDBRemote::WillLaunch ( lldb_private::Module module)
overridevirtual

Called before launching to a process.

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

Returns
Returns an error object.

Reimplemented from lldb_private::Process.

Definition at line 693 of file ProcessGDBRemote.cpp.

References WillLaunchOrAttach().

◆ WillLaunchOrAttach()

Status ProcessGDBRemote::WillLaunchOrAttach ( )

◆ WillPublicStop()

void ProcessGDBRemote::WillPublicStop ( )
overridevirtual

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 from lldb_private::Process.

Definition at line 2739 of file ProcessGDBRemote.cpp.

References lldb_private::StructuredData::Array::GetItemAtIndex(), lldb_private::StructuredData::Array::GetSize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetThreadsInfo(), m_gdb_comm, m_jthreadsinfo_sp, and SetThreadStopInfo().

◆ WillResume()

Status ProcessGDBRemote::WillResume ( )
overridevirtual

Called before resuming to a process.

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

Returns
Returns an error object.

Reimplemented from lldb_private::Process.

Definition at line 1324 of file ProcessGDBRemote.cpp.

References m_continue_c_tids, m_continue_C_tids, m_continue_s_tids, m_continue_S_tids, m_jstopinfo_sp, and m_jthreadsinfo_sp.

◆ WriteObjectFile()

Status ProcessGDBRemote::WriteObjectFile ( std::vector< ObjectFile::LoadableData entries)
overridevirtual

Friends And Related Function Documentation

◆ GDBRemoteCommunicationClient

friend class GDBRemoteCommunicationClient
friend

Definition at line 235 of file ProcessGDBRemote.h.

◆ GDBRemoteRegisterContext

friend class GDBRemoteRegisterContext
friend

Definition at line 236 of file ProcessGDBRemote.h.

◆ ThreadGDBRemote

friend class ThreadGDBRemote
friend

Definition at line 234 of file ProcessGDBRemote.h.

Member Data Documentation

◆ m_addr_to_mmap_size

MMapMap lldb_private::process_gdb_remote::ProcessGDBRemote::m_addr_to_mmap_size
protected

Definition at line 279 of file ProcessGDBRemote.h.

Referenced by DoAllocateMemory(), and DoDeallocateMemory().

◆ m_allow_flash_writes

bool lldb_private::process_gdb_remote::ProcessGDBRemote::m_allow_flash_writes
protected

Definition at line 288 of file ProcessGDBRemote.h.

Referenced by DoWriteMemory(), and WriteObjectFile().

◆ m_async_broadcaster

Broadcaster lldb_private::process_gdb_remote::ProcessGDBRemote::m_async_broadcaster
protected

◆ m_async_listener_sp

lldb::ListenerSP lldb_private::process_gdb_remote::ProcessGDBRemote::m_async_listener_sp
protected

Definition at line 255 of file ProcessGDBRemote.h.

Referenced by AsyncThread(), and ProcessGDBRemote().

◆ m_async_thread

HostThread lldb_private::process_gdb_remote::ProcessGDBRemote::m_async_thread
protected

Definition at line 256 of file ProcessGDBRemote.h.

Referenced by DoResume(), StartAsyncThread(), and StopAsyncThread().

◆ m_async_thread_state_mutex

std::recursive_mutex lldb_private::process_gdb_remote::ProcessGDBRemote::m_async_thread_state_mutex
protected

Definition at line 257 of file ProcessGDBRemote.h.

Referenced by StartAsyncThread(), and StopAsyncThread().

◆ m_breakpoint_pc_offset

int64_t lldb_private::process_gdb_remote::ProcessGDBRemote::m_breakpoint_pc_offset
protected

Definition at line 284 of file ProcessGDBRemote.h.

Referenced by ParsePythonTargetDefinition(), and SetThreadStopInfo().

◆ m_command_sp

lldb::CommandObjectSP lldb_private::process_gdb_remote::ProcessGDBRemote::m_command_sp
protected

Definition at line 283 of file ProcessGDBRemote.h.

Referenced by GetPluginCommandObject().

◆ m_continue_c_tids

tid_collection lldb_private::process_gdb_remote::ProcessGDBRemote::m_continue_c_tids
protected

◆ m_continue_C_tids

tid_sig_collection lldb_private::process_gdb_remote::ProcessGDBRemote::m_continue_C_tids
protected

◆ m_continue_s_tids

tid_collection lldb_private::process_gdb_remote::ProcessGDBRemote::m_continue_s_tids
protected

◆ m_continue_S_tids

tid_sig_collection lldb_private::process_gdb_remote::ProcessGDBRemote::m_continue_S_tids
protected

◆ m_debugserver_pid

std::atomic<lldb::pid_t> lldb_private::process_gdb_remote::ProcessGDBRemote::m_debugserver_pid
protected

Definition at line 247 of file ProcessGDBRemote.h.

Referenced by KillDebugserverProcess(), and LaunchAndConnectToDebugserver().

◆ m_destroy_tried_resuming

bool lldb_private::process_gdb_remote::ProcessGDBRemote::m_destroy_tried_resuming
protected

Definition at line 282 of file ProcessGDBRemote.h.

Referenced by DoDestroy().

◆ m_erased_flash_ranges

FlashRangeVector lldb_private::process_gdb_remote::ProcessGDBRemote::m_erased_flash_ranges
protected

Definition at line 291 of file ProcessGDBRemote.h.

Referenced by FlashDone(), FlashErase(), and HasErased().

◆ m_gdb_comm

GDBRemoteCommunicationClient lldb_private::process_gdb_remote::ProcessGDBRemote::m_gdb_comm
protected

◆ m_gdb_replay_server

GDBRemoteCommunicationReplayServer lldb_private::process_gdb_remote::ProcessGDBRemote::m_gdb_replay_server
protected

Definition at line 246 of file ProcessGDBRemote.h.

Referenced by ConnectToReplayServer().

◆ m_initial_tid

lldb::tid_t lldb_private::process_gdb_remote::ProcessGDBRemote::m_initial_tid
protected

Definition at line 285 of file ProcessGDBRemote.h.

Referenced by ConnectToDebugserver(), and RefreshStateAfterStop().

◆ m_jstopinfo_sp

StructuredData::ObjectSP lldb_private::process_gdb_remote::ProcessGDBRemote::m_jstopinfo_sp
protected

Definition at line 265 of file ProcessGDBRemote.h.

Referenced by CalculateThreadStopInfo(), SetThreadStopInfo(), and WillResume().

◆ m_jthreadsinfo_sp

StructuredData::ObjectSP lldb_private::process_gdb_remote::ProcessGDBRemote::m_jthreadsinfo_sp
protected

◆ m_last_stop_packet_mutex

std::recursive_mutex lldb_private::process_gdb_remote::ProcessGDBRemote::m_last_stop_packet_mutex
protected

◆ m_max_memory_size

uint64_t lldb_private::process_gdb_remote::ProcessGDBRemote::m_max_memory_size
protected

◆ m_register_info

GDBRemoteDynamicRegisterInfo lldb_private::process_gdb_remote::ProcessGDBRemote::m_register_info
protected

◆ m_remote_stub_max_memory_size

uint64_t lldb_private::process_gdb_remote::ProcessGDBRemote::m_remote_stub_max_memory_size
protected

Definition at line 277 of file ProcessGDBRemote.h.

Referenced by GetMaxMemorySize(), and SetUserSpecifiedMaxMemoryTransferSize().

◆ m_replay_mode

bool lldb_private::process_gdb_remote::ProcessGDBRemote::m_replay_mode
protected

Definition at line 287 of file ProcessGDBRemote.h.

Referenced by ConnectToReplayServer().

◆ m_stop_packet_stack

std::vector<StringExtractorGDBRemote> lldb_private::process_gdb_remote::ProcessGDBRemote::m_stop_packet_stack
protected

◆ m_thread_create_bp_sp

lldb::BreakpointSP lldb_private::process_gdb_remote::ProcessGDBRemote::m_thread_create_bp_sp
protected

Definition at line 280 of file ProcessGDBRemote.h.

Referenced by StartNoticingNewThreads(), and StopNoticingNewThreads().

◆ m_thread_ids

tid_collection lldb_private::process_gdb_remote::ProcessGDBRemote::m_thread_ids
protected

◆ m_thread_pcs

std::vector<lldb::addr_t> lldb_private::process_gdb_remote::ProcessGDBRemote::m_thread_pcs
protected

◆ m_waiting_for_attach

bool lldb_private::process_gdb_remote::ProcessGDBRemote::m_waiting_for_attach
protected

Definition at line 281 of file ProcessGDBRemote.h.


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