LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
ProcessFreeBSD Class Reference

#include <ProcessFreeBSD.h>

Inheritance diagram for ProcessFreeBSD:
Inheritance graph
[legend]
Collaboration diagram for ProcessFreeBSD:
Collaboration graph
[legend]

Public Types

typedef std::vector< lldb::tid_ttid_collection
 
- 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, eWarningsUnsupportedLanguage = 2 }
 Process warning types. More...
 
typedef Range< lldb::addr_t, lldb::addr_tLoadRange
 
typedef ProcessRunLock::ProcessRunLocker StopLocker
 
typedef bool() PreResumeActionCallback(void *)
 

Public Member Functions

 ProcessFreeBSD (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, lldb::UnixSignalsSP &unix_signals_sp)
 
 ~ProcessFreeBSD ()
 
virtual lldb_private::Status WillResume () override
 Called before resuming to a process. More...
 
virtual lldb_private::ConstString GetPluginName () override
 
virtual uint32_t GetPluginVersion () override
 
void Finalize () override
 This object is about to be destroyed, do any necessary cleanup. More...
 
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...
 
lldb_private::Status WillLaunch (lldb_private::Module *module) override
 Called before launching to a process. More...
 
lldb_private::Status DoAttachToProcessWithID (lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override
 Attach to an existing process using a process ID. More...
 
lldb_private::Status DoLaunch (lldb_private::Module *exe_module, lldb_private::ProcessLaunchInfo &launch_info) override
 Launch a new process. More...
 
void DidLaunch () override
 Called after launching a process. More...
 
lldb_private::Status DoResume () override
 Resumes all of a process's threads as configured using the Thread run control functions. More...
 
lldb_private::Status DoHalt (bool &caused_stop) override
 Halts a running process. More...
 
lldb_private::Status DoDetach (bool keep_stopped) override
 Detaches from a running or stopped process. More...
 
lldb_private::Status DoSignal (int signal) override
 Sends a process a UNIX signal signal. More...
 
lldb_private::Status DoDestroy () override
 
void DoDidExec () override
 Subclasses of Process should implement this function if they need to do anything after a process exec's itself. More...
 
void RefreshStateAfterStop () override
 Currently called as part of ShouldStop. More...
 
bool IsAlive () override
 Check if a process is still alive. More...
 
size_t DoReadMemory (lldb::addr_t vm_addr, void *buf, size_t size, lldb_private::Status &error) override
 Actually do the reading of memory from a process. More...
 
size_t DoWriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, lldb_private::Status &error) override
 Actually do the writing of memory to a process. More...
 
lldb::addr_t DoAllocateMemory (size_t size, uint32_t permissions, lldb_private::Status &error) override
 Actually allocate memory in the process. More...
 
lldb_private::Status DoDeallocateMemory (lldb::addr_t ptr) override
 Actually deallocate memory in the process. More...
 
virtual size_t GetSoftwareBreakpointTrapOpcode (lldb_private::BreakpointSite *bp_site)
 
lldb_private::Status EnableBreakpointSite (lldb_private::BreakpointSite *bp_site) override
 
lldb_private::Status DisableBreakpointSite (lldb_private::BreakpointSite *bp_site) override
 
lldb_private::Status EnableWatchpoint (lldb_private::Watchpoint *wp, bool notify=true) override
 
lldb_private::Status DisableWatchpoint (lldb_private::Watchpoint *wp, bool notify=true) override
 
lldb_private::Status GetWatchpointSupportInfo (uint32_t &num) override
 
lldb_private::Status GetWatchpointSupportInfo (uint32_t &num, bool &after) override
 
virtual uint32_t UpdateThreadListIfNeeded ()
 
bool UpdateThreadList (lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override
 
virtual lldb::ByteOrder GetByteOrder () const
 
lldb::addr_t GetImageInfoAddress () override
 Get the image information address for the current process. More...
 
size_t PutSTDIN (const char *buf, size_t len, lldb_private::Status &error) override
 Puts data into this process's STDIN. More...
 
lldb_private::DataExtractor GetAuxvData () override
 
virtual void SendMessage (const ProcessMessage &message)
 Registers the given message with this process. More...
 
ProcessMonitorGetMonitor ()
 
lldb_private::FileSpec GetFileSpec (const lldb_private::FileAction *file_action, const lldb_private::FileSpec &default_file_spec, const lldb_private::FileSpec &dbg_pts_file_spec)
 
bool AddThreadForInitialStopIfNeeded (lldb::tid_t stop_tid)
 Adds the thread to the list of threads for which we have received the initial stopping signal. More...
 
bool WaitingForInitialStop (lldb::tid_t stop_tid)
 
virtual FreeBSDThreadCreateNewFreeBSDThread (lldb_private::Process &process, lldb::tid_t tid)
 
lldb_private::Status SetupSoftwareSingleStepping (lldb::tid_t tid)
 
lldb_private::Status SetSoftwareSingleStepBreakpoint (lldb::tid_t tid, lldb::addr_t addr)
 
bool IsSoftwareStepBreakpoint (lldb::tid_t tid)
 
bool SupportHardwareSingleStepping () const
 
tid_collectionGetStepTids ()
 
- Public Member Functions inherited from lldb_private::Process
ConstStringGetBroadcasterClass () const override
 This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. More...
 
 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
 
lldb::pid_t GetID () const
 Sets the stored pid. More...
 
void SetID (lldb::pid_t new_pid)
 Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid. More...
 
uint32_t GetUniqueID () const
 
bool IsValid () const
 Return whether this object is valid (i.e. More...
 
virtual CommandObjectGetPluginCommandObject ()
 Return a multi-word command object that can be used to expose plug-in specific commands. More...
 
virtual Status Launch (ProcessLaunchInfo &launch_info)
 Launch a new process. More...
 
virtual Status LoadCore ()
 
virtual Status DoLoadCore ()
 
UtilityFunctionGetLoadImageUtilityFunction (Platform *platform, llvm::function_ref< std::unique_ptr< UtilityFunction >()> factory)
 Get the cached UtilityFunction that assists in loading binary images into the process. More...
 
virtual DynamicLoaderGetDynamicLoader ()
 Get the dynamic loader plug-in for this process. More...
 
virtual llvm::Error LoadModules ()
 Sometimes processes know how to retrieve and load shared libraries. More...
 
virtual llvm::Expected< LoadedModuleInfoListGetLoadedModuleList ()
 Query remote GDBServer for a detailed loaded library list. 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 (llvm::StringRef remote_url)
 Attach to a remote system via a URL. More...
 
bool GetShouldDetach () const
 
void SetShouldDetach (bool b)
 
const std::vector< lldb::addr_t > & GetImageTokens ()
 Get the image vector for the current process. More...
 
virtual void WillPublicStop ()
 Called when the process is about to broadcast a public stop. More...
 
void RegisterNotificationCallbacks (const Process::Notifications &callbacks)
 Register for process and thread notifications. More...
 
bool UnregisterNotificationCallbacks (const Process::Notifications &callbacks)
 Unregister for process and thread notifications. More...
 
Status Resume ()
 Resumes all of a process's threads as configured using the Thread run control functions. More...
 
Status ResumeSynchronous (Stream *stream)
 
Status Halt (bool clear_thread_plans=false, bool use_run_lock=true)
 Halts a running process. More...
 
Status Detach (bool keep_stopped)
 Detaches from a running or stopped process. More...
 
Status Destroy (bool force_kill)
 Kills the process and shuts down all threads that were spawned to track and monitor the process. More...
 
Status Signal (int signal)
 Sends a process a UNIX signal signal. More...
 
void SetUnixSignals (lldb::UnixSignalsSP &&signals_sp)
 
const lldb::UnixSignalsSP & GetUnixSignals ()
 
virtual Status WillAttachToProcessWithID (lldb::pid_t pid)
 Called before attaching to a process. More...
 
virtual Status WillAttachToProcessWithName (const char *process_name, bool wait_for_launch)
 Called before attaching to a process. More...
 
virtual Status DoConnectRemote (llvm::StringRef remote_url)
 Attach to a remote system via a URL. More...
 
virtual Status DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info)
 Attach to an existing process using a partial process name. More...
 
virtual void DidAttach (ArchSpec &process_arch)
 Called after attaching a process. More...
 
virtual void DidExec ()
 Called after a process re-execs itself. More...
 
virtual void 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 bool DetachRequiresHalt ()
 
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...
 
virtual llvm::VersionTuple GetHostOSVersion ()
 Sometimes the connection to a process can detect the host OS version that the process is running on. More...
 
virtual llvm::VersionTuple GetHostMacCatalystVersion ()
 
TargetGetTarget ()
 Get the target object pointer for this module. More...
 
const TargetGetTarget () const
 Get the const target object pointer for this module. More...
 
void Flush ()
 Flush all data in the process. More...
 
lldb::StateType GetState ()
 Get accessor for the current process state. More...
 
lldb::ExpressionResults RunThreadPlan (ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
 
void GetStatus (Stream &ostrm)
 
size_t GetThreadStatus (Stream &ostrm, bool only_threads_with_stop_reason, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format)
 
void SendAsyncInterrupt ()
 
virtual void ModulesDidLoad (ModuleList &module_list)
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_address, lldb::addr_t image_count)
 Retrieve the list of shared libraries that are loaded for this process This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre- watchOS 3 systems. More...
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos ()
 
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (const std::vector< lldb::addr_t > &load_addresses)
 
virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo ()
 
void PrintWarningOptimization (const SymbolContext &sc)
 Print a user-visible warning about a module being built with optimization. More...
 
void PrintWarningUnsupportedLanguage (const SymbolContext &sc)
 Print a user-visible warning about a function written in a language that this version of LLDB doesn't support. More...
 
virtual bool GetProcessInfo (ProcessInstanceInfo &info)
 
int GetExitStatus ()
 Get the exit status for a process. More...
 
const char * GetExitDescription ()
 Get a textual description of what the process exited. More...
 
virtual void DidExit ()
 
ProcessModID GetModID () const
 Get the Modification ID of the process. More...
 
const ProcessModIDGetModIDRef () const
 
uint32_t GetStopID () const
 
uint32_t GetResumeID () const
 
uint32_t GetLastUserExpressionResumeID () const
 
uint32_t GetLastNaturalStopID () const
 
lldb::EventSP GetStopEventForStopID (uint32_t stop_id) const
 
virtual bool SetExitStatus (int exit_status, const char *cstr)
 Set accessor for the process exit status (return code). More...
 
virtual bool IsLiveDebugSession () const
 
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...
 
virtual Status WriteObjectFile (std::vector< ObjectFile::LoadableData > entries)
 
lldb::addr_t AllocateMemory (size_t size, uint32_t permissions, Status &error)
 The public interface to allocating memory in the process. More...
 
lldb::addr_t CallocateMemory (size_t size, uint32_t permissions, Status &error)
 The public interface to allocating memory in the process, this also clears the allocated memory. More...
 
virtual lldb::addr_t ResolveIndirectFunction (const Address *address, Status &error)
 Resolve dynamically loaded indirect functions. More...
 
virtual Status GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info)
 Locate the memory region that contains load_addr. More...
 
virtual Status GetMemoryRegions (lldb_private::MemoryRegionInfos &region_list)
 Obtain all the mapped memory regions within this process. More...
 
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 ()
 
std::vector< LanguageRuntime * > GetLanguageRuntimes ()
 
LanguageRuntimeGetLanguageRuntime (lldb::LanguageType language)
 
bool IsPossibleDynamicValue (ValueObject &in_value)
 
bool IsRunning () const
 
DynamicCheckerFunctionsGetDynamicCheckers ()
 
void SetDynamicCheckers (DynamicCheckerFunctions *dynamic_checkers)
 
bool PruneThreadPlansForTID (lldb::tid_t tid)
 Prune ThreadPlanStacks for unreported threads. More...
 
void PruneThreadPlans ()
 Prune ThreadPlanStacks for all unreported threads. More...
 
ThreadPlanStackFindThreadPlans (lldb::tid_t tid)
 Find the thread plan stack associated with thread with tid. More...
 
bool DumpThreadPlansForTID (Stream &strm, lldb::tid_t tid, lldb::DescriptionLevel desc_level, bool internal, bool condense_trivial, bool skip_unreported_plans)
 Dump the thread plans associated with thread with tid. More...
 
void DumpThreadPlans (Stream &strm, lldb::DescriptionLevel desc_level, bool internal, bool condense_trivial, bool skip_unreported_plans)
 Dump all the thread plans for this process. More...
 
virtual bool StartNoticingNewThreads ()
 Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts. More...
 
virtual bool StopNoticingNewThreads ()
 Call this to turn off the stop & notice new threads mode. More...
 
void SetRunningUserExpression (bool on)
 
void SetRunningUtilityFunction (bool on)
 
lldb::TargetSP CalculateTarget () override
 
lldb::ProcessSP CalculateProcess () override
 
lldb::ThreadSP CalculateThread () override
 
lldb::StackFrameSP CalculateStackFrame () override
 
void CalculateExecutionContext (ExecutionContext &exe_ctx) override
 Reconstruct the object's execution context into sc. More...
 
void SetSTDIOFileDescriptor (int file_descriptor)
 
void AddInvalidMemoryRegion (const LoadRange &region)
 
bool RemoveInvalidMemoryRange (const LoadRange &region)
 
void AddPreResumeAction (PreResumeActionCallback callback, void *baton)
 
bool RunPreResumeActions ()
 
void ClearPreResumeActions ()
 
void ClearPreResumeAction (PreResumeActionCallback callback, void *baton)
 
ProcessRunLockGetRunLock ()
 
bool CurrentThreadIsPrivateStateThread ()
 
virtual Status SendEventData (const char *data)
 
lldb::ThreadCollectionSP GetHistoryThreads (lldb::addr_t addr)
 
lldb::InstrumentationRuntimeSP GetInstrumentationRuntime (lldb::InstrumentationRuntimeType type)
 
virtual bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec)
 Try to fetch the module specification for a module with the given file name and architecture. More...
 
virtual void PrefetchModuleSpecs (llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple)
 
virtual Status GetFileLoadAddress (const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr)
 Try to find the load address of a file. More...
 
size_t AddImageToken (lldb::addr_t image_ptr)
 
lldb::addr_t GetImagePtrFromToken (size_t token) const
 
void ResetImageToken (size_t token)
 
Address AdvanceAddressToNextBranchInstruction (Address default_stop_addr, AddressRange range_bounds)
 Find the next branch instruction to set a breakpoint on. More...
 
virtual Status ConfigureStructuredData (ConstString type_name, const StructuredData::ObjectSP &config_sp)
 Configure asynchronous structured data feature. More...
 
void BroadcastStructuredData (const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp)
 Broadcasts the given structured data object from the given plugin. More...
 
lldb::StructuredDataPluginSP GetStructuredDataPlugin (ConstString type_name) const
 Returns the StructuredDataPlugin associated with a given type name, if there is one. More...
 
virtual lldb::user_id_t StartTrace (const TraceOptions &options, Status &error)
 Starts tracing with the configuration provided in options. More...
 
virtual Status StopTrace (lldb::user_id_t uid, lldb::tid_t thread_id)
 Stops the tracing instance leading to deletion of the trace data. More...
 
virtual Status GetData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 Provides the trace data as raw bytes. More...
 
virtual Status GetMetaData (lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 Similar API as above except for obtaining meta data. More...
 
virtual Status GetTraceConfig (lldb::user_id_t uid, TraceOptions &options)
 API to obtain the trace configuration used by a trace instance. More...
 
virtual llvm::Expected< TraceTypeInfoGetSupportedTraceType ()
 Get the processor tracing type supported for this process. More...
 
bool CallVoidArgVoidPtrReturn (const Address *address, lldb::addr_t &returned_func, bool trap_exceptions=false)
 
- 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 GetWarningsUnsupportedLanguage () const
 
bool GetStopOnExec () const
 
std::chrono::seconds GetUtilityExpressionTimeout () const
 
bool GetOSPluginReportsAllThreads () const
 
void SetOSPluginReportsAllThreads (bool does_report)
 
bool GetSteppingRunsAllThreads () 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::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
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static lldb::ProcessSP CreateInstance (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path)
 
static void Initialize ()
 
static void Terminate ()
 
static lldb_private::ConstString GetPluginNameStatic ()
 
static const char * GetPluginDescriptionStatic ()
 
static bool SingleStepBreakpointHit (void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
 
- 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

typedef std::map< lldb::addr_t, lldb::addr_tMMapMap
 
typedef std::set< lldb::tid_tThreadStopSet
 
- 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 HasExited ()
 Returns true if the process has exited. More...
 
bool IsStopped ()
 Returns true if the process is stopped. More...
 
bool IsAThreadRunning ()
 Returns true if at least one running is currently running. More...
 
- 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)
 
virtual Status UpdateAutomaticSignalFiltering ()
 
void LoadOperatingSystemPlugin (bool flush)
 
- Protected Member Functions inherited from lldb_private::Broadcaster
BroadcasterImplSP GetBroadcasterImpl ()
 
const char * GetHijackingListenerName ()
 

Protected Attributes

lldb::ByteOrder m_byte_order
 Target byte order. More...
 
ProcessMonitorm_monitor
 Process monitor;. More...
 
lldb_private::Modulem_module
 The module we are executing. More...
 
std::recursive_mutex m_message_mutex
 Message queue notifying this instance of inferior process state changes. More...
 
std::queue< ProcessMessagem_message_queue
 
bool m_exit_now
 Drive any exit events to completion. More...
 
MMapMap m_addr_to_mmap_size
 
ThreadStopSet m_seen_initial_stop
 Every thread begins with a stop signal. More...
 
tid_collection m_suspend_tids
 
tid_collection m_run_tids
 
tid_collection m_step_tids
 
std::map< lldb::tid_t, lldb::break_id_tm_threads_stepping_with_breakpoint
 
int m_resume_signo
 
- Protected Attributes inherited from lldb_private::Process
std::weak_ptr< Targetm_target_wp
 The target that owns this process. More...
 
lldb::pid_t m_pid = LLDB_INVALID_PROCESS_ID
 
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...
 
ThreadPlanStackMap m_thread_plans
 This is the list of thread plans for threads in m_thread_list, as well as threads we knew existed, but haven't determined that they have died yet. 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...
 
std::recursive_mutex m_language_runtimes_mutex
 
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
 
llvm::once_flag m_dlopen_utility_func_flag_once
 
- Protected Attributes inherited from lldb_private::ProcessProperties
Processm_process
 
std::unique_ptr< ProcessExperimentalPropertiesm_experimental_properties_up
 
- Protected Attributes inherited from lldb_private::Properties
lldb::OptionValuePropertiesSP m_collection_sp
 

Static Protected Attributes

static const size_t MAX_TRAP_OPCODE_SIZE = 8
 

Friends

class FreeBSDThread
 

Additional Inherited Members

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

Detailed Description

Definition at line 23 of file ProcessFreeBSD.h.

Member Typedef Documentation

◆ MMapMap

typedef std::map<lldb::addr_t, lldb::addr_t> ProcessFreeBSD::MMapMap
protected

Definition at line 202 of file ProcessFreeBSD.h.

◆ ThreadStopSet

typedef std::set<lldb::tid_t> ProcessFreeBSD::ThreadStopSet
protected

Definition at line 205 of file ProcessFreeBSD.h.

◆ tid_collection

Definition at line 171 of file ProcessFreeBSD.h.

Constructor & Destructor Documentation

◆ ProcessFreeBSD()

ProcessFreeBSD::ProcessFreeBSD ( lldb::TargetSP  target_sp,
lldb::ListenerSP  listener_sp,
lldb::UnixSignalsSP &  unix_signals_sp 
)

◆ ~ProcessFreeBSD()

ProcessFreeBSD::~ProcessFreeBSD ( )

Definition at line 264 of file ProcessFreeBSD.cpp.

References m_monitor.

Member Function Documentation

◆ AddThreadForInitialStopIfNeeded()

bool ProcessFreeBSD::AddThreadForInitialStopIfNeeded ( lldb::tid_t  stop_tid)

Adds the thread to the list of threads for which we have received the initial stopping signal.

The stop_tid parameter indicates the thread which the stop happened for.

Definition at line 516 of file ProcessFreeBSD.cpp.

References m_seen_initial_stop.

Referenced by GetMonitor().

◆ CanDebug()

bool ProcessFreeBSD::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 274 of file ProcessFreeBSD.cpp.

◆ CreateInstance()

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

Definition at line 71 of file ProcessFreeBSD.cpp.

References NULL.

◆ CreateNewFreeBSDThread()

FreeBSDThread * ProcessFreeBSD::CreateNewFreeBSDThread ( lldb_private::Process process,
lldb::tid_t  tid 
)
virtual

Definition at line 531 of file ProcessFreeBSD.cpp.

References FreeBSDThread.

Referenced by GetMonitor().

◆ DidLaunch()

void ProcessFreeBSD::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 437 of file ProcessFreeBSD.cpp.

◆ DisableBreakpointSite()

Status ProcessFreeBSD::DisableBreakpointSite ( lldb_private::BreakpointSite bp_site)
overridevirtual

Reimplemented from lldb_private::Process.

Definition at line 691 of file ProcessFreeBSD.cpp.

References lldb_private::Process::DisableSoftwareBreakpoint().

◆ DisableWatchpoint()

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

◆ DoAllocateMemory()

addr_t ProcessFreeBSD::DoAllocateMemory ( size_t  size,
uint32_t  permissions,
lldb_private::Status error 
)
overridevirtual

Actually allocate memory in the process.

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

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

Reimplemented from lldb_private::Process.

Definition at line 593 of file ProcessFreeBSD.cpp.

References lldb_private::Status::Clear(), lldb_private::eMmapFlagsAnon, lldb_private::eMmapFlagsPrivate, lldb_private::eMmapProtExec, lldb_private::eMmapProtRead, lldb_private::eMmapProtWrite, lldb_private::GetPermissionsAsCString(), lldb_private::InferiorCallMmap(), LLDB_INVALID_ADDRESS, m_addr_to_mmap_size, and lldb_private::Status::SetErrorStringWithFormat().

◆ DoAttachToProcessWithID()

Status ProcessFreeBSD::DoAttachToProcessWithID ( lldb::pid_t  pid,
const lldb_private::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 286 of file ProcessFreeBSD.cpp.

References lldb_private::eLoadDependentsYes, error(), lldb_private::Target::GetArchitecture(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::Process::GetID(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Process::GetTarget(), ProcessMonitor::GetTerminalFD(), lldb_private::ArchSpec::IsExactMatch(), lldb_private::ArchSpec::IsValid(), LLDB_LOGV, m_monitor, NULL, POSIX_LOG_PROCESS, lldb_private::Target::SetArchitecture(), lldb_private::Target::SetExecutableModule(), lldb_private::Process::SetID(), lldb_private::Process::SetSTDIOFileDescriptor(), and lldb_private::Status::Success().

◆ DoDeallocateMemory()

Status ProcessFreeBSD::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 619 of file ProcessFreeBSD.cpp.

References error(), lldb_private::InferiorCallMunmap(), m_addr_to_mmap_size, and lldb_private::Status::SetErrorStringWithFormat().

◆ DoDestroy()

Status ProcessFreeBSD::DoDestroy ( )
overridevirtual

◆ DoDetach()

Status ProcessFreeBSD::DoDetach ( bool  keep_stopped)
overridevirtual

Detaches from a running or stopped process.

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

Reimplemented from lldb_private::Process.

Definition at line 109 of file ProcessFreeBSD.cpp.

References error(), lldb::eStateDetached, lldb_private::Status::SetErrorString(), and lldb_private::Status::Success().

◆ DoDidExec()

void ProcessFreeBSD::DoDidExec ( )
overridevirtual

◆ DoHalt()

Status ProcessFreeBSD::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 449 of file ProcessFreeBSD.cpp.

References error(), lldb_private::Process::GetID(), IsStopped(), lldb_private::Status::SetErrorToErrno(), and SIGSTOP.

◆ DoLaunch()

Status ProcessFreeBSD::DoLaunch ( lldb_private::Module exe_module,
lldb_private::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 359 of file ProcessFreeBSD.cpp.

References error(), lldb::eStateLaunching, lldb_private::ProcessInfo::GetArguments(), lldb_private::Args::GetConstArgumentVector(), lldb_private::FileSpec::GetCString(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessLaunchInfo::GetFileActionForFD(), GetFileSpec(), lldb_private::FileSpec::GetPath(), ProcessMonitor::GetPID(), lldb_private::ProcessLaunchInfo::GetPTY(), lldb_private::PseudoTerminal::GetSecondaryName(), ProcessMonitor::GetTerminalFD(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), m_module, m_monitor, NULL, lldb_private::Status::SetErrorStringWithFormat(), lldb_private::Status::SetErrorToErrno(), lldb_private::Process::SetID(), lldb_private::Process::SetPrivateState(), lldb_private::Process::SetSTDIOFileDescriptor(), and lldb_private::Status::Success().

◆ DoReadMemory()

size_t ProcessFreeBSD::DoReadMemory ( lldb::addr_t  vm_addr,
void *  buf,
size_t  size,
lldb_private::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 581 of file ProcessFreeBSD.cpp.

References m_monitor, and ProcessMonitor::ReadMemory().

◆ DoResume()

Status ProcessFreeBSD::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 125 of file ProcessFreeBSD.cpp.

References error(), lldb::eStateRunning, lldb_private::Status::Fail(), lldb_private::GetLogIfAllCategoriesSet(), LLDB_LOGF, and POSIX_LOG_PROCESS.

◆ DoSignal()

Status ProcessFreeBSD::DoSignal ( int  signal)
overridevirtual

Sends a process a UNIX signal signal.

Returns
Returns an error object.

Reimplemented from lldb_private::Process.

Definition at line 463 of file ProcessFreeBSD.cpp.

References error(), lldb_private::Process::GetID(), and lldb_private::Status::SetErrorToErrno().

◆ DoWriteMemory()

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

Actually do the writing of memory to a process.

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

Reimplemented from lldb_private::Process.

Definition at line 587 of file ProcessFreeBSD.cpp.

References m_monitor, and ProcessMonitor::WriteMemory().

◆ EnableBreakpointSite()

Status ProcessFreeBSD::EnableBreakpointSite ( lldb_private::BreakpointSite bp_site)
overridevirtual

◆ EnableWatchpoint()

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

◆ Finalize()

void ProcessFreeBSD::Finalize ( )
overridevirtual

This object is about to be destroyed, do any necessary cleanup.

Subclasses that override this method should always call this superclass method.

Reimplemented from lldb_private::Process.

Definition at line 267 of file ProcessFreeBSD.cpp.

References lldb_private::repro::Finalize(), m_monitor, and ProcessMonitor::StopMonitor().

◆ GetAuxvData()

lldb_private::DataExtractor ProcessFreeBSD::GetAuxvData ( )
overridevirtual

◆ GetByteOrder()

ByteOrder ProcessFreeBSD::GetByteOrder ( ) const
virtual

Definition at line 817 of file ProcessFreeBSD.cpp.

References m_byte_order.

Referenced by GetAuxvData().

◆ GetFileSpec()

FileSpec ProcessFreeBSD::GetFileSpec ( const lldb_private::FileAction file_action,
const lldb_private::FileSpec default_file_spec,
const lldb_private::FileSpec dbg_pts_file_spec 
)

◆ GetImageInfoAddress()

addr_t ProcessFreeBSD::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 439 of file ProcessFreeBSD.cpp.

References lldb_private::Target::GetExecutableModule(), lldb_private::ObjectFile::GetImageInfoAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetTarget(), lldb_private::Address::IsValid(), and LLDB_INVALID_ADDRESS.

◆ GetMonitor()

ProcessMonitor& ProcessFreeBSD::GetMonitor ( )
inline

◆ GetPluginDescriptionStatic()

const char * ProcessFreeBSD::GetPluginDescriptionStatic ( )
static

Definition at line 95 of file ProcessFreeBSD.cpp.

◆ GetPluginName()

lldb_private::ConstString ProcessFreeBSD::GetPluginName ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 101 of file ProcessFreeBSD.cpp.

◆ GetPluginNameStatic()

lldb_private::ConstString ProcessFreeBSD::GetPluginNameStatic ( )
static

Definition at line 90 of file ProcessFreeBSD.cpp.

◆ GetPluginVersion()

uint32_t ProcessFreeBSD::GetPluginVersion ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 105 of file ProcessFreeBSD.cpp.

◆ GetSoftwareBreakpointTrapOpcode()

size_t ProcessFreeBSD::GetSoftwareBreakpointTrapOpcode ( lldb_private::BreakpointSite bp_site)
virtual

◆ GetStepTids()

tid_collection& ProcessFreeBSD::GetStepTids ( )
inline

Definition at line 172 of file ProcessFreeBSD.h.

References m_step_tids.

◆ GetWatchpointSupportInfo() [1/2]

Status ProcessFreeBSD::GetWatchpointSupportInfo ( uint32_t num)
overridevirtual

◆ GetWatchpointSupportInfo() [2/2]

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

Reimplemented from lldb_private::Process.

Definition at line 803 of file ProcessFreeBSD.cpp.

References error(), and GetWatchpointSupportInfo().

◆ HasExited()

bool ProcessFreeBSD::HasExited ( )
protected

Returns true if the process has exited.

Definition at line 834 of file ProcessFreeBSD.cpp.

References lldb::eStateDetached, lldb::eStateExited, and lldb_private::Process::GetPrivateState().

Referenced by DoDestroy().

◆ Initialize()

void ProcessFreeBSD::Initialize ( )
static

Definition at line 81 of file ProcessFreeBSD.cpp.

◆ IsAlive()

bool ProcessFreeBSD::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 575 of file ProcessFreeBSD.cpp.

References lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateUnloaded, and lldb_private::Process::GetPrivateState().

◆ IsAThreadRunning()

bool ProcessFreeBSD::IsAThreadRunning ( )
protected

◆ IsSoftwareStepBreakpoint()

bool ProcessFreeBSD::IsSoftwareStepBreakpoint ( lldb::tid_t  tid)

◆ IsStopped()

bool ProcessFreeBSD::IsStopped ( )
protected

Returns true if the process is stopped.

Definition at line 847 of file ProcessFreeBSD.cpp.

References lldb::eStateCrashed, lldb::eStateStopped, lldb::eStateSuspended, and lldb_private::Process::GetPrivateState().

Referenced by DoHalt().

◆ PutSTDIN()

size_t ProcessFreeBSD::PutSTDIN ( const char *  buf,
size_t  buf_size,
lldb_private::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 823 of file ProcessFreeBSD.cpp.

References ProcessMonitor::GetTerminalFD(), m_monitor, and lldb_private::Status::SetErrorToErrno().

◆ RefreshStateAfterStop()

void ProcessFreeBSD::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 536 of file ProcessFreeBSD.cpp.

References ProcessMessage::eExitMessage, lldb_private::ThreadList::FindThreadByID(), ProcessMessage::GetKind(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ThreadList::GetMutex(), lldb_private::Process::GetThreadList(), ProcessMessage::GetTID(), LLDB_LOG, LLDB_LOGV, m_message_mutex, m_message_queue, m_seen_initial_stop, lldb_private::Process::m_thread_list, FreeBSDThread::Notify(), POSIX_LOG_PROCESS, lldb_private::ThreadList::RefreshStateAfterStop(), and lldb_private::ThreadList::RemoveThreadByID().

◆ SendMessage()

void ProcessFreeBSD::SendMessage ( const ProcessMessage message)
virtual

◆ SetSoftwareSingleStepBreakpoint()

Status ProcessFreeBSD::SetSoftwareSingleStepBreakpoint ( lldb::tid_t  tid,
lldb::addr_t  addr 
)

◆ SetupSoftwareSingleStepping()

Status ProcessFreeBSD::SetupSoftwareSingleStepping ( lldb::tid_t  tid)

◆ SingleStepBreakpointHit()

bool ProcessFreeBSD::SingleStepBreakpointHit ( void *  baton,
lldb_private::StoppointCallbackContext context,
lldb::user_id_t  break_id,
lldb::user_id_t  break_loc_id 
)
static

Definition at line 959 of file ProcessFreeBSD.cpp.

Referenced by GetMonitor(), and SetSoftwareSingleStepBreakpoint().

◆ SupportHardwareSingleStepping()

bool ProcessFreeBSD::SupportHardwareSingleStepping ( ) const

◆ Terminate()

void ProcessFreeBSD::Terminate ( )
static

Definition at line 107 of file ProcessFreeBSD.cpp.

◆ UpdateThreadList()

bool ProcessFreeBSD::UpdateThreadList ( lldb_private::ThreadList old_thread_list,
lldb_private::ThreadList new_thread_list 
)
overridevirtual

◆ UpdateThreadListIfNeeded()

uint32_t ProcessFreeBSD::UpdateThreadListIfNeeded ( )
virtual

◆ WaitingForInitialStop()

bool ProcessFreeBSD::WaitingForInitialStop ( lldb::tid_t  stop_tid)

Definition at line 526 of file ProcessFreeBSD.cpp.

References m_seen_initial_stop.

Referenced by GetMonitor().

◆ WillLaunch()

Status ProcessFreeBSD::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 336 of file ProcessFreeBSD.cpp.

References error().

◆ WillResume()

Status ProcessFreeBSD::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 203 of file ProcessFreeBSD.cpp.

Friends And Related Function Documentation

◆ FreeBSDThread

friend class FreeBSDThread
friend

Definition at line 210 of file ProcessFreeBSD.h.

Referenced by CreateNewFreeBSDThread().

Member Data Documentation

◆ m_addr_to_mmap_size

MMapMap ProcessFreeBSD::m_addr_to_mmap_size
protected

Definition at line 203 of file ProcessFreeBSD.h.

Referenced by DoAllocateMemory(), and DoDeallocateMemory().

◆ m_byte_order

lldb::ByteOrder ProcessFreeBSD::m_byte_order
protected

Target byte order.

Definition at line 178 of file ProcessFreeBSD.h.

Referenced by GetByteOrder(), and ProcessFreeBSD().

◆ m_exit_now

bool ProcessFreeBSD::m_exit_now
protected

Drive any exit events to completion.

Definition at line 191 of file ProcessFreeBSD.h.

Referenced by DoDestroy().

◆ m_message_mutex

std::recursive_mutex ProcessFreeBSD::m_message_mutex
protected

Message queue notifying this instance of inferior process state changes.

Definition at line 187 of file ProcessFreeBSD.h.

Referenced by RefreshStateAfterStop().

◆ m_message_queue

std::queue<ProcessMessage> ProcessFreeBSD::m_message_queue
protected

Definition at line 188 of file ProcessFreeBSD.h.

Referenced by RefreshStateAfterStop().

◆ m_module

lldb_private::Module* ProcessFreeBSD::m_module
protected

The module we are executing.

Definition at line 184 of file ProcessFreeBSD.h.

Referenced by DoLaunch().

◆ m_monitor

ProcessMonitor* ProcessFreeBSD::m_monitor
protected

◆ m_resume_signo

int ProcessFreeBSD::m_resume_signo
protected

Definition at line 217 of file ProcessFreeBSD.h.

Referenced by FreeBSDThread::WillResume().

◆ m_run_tids

tid_collection ProcessFreeBSD::m_run_tids
protected

Definition at line 213 of file ProcessFreeBSD.h.

Referenced by FreeBSDThread::WillResume().

◆ m_seen_initial_stop

ThreadStopSet ProcessFreeBSD::m_seen_initial_stop
protected

Every thread begins with a stop signal.

This keeps track of the threads for which we have received the stop signal.

Definition at line 208 of file ProcessFreeBSD.h.

Referenced by AddThreadForInitialStopIfNeeded(), RefreshStateAfterStop(), and WaitingForInitialStop().

◆ m_step_tids

tid_collection ProcessFreeBSD::m_step_tids
protected

Definition at line 214 of file ProcessFreeBSD.h.

Referenced by GetStepTids(), and FreeBSDThread::WillResume().

◆ m_suspend_tids

tid_collection ProcessFreeBSD::m_suspend_tids
protected

Definition at line 212 of file ProcessFreeBSD.h.

Referenced by FreeBSDThread::WillResume().

◆ m_threads_stepping_with_breakpoint

std::map<lldb::tid_t, lldb::break_id_t> ProcessFreeBSD::m_threads_stepping_with_breakpoint
protected

Definition at line 215 of file ProcessFreeBSD.h.

Referenced by IsSoftwareStepBreakpoint(), and SetSoftwareSingleStepBreakpoint().

◆ MAX_TRAP_OPCODE_SIZE

const size_t ProcessFreeBSD::MAX_TRAP_OPCODE_SIZE = 8
staticprotected

Definition at line 175 of file ProcessFreeBSD.h.


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