LLDB mainline
|
#include <ProcessElfCore.h>
Classes | |
struct | NT_FILE_Entry |
Public Member Functions | |
ProcessElfCore (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec &core_file) | |
~ProcessElfCore () 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. | |
lldb_private::Status | DoLoadCore () override |
lldb_private::DynamicLoader * | GetDynamicLoader () override |
Get the dynamic loader plug-in for this process. | |
llvm::StringRef | GetPluginName () override |
lldb_private::Status | DoDestroy () override |
void | RefreshStateAfterStop () override |
Currently called as part of ShouldStop. | |
lldb_private::Status | WillResume () override |
Called before resuming to a process. | |
bool | IsAlive () override |
Check if a process is still alive. | |
bool | WarnBeforeDetach () const override |
Before lldb detaches from a process, it warns the user that they are about to lose their debug session. | |
size_t | ReadMemory (lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override |
Read of memory from a process. | |
size_t | DoReadMemory (lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override |
Actually do the reading of memory from a process. | |
llvm::Expected< std::vector< lldb::addr_t > > | ReadMemoryTags (lldb::addr_t addr, size_t len) override |
Read memory tags for the range addr to addr+len. | |
lldb::addr_t | GetImageInfoAddress () override |
Get the image information address for the current process. | |
lldb_private::ArchSpec | GetArchitecture () |
lldb_private::DataExtractor | GetAuxvData () override |
bool | GetProcessInfo (lldb_private::ProcessInstanceInfo &info) override |
Public Member Functions inherited from lldb_private::PostMortemProcess | |
PostMortemProcess (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec &core_file) | |
bool | IsLiveDebugSession () const override |
FileSpec | GetCoreFile () const override |
Provide a way to retrieve the core dump file that is loaded for debugging. | |
Public Member Functions inherited from lldb_private::Process | |
llvm::StringRef | GetBroadcasterClass () 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. | |
~Process () override | |
Destructor. | |
lldb::ByteOrder | GetByteOrder () const |
uint32_t | GetAddressByteSize () const |
lldb::pid_t | GetID () const |
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid. | |
void | SetID (lldb::pid_t new_pid) |
Sets the stored pid. | |
uint32_t | GetUniqueID () const |
virtual bool | CanDebug (lldb::TargetSP target, bool plugin_specified_by_name)=0 |
Check if a plug-in instance can debug the file in module. | |
virtual void | Finalize (bool destructing) |
This object is about to be destroyed, do any necessary cleanup. | |
bool | IsValid () const |
Return whether this object is valid (i.e. | |
virtual CommandObject * | GetPluginCommandObject () |
Return a multi-word command object that can be used to expose plug-in specific commands. | |
virtual void | DumpPluginHistory (Stream &s) |
The underlying plugin might store the low-level communication history for this session. | |
virtual Status | Launch (ProcessLaunchInfo &launch_info) |
Launch a new process. | |
virtual Status | LoadCore () |
virtual Status | DoLoadCore () |
void | SetShadowListener (lldb::ListenerSP shadow_listener_sp) |
The "ShadowListener" for a process is just an ordinary Listener that listens for all the Process event bits. | |
UtilityFunction * | GetLoadImageUtilityFunction (Platform *platform, llvm::function_ref< std::unique_ptr< UtilityFunction >()> factory) |
Get the cached UtilityFunction that assists in loading binary images into the process. | |
virtual DynamicLoader * | GetDynamicLoader () |
Get the dynamic loader plug-in for this process. | |
void | SetDynamicLoader (lldb::DynamicLoaderUP dyld) |
virtual DataExtractor | GetAuxvData () |
virtual llvm::Error | LoadModules () |
Sometimes processes know how to retrieve and load shared libraries. | |
virtual llvm::Expected< LoadedModuleInfoList > | GetLoadedModuleList () |
Query remote GDBServer for a detailed loaded library list. | |
virtual llvm::Expected< bool > | SaveCore (llvm::StringRef outfile) |
Save core dump into the specified file. | |
Status | CalculateCoreFileSaveRanges (const SaveCoreOptions &core_options, CoreFileMemoryRanges &ranges) |
Helper function for Process::SaveCore(...) that calculates the address ranges that should be saved. | |
std::vector< lldb::ThreadSP > | CalculateCoreFileThreadList (const SaveCoreOptions &core_options) |
Helper function for Process::SaveCore(...) that calculates the thread list based upon options set within a given core_options object. | |
virtual ArchSpec | GetSystemArchitecture () |
Get the system architecture for this process. | |
virtual SystemRuntime * | GetSystemRuntime () |
Get the system runtime plug-in for this process. | |
virtual Status | Attach (ProcessAttachInfo &attach_info) |
Attach to an existing process using the process attach info. | |
virtual Status | ConnectRemote (llvm::StringRef remote_url) |
Attach to a remote system via a URL. | |
bool | GetShouldDetach () const |
void | SetShouldDetach (bool b) |
const std::vector< lldb::addr_t > & | GetImageTokens () |
Get the image vector for the current process. | |
virtual lldb::addr_t | GetImageInfoAddress () |
Get the image information address for the current process. | |
virtual void | WillPublicStop () |
Called when the process is about to broadcast a public stop. | |
void | RegisterNotificationCallbacks (const Process::Notifications &callbacks) |
Register for process and thread notifications. | |
bool | UnregisterNotificationCallbacks (const Process::Notifications &callbacks) |
Unregister for process and thread notifications. | |
Status | Resume () |
Resumes all of a process's threads as configured using the Thread run control functions. | |
Status | ResumeSynchronous (Stream *stream) |
Resume a process, and wait for it to stop. | |
Status | Halt (bool clear_thread_plans=false, bool use_run_lock=true) |
Halts a running process. | |
Status | Detach (bool keep_stopped) |
Detaches from a running or stopped process. | |
Status | Destroy (bool force_kill) |
Kills the process and shuts down all threads that were spawned to track and monitor the process. | |
Status | Signal (int signal) |
Sends a process a UNIX signal signal. | |
void | SetUnixSignals (lldb::UnixSignalsSP &&signals_sp) |
const lldb::UnixSignalsSP & | GetUnixSignals () |
Status | WillAttachToProcessWithID (lldb::pid_t pid) |
Called before attaching to a process. | |
virtual Status | DoWillAttachToProcessWithID (lldb::pid_t pid) |
Called before attaching to a process. | |
Status | WillAttachToProcessWithName (const char *process_name, bool wait_for_launch) |
Called before attaching to a process. | |
virtual Status | DoWillAttachToProcessWithName (const char *process_name, bool wait_for_launch) |
Called before attaching to a process. | |
virtual Status | DoConnectRemote (llvm::StringRef remote_url) |
Attach to a remote system via a URL. | |
virtual Status | DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info) |
Attach to an existing process using a process ID. | |
virtual Status | DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info) |
Attach to an existing process using a partial process name. | |
virtual void | DidAttach (ArchSpec &process_arch) |
Called after attaching a process. | |
virtual void | DidExec () |
Called after a process re-execs itself. | |
virtual void | DoDidExec () |
Subclasses of Process should implement this function if they need to do anything after a process exec's itself. | |
virtual void | DidFork (lldb::pid_t child_pid, lldb::tid_t child_tid) |
Called after a reported fork. | |
virtual void | DidVFork (lldb::pid_t child_pid, lldb::tid_t child_tid) |
Called after a reported vfork. | |
virtual void | DidVForkDone () |
Called after reported vfork completion. | |
Status | WillLaunch (Module *module) |
Called before launching to a process. | |
virtual Status | DoWillLaunch (Module *module) |
Called before launching to a process. | |
virtual Status | DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) |
Launch a new process. | |
virtual void | DidLaunch () |
Called after launching a process. | |
virtual Status | WillResume () |
Called before resuming to a process. | |
virtual Status | DoResume () |
Resumes all of a process's threads as configured using the Thread run control functions. | |
virtual void | DidResume () |
Called after resuming a process. | |
virtual Status | WillHalt () |
Called before halting to a process. | |
virtual Status | DoHalt (bool &caused_stop) |
Halts a running process. | |
virtual void | DidHalt () |
Called after halting a process. | |
virtual Status | WillDetach () |
Called before detaching from a process. | |
virtual Status | DoDetach (bool keep_stopped) |
Detaches from a running or stopped process. | |
virtual void | DidDetach () |
Called after detaching from a process. | |
virtual bool | DetachRequiresHalt () |
virtual Status | WillSignal () |
Called before sending a signal to a process. | |
virtual Status | DoSignal (int signal) |
Sends a process a UNIX signal signal. | |
virtual Status | WillDestroy () |
virtual Status | DoDestroy ()=0 |
virtual void | DidDestroy () |
virtual bool | DestroyRequiresHalt () |
virtual void | DidSignal () |
Called after sending a signal to a process. | |
virtual void | RefreshStateAfterStop ()=0 |
Currently called as part of ShouldStop. | |
virtual llvm::VersionTuple | GetHostOSVersion () |
Sometimes the connection to a process can detect the host OS version that the process is running on. | |
virtual llvm::VersionTuple | GetHostMacCatalystVersion () |
Target & | GetTarget () |
Get the target object pointer for this module. | |
const Target & | GetTarget () const |
Get the const target object pointer for this module. | |
void | Flush () |
Flush all data in the process. | |
lldb::StateType | GetState () |
Get accessor for the current process state. | |
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 (Thread *thread=nullptr) |
Send an async interrupt request. | |
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. | |
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 () |
virtual lldb_private::StructuredData::ObjectSP | GetDynamicLoaderProcessState () |
void | PrintWarningOptimization (const SymbolContext &sc) |
Print a user-visible warning about a module being built with optimization. | |
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. | |
virtual bool | GetProcessInfo (ProcessInstanceInfo &info) |
int | GetExitStatus () |
Get the exit status for a process. | |
const char * | GetExitDescription () |
Get a textual description of what the process exited. | |
virtual void | DidExit () |
lldb::addr_t | GetCodeAddressMask () |
Get the current address mask in the Process. | |
lldb::addr_t | GetDataAddressMask () |
lldb::addr_t | GetHighmemCodeAddressMask () |
The highmem masks are for targets where we may have different masks for low memory versus high memory addresses, and they will be left as LLDB_INVALID_ADDRESS_MASK normally, meaning the base masks should be applied to all addresses. | |
lldb::addr_t | GetHighmemDataAddressMask () |
void | SetCodeAddressMask (lldb::addr_t code_address_mask) |
void | SetDataAddressMask (lldb::addr_t data_address_mask) |
void | SetHighmemCodeAddressMask (lldb::addr_t code_address_mask) |
void | SetHighmemDataAddressMask (lldb::addr_t data_address_mask) |
lldb::addr_t | FixCodeAddress (lldb::addr_t pc) |
Some targets might use bits in a code address to indicate a mode switch, ARM uses bit zero to signify a code address is thumb, so any ARM ABI plug-ins would strip those bits. | |
lldb::addr_t | FixDataAddress (lldb::addr_t pc) |
lldb::addr_t | FixAnyAddress (lldb::addr_t pc) |
Use this method when you do not know, or do not care what kind of address you are fixing. | |
ProcessModID | GetModID () const |
Get the Modification ID of the process. | |
const ProcessModID & | GetModIDRef () 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, llvm::StringRef exit_string) |
Set accessor for the process exit status (return code). | |
virtual bool | IsAlive () |
Check if a process is still alive. | |
virtual bool | IsLiveDebugSession () const |
virtual FileSpec | GetCoreFile () const |
Provide a way to retrieve the core dump file that is loaded for debugging. | |
virtual bool | WarnBeforeDetach () const |
Before lldb detaches from a process, it warns the user that they are about to lose their debug session. | |
virtual size_t | ReadMemory (lldb::addr_t vm_addr, void *buf, size_t size, Status &error) |
Read of memory from a process. | |
size_t | ReadMemoryFromInferior (lldb::addr_t vm_addr, void *buf, size_t size, Status &error) |
Read of memory from a process. | |
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. | |
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. | |
int64_t | ReadSignedIntegerFromMemory (lldb::addr_t load_addr, size_t byte_size, int64_t fail_value, Status &error) |
lldb::addr_t | ReadPointerFromMemory (lldb::addr_t vm_addr, Status &error) |
bool | WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Status &error) |
virtual size_t | DoWriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, Status &error) |
Actually do the writing of memory to a process. | |
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. | |
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. | |
virtual lldb::addr_t | DoAllocateMemory (size_t size, uint32_t permissions, Status &error) |
Actually allocate memory in the process. | |
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. | |
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. | |
llvm::Expected< const MemoryTagManager * > | GetMemoryTagManager () |
If this architecture and process supports memory tagging, return a tag manager that can be used to maniupulate those memory tags. | |
virtual llvm::Expected< std::vector< lldb::addr_t > > | ReadMemoryTags (lldb::addr_t addr, size_t len) |
Read memory tags for the range addr to addr+len. | |
Status | WriteMemoryTags (lldb::addr_t addr, size_t len, const std::vector< lldb::addr_t > &tags) |
Write memory tags for a range of memory. | |
virtual lldb::addr_t | ResolveIndirectFunction (const Address *address, Status &error) |
Resolve dynamically loaded indirect functions. | |
Status | GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info) |
Locate the memory region that contains load_addr. | |
virtual Status | GetMemoryRegions (lldb_private::MemoryRegionInfos ®ion_list) |
Obtain all the mapped memory regions within this process. | |
virtual std::optional< uint32_t > | GetWatchpointSlotCount () |
Get the number of watchpoints supported by this target. | |
bool | GetWatchpointReportedAfter () |
Whether lldb will be notified about watchpoints after the instruction has completed executing, or if the instruction is rolled back and it is notified before it executes. | |
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. | |
bool | CanJIT () |
Determines whether executing JIT-compiled code in this process is possible. | |
void | SetCanJIT (bool can_jit) |
Sets whether executing JIT-compiled code in this process is possible. | |
bool | CanInterpretFunctionCalls () |
Determines whether executing function calls using the interpreter is possible for this process. | |
void | SetCanInterpretFunctionCalls (bool can_interpret_function_calls) |
Sets whether executing function calls using the interpreter is possible for this process. | |
void | SetCanRunCode (bool can_run_code) |
Sets whether executing code in this process is possible. | |
virtual Status | DoDeallocateMemory (lldb::addr_t ptr) |
Actually deallocate memory in the process. | |
Status | DeallocateMemory (lldb::addr_t ptr) |
The public interface to deallocating memory in the process. | |
virtual size_t | GetSTDOUT (char *buf, size_t buf_size, Status &error) |
Get any available STDOUT. | |
virtual size_t | GetSTDERR (char *buf, size_t buf_size, Status &error) |
Get any available STDERR. | |
virtual size_t | PutSTDIN (const char *buf, size_t buf_size, Status &error) |
Puts data into this process's STDIN. | |
virtual size_t | GetAsyncProfileData (char *buf, size_t buf_size, Status &error) |
Get any available profile data. | |
size_t | GetSoftwareBreakpointTrapOpcode (BreakpointSite *bp_site) |
virtual Status | EnableBreakpointSite (BreakpointSite *bp_site) |
virtual Status | DisableBreakpointSite (BreakpointSite *bp_site) |
virtual Status | EnableSoftwareBreakpoint (BreakpointSite *bp_site) |
virtual Status | DisableSoftwareBreakpoint (BreakpointSite *bp_site) |
StopPointSiteList< lldb_private::BreakpointSite > & | GetBreakpointSiteList () |
const StopPointSiteList< lldb_private::BreakpointSite > & | GetBreakpointSiteList () 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 | RemoveConstituentFromBreakpointSite (lldb::user_id_t site_id, lldb::user_id_t constituent_id, lldb::BreakpointSiteSP &bp_site_sp) |
virtual Status | EnableWatchpoint (lldb::WatchpointSP wp_sp, bool notify=true) |
virtual Status | DisableWatchpoint (lldb::WatchpointSP wp_sp, bool notify=true) |
bool | UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) |
Update the thread list. | |
void | UpdateThreadListIfNeeded () |
ThreadList & | GetThreadList () |
StopPointSiteList< lldb_private::WatchpointResource > & | GetWatchpointResourceList () |
ThreadList & | GetExtendedThreadList () |
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) |
virtual void | UpdateQueueListIfNeeded () |
QueueList & | GetQueueList () |
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, SelectMostRelevant select_most_relevant=DoNoSelectMostRelevantFrame) |
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. | |
lldb::StateType | GetStateChangedEvents (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout, lldb::ListenerSP hijack_listener) |
Event * | PeekAtStateChangedEvents () |
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. | |
void | RestoreProcessEvents () |
Restores the process event broadcasting to its normal state. | |
bool | StateChangedIsHijackedForSynchronousResume () |
bool | StateChangedIsExternallyHijacked () |
const lldb::ABISP & | GetABI () |
OperatingSystem * | GetOperatingSystem () |
std::vector< LanguageRuntime * > | GetLanguageRuntimes () |
LanguageRuntime * | GetLanguageRuntime (lldb::LanguageType language) |
bool | IsPossibleDynamicValue (ValueObject &in_value) |
bool | IsRunning () const |
DynamicCheckerFunctions * | GetDynamicCheckers () |
void | SetDynamicCheckers (DynamicCheckerFunctions *dynamic_checkers) |
bool | PruneThreadPlansForTID (lldb::tid_t tid) |
Prune ThreadPlanStacks for unreported threads. | |
void | PruneThreadPlans () |
Prune ThreadPlanStacks for all unreported threads. | |
ThreadPlanStack * | FindThreadPlans (lldb::tid_t tid) |
Find the thread plan stack associated with thread with tid. | |
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. | |
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. | |
virtual bool | StartNoticingNewThreads () |
Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts. | |
virtual bool | StopNoticingNewThreads () |
Call this to turn off the stop & notice new threads mode. | |
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. | |
void | SetSTDIOFileDescriptor (int file_descriptor) |
void | AddInvalidMemoryRegion (const LoadRange ®ion) |
bool | RemoveInvalidMemoryRange (const LoadRange ®ion) |
void | AddPreResumeAction (PreResumeActionCallback callback, void *baton) |
bool | RunPreResumeActions () |
void | ClearPreResumeActions () |
void | ClearPreResumeAction (PreResumeActionCallback callback, void *baton) |
ProcessRunLock & | GetRunLock () |
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. | |
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. | |
virtual StructuredData::DictionarySP | GetMetadata () |
Fetch process defined metadata. | |
StructuredData::DictionarySP | GetExtendedCrashInfoDict () |
Fetch extended crash information held by the process. | |
void | ResetExtendedCrashInfoDict () |
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. | |
virtual Status | ConfigureStructuredData (llvm::StringRef type_name, const StructuredData::ObjectSP &config_sp) |
Configure asynchronous structured data feature. | |
void | BroadcastStructuredData (const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp) |
Broadcasts the given structured data object from the given plugin. | |
lldb::StructuredDataPluginSP | GetStructuredDataPlugin (llvm::StringRef type_name) const |
Returns the StructuredDataPlugin associated with a given type name, if there is one. | |
virtual void * | GetImplementation () |
virtual void | ForceScriptedState (lldb::StateType state) |
SourceManager::SourceFileCache & | GetSourceFileCache () |
lldb::addr_t | FindInMemory (lldb::addr_t low, lldb::addr_t high, const uint8_t *buf, size_t size) |
Find a pattern within a memory region. | |
AddressRanges | FindRangesInMemory (const uint8_t *buf, uint64_t size, const AddressRanges &ranges, size_t alignment, size_t max_matches, Status &error) |
lldb::addr_t | FindInMemory (const uint8_t *buf, uint64_t size, const AddressRange &range, size_t alignment, Status &error) |
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 |
uint32_t | GetVirtualAddressableBits () const |
void | SetVirtualAddressableBits (uint32_t bits) |
uint32_t | GetHighmemVirtualAddressableBits () const |
void | SetHighmemVirtualAddressableBits (uint32_t bits) |
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 | GetDisableLangRuntimeUnwindPlans () const |
void | SetDisableLangRuntimeUnwindPlans (bool disable) |
bool | GetDetachKeepsStopped () const |
void | SetDetachKeepsStopped (bool keep_stopped) |
bool | GetWarningsOptimization () const |
bool | GetWarningsUnsupportedLanguage () const |
bool | GetStopOnExec () const |
std::chrono::seconds | GetUtilityExpressionTimeout () const |
std::chrono::seconds | GetInterruptTimeout () const |
bool | GetOSPluginReportsAllThreads () const |
void | SetOSPluginReportsAllThreads (bool does_report) |
bool | GetSteppingRunsAllThreads () const |
FollowForkMode | GetFollowForkMode () 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, 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, bool is_json=false) |
virtual void | DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask, bool is_json=false) |
virtual void | DumpAllDescriptions (CommandInterpreter &interpreter, Stream &strm) const |
size_t | Apropos (llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const |
template<typename T > | |
T | GetPropertyAtIndexAs (uint32_t idx, T default_value, const ExecutionContext *exe_ctx=nullptr) const |
template<typename T , typename U = typename std::remove_pointer<T>::type, std::enable_if_t< std::is_pointer_v< T >, bool > = true> | |
const U * | GetPropertyAtIndexAs (uint32_t idx, const ExecutionContext *exe_ctx=nullptr) const |
template<typename T > | |
bool | SetPropertyAtIndex (uint32_t idx, T t, const ExecutionContext *exe_ctx=nullptr) const |
Public Member Functions inherited from lldb_private::Broadcaster | |
Broadcaster (lldb::BroadcasterManagerSP manager_sp, std::string name) | |
Construct with a broadcaster with a name. | |
virtual | ~Broadcaster () |
Destructor. | |
void | CheckInWithManager () |
void | BroadcastEvent (lldb::EventSP &event_sp) |
Broadcast an event which has no associated data. | |
void | BroadcastEventIfUnique (lldb::EventSP &event_sp) |
void | BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp) |
void | BroadcastEvent (uint32_t event_type) |
void | BroadcastEventIfUnique (uint32_t event_type) |
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. | |
const std::string & | GetBroadcasterName () |
Get this broadcaster's name. | |
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. | |
void | SetEventName (uint32_t event_mask, const char *name) |
Set the name for an event bit. | |
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. | |
bool | HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX) |
Provides a simple mechanism to temporarily redirect events from broadcaster. | |
bool | IsHijackedForEvent (uint32_t event_mask) |
void | RestoreBroadcaster () |
Restore the state of the Broadcaster from a previous hijack attempt. | |
virtual llvm::StringRef | GetBroadcasterClass () const |
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching. | |
lldb::BroadcasterManagerSP | GetManager () |
void | SetPrimaryListener (lldb::ListenerSP listener_sp) |
lldb::ListenerSP | GetPrimaryListener () |
Public Member Functions inherited from lldb_private::ExecutionContextScope | |
virtual | ~ExecutionContextScope ()=default |
virtual lldb::TargetSP | CalculateTarget ()=0 |
virtual lldb::ProcessSP | CalculateProcess ()=0 |
virtual lldb::ThreadSP | CalculateThread ()=0 |
virtual lldb::StackFrameSP | CalculateStackFrame ()=0 |
virtual void | CalculateExecutionContext (ExecutionContext &exe_ctx)=0 |
Reconstruct the object's execution context into sc. | |
Public Member Functions inherited from lldb_private::PluginInterface | |
PluginInterface ()=default | |
virtual | ~PluginInterface ()=default |
virtual llvm::StringRef | GetPluginName ()=0 |
PluginInterface (const PluginInterface &)=delete | |
PluginInterface & | operator= (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, bool can_connect) |
static void | Initialize () |
static void | Terminate () |
static llvm::StringRef | GetPluginNameStatic () |
static llvm::StringRef | GetPluginDescriptionStatic () |
Static Public Member Functions inherited from lldb_private::Process | |
static llvm::StringRef | GetStaticBroadcasterClass () |
static void | SettingsInitialize () |
static void | SettingsTerminate () |
static ProcessProperties & | GetGlobalProperties () |
static lldb::ProcessSP | FindPlugin (lldb::TargetSP target_sp, llvm::StringRef plugin_name, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect) |
Find a Process plug-in that can debug module using the currently selected architecture. | |
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 (). | |
static const char * | ExecutionResultAsCString (lldb::ExpressionResults result) |
static bool | HandleProcessStateChangedEvent (const lldb::EventSP &event_sp, Stream *stream, SelectMostRelevant select_most_relevant, bool &pop_process_io_handler) |
Centralize the code that handles and prints descriptions for process state changes. | |
Static Public Member Functions inherited from lldb_private::Properties | |
static llvm::StringRef | GetExperimentalSettingsName () |
static bool | IsSettingExperimental (llvm::StringRef setting) |
Protected Member Functions | |
void | Clear () |
bool | DoUpdateThreadList (lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override |
Update the thread list following process plug-in's specific logic. | |
lldb_private::Status | DoGetMemoryRegionInfo (lldb::addr_t load_addr, lldb_private::MemoryRegionInfo ®ion_info) override |
DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has removed non address bits from load_addr. | |
bool | SupportsMemoryTagging () override |
Check whether the process supports memory tagging. | |
Protected Member Functions inherited from lldb_private::Process | |
virtual JITLoaderList & | GetJITLoaders () |
Process (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp) | |
Construct with a shared pointer to a target, and the Process listener. | |
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. | |
virtual llvm::Expected< TraceSupportedResponse > | TraceSupported () |
Get the processor tracing type supported for this process. | |
virtual llvm::Error | TraceStart (const llvm::json::Value &request) |
Start tracing a process or its threads. | |
virtual llvm::Error | TraceStop (const TraceStopRequest &request) |
Stop tracing a live process or its threads. | |
virtual llvm::Expected< std::string > | TraceGetState (llvm::StringRef type) |
Get the current tracing state of the process and its threads. | |
virtual llvm::Expected< std::vector< uint8_t > > | TraceGetBinaryData (const TraceGetBinaryDataRequest &request) |
Get binary data given a trace technology and a data identifier. | |
bool | CallVoidArgVoidPtrReturn (const Address *address, lldb::addr_t &returned_func, bool trap_exceptions=false) |
virtual bool | DoUpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)=0 |
Update the thread list following process plug-in's specific logic. | |
virtual size_t | DoReadMemory (lldb::addr_t vm_addr, void *buf, size_t size, Status &error)=0 |
Actually do the reading of memory from a process. | |
virtual void | DoFindInMemory (lldb::addr_t start_addr, lldb::addr_t end_addr, const uint8_t *buf, size_t size, AddressRanges &matches, size_t alignment, size_t max_matches) |
virtual Status | DoGetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info) |
DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has removed non address bits from load_addr. | |
virtual std::optional< bool > | DoGetWatchpointReportedAfter () |
Provide an override value in the subclass for lldb's CPU-based logic for whether watchpoint exceptions are received before or after an instruction executes. | |
virtual lldb::ThreadSP | HandleThreadAsyncInterrupt (uint8_t signo, const std::string &description) |
Handle thread specific async interrupt and return the original thread that requested the async interrupt. | |
lldb::StateType | GetPrivateState () |
Status | PrivateResume () |
The "private" side of resuming a process. | |
void | CompleteAttach () |
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. | |
bool | RouteAsyncStructuredData (const StructuredData::ObjectSP object_sp) |
Route the incoming structured data dictionary to the right plugin. | |
virtual bool | SupportsMemoryTagging () |
Check whether the process supports memory tagging. | |
virtual llvm::Expected< std::vector< uint8_t > > | DoReadMemoryTags (lldb::addr_t addr, size_t len, int32_t type) |
Does the final operation to read memory tags. | |
virtual Status | DoWriteMemoryTags (lldb::addr_t addr, size_t len, int32_t type, const std::vector< uint8_t > &tags) |
Does the final operation to write memory tags. | |
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) |
void | SetAddressableBitMasks (AddressableBits bit_masks) |
Protected Member Functions inherited from lldb_private::Broadcaster | |
BroadcasterImplSP | GetBroadcasterImpl () |
const char * | GetHijackingListenerName () |
Private Types | |
typedef lldb_private::Range< lldb::addr_t, lldb::addr_t > | FileRange |
typedef lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, FileRange > | VMRangeToFileOffset |
typedef lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, uint32_t > | VMRangeToPermissions |
Private Member Functions | |
llvm::Error | ParseThreadContextsFromNoteSegment (const elf::ELFProgramHeader &segment_header, const lldb_private::DataExtractor &segment_data) |
Parse Thread context from PT_NOTE segment and store it in the thread list A note segment consists of one or more NOTE entries, but their types and meaning differ depending on the OS. | |
uint32_t | GetNumThreadContexts () |
void | UpdateBuildIdForNTFileEntries () |
lldb_private::UUID | FindBuidIdInCoreMemory (lldb::addr_t address) |
lldb::addr_t | AddAddressRangeFromLoadSegment (const elf::ELFProgramHeader &header) |
lldb::addr_t | AddAddressRangeFromMemoryTagSegment (const elf::ELFProgramHeader &header) |
llvm::Expected< std::vector< lldb_private::CoreNote > > | parseSegment (const lldb_private::DataExtractor &segment) |
llvm::Error | parseFreeBSDNotes (llvm::ArrayRef< lldb_private::CoreNote > notes) |
llvm::Error | parseNetBSDNotes (llvm::ArrayRef< lldb_private::CoreNote > notes) |
NetBSD specific Thread context from PT_NOTE segment. | |
llvm::Error | parseOpenBSDNotes (llvm::ArrayRef< lldb_private::CoreNote > notes) |
llvm::Error | parseLinuxNotes (llvm::ArrayRef< lldb_private::CoreNote > notes) |
A description of a linux process usually contains the following NOTE entries: | |
Private Attributes | |
lldb::ModuleSP | m_core_module_sp |
std::string | m_dyld_plugin_name |
bool | m_thread_data_valid = false |
std::vector< ThreadData > | m_thread_data |
lldb_private::DataExtractor | m_auxv |
VMRangeToFileOffset | m_core_aranges |
VMRangeToPermissions | m_core_range_infos |
VMRangeToFileOffset | m_core_tag_ranges |
std::vector< NT_FILE_Entry > | m_nt_file_entries |
Definition at line 30 of file ProcessElfCore.h.
|
private |
Definition at line 127 of file ProcessElfCore.h.
|
private |
Definition at line 129 of file ProcessElfCore.h.
|
private |
Definition at line 131 of file ProcessElfCore.h.
ProcessElfCore::ProcessElfCore | ( | lldb::TargetSP | target_sp, |
lldb::ListenerSP | listener_sp, | ||
const lldb_private::FileSpec & | core_file | ||
) |
Definition at line 99 of file ProcessElfCore.cpp.
|
override |
Definition at line 105 of file ProcessElfCore.cpp.
References Clear(), and lldb_private::Process::Finalize().
|
private |
Definition at line 114 of file ProcessElfCore.cpp.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Append(), lldb_private::RangeDataVector< B, S, T, N, Compare >::Back(), lldb_private::RangeData< B, S, T >::data, lldb_private::Range< B, S >::GetByteSize(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), m_core_aranges, m_core_range_infos, elf::ELFProgramHeader::p_filesz, elf::ELFProgramHeader::p_flags, elf::ELFProgramHeader::p_memsz, elf::ELFProgramHeader::p_offset, elf::ELFProgramHeader::p_vaddr, and lldb_private::Range< B, S >::SetRangeEnd().
Referenced by DoLoadCore().
|
private |
Definition at line 147 of file ProcessElfCore.cpp.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Append(), m_core_tag_ranges, elf::ELFProgramHeader::p_filesz, elf::ELFProgramHeader::p_memsz, elf::ELFProgramHeader::p_offset, and elf::ELFProgramHeader::p_vaddr.
Referenced by DoLoadCore().
|
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.
Implements lldb_private::Process.
Definition at line 82 of file ProcessElfCore.cpp.
References error(), lldb_private::ObjectFile::eTypeCoreFile, lldb_private::ModuleList::GetSharedModule(), lldb_private::ObjectFile::GetType(), lldb_private::FileSystem::Instance(), lldb_private::PostMortemProcess::m_core_file, and m_core_module_sp.
|
protected |
Definition at line 453 of file ProcessElfCore.cpp.
References lldb_private::ThreadList::Clear(), lldb_private::Process::m_thread_list, and lldb_private::Process::SetUnixSignals().
Referenced by ~ProcessElfCore().
|
static |
Definition at line 50 of file ProcessElfCore.cpp.
References lldb_private::FileSystem::CreateDataBuffer(), elf::ELFHeader::e_ident, elf::ELFHeader::e_type, elf::ELFHeader::e_version, lldb::eByteOrderLittle, lldb_private::FileSpec::GetPath(), lldb_private::FileSystem::Instance(), elf::ELFHeader::MagicBytesMatch(), and elf::ELFHeader::Parse().
Referenced by Initialize(), and Terminate().
|
overridevirtual |
Implements lldb_private::Process.
Definition at line 307 of file ProcessElfCore.cpp.
|
overrideprotectedvirtual |
DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has removed non address bits from load_addr.
Override this method in subclasses of Process.
See GetMemoryRegionInfo for details of the logic.
[in] | load_addr | The load address to query the range_info for. (non address bits removed) |
[out] | range_info | An range_info value containing the details of the range. |
Reimplemented from lldb_private::Process.
Definition at line 324 of file ProcessElfCore.cpp.
References lldb_private::MemoryRegionInfo::Clear(), lldb_private::Range< B, S >::Contains(), lldb_private::RangeData< B, S, T >::data, lldb_private::MemoryRegionInfo::eNo, lldb_private::MemoryRegionInfo::eYes, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryStartsAt(), lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContainsOrFollows(), lldb_private::MemoryRegionInfo::GetRange(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), LLDB_INVALID_ADDRESS, m_core_range_infos, m_core_tag_ranges, lldb_private::MemoryRegionInfo::SetExecutable(), lldb_private::MemoryRegionInfo::SetMapped(), lldb_private::MemoryRegionInfo::SetMemoryTagged(), lldb_private::Range< B, S >::SetRangeBase(), lldb_private::Range< B, S >::SetRangeEnd(), lldb_private::MemoryRegionInfo::SetReadable(), lldb_private::MemoryRegionInfo::SetWritable(), and lldb_private::Flags::Test().
|
overridevirtual |
Walk through segments and Thread and Address Map information. PT_NOTE - Contains Thread and Register information PT_LOAD - Contains a contiguous range of Process Address Space PT_AARCH64_MEMTAG_MTE - Contains AArch64 MTE memory tags for a range of Process Address Space.
Reimplemented from lldb_private::Process.
Definition at line 160 of file ProcessElfCore.cpp.
References AddAddressRangeFromLoadSegment(), AddAddressRangeFromMemoryTagSegment(), lldb_private::UnixSignals::Create(), lldb_private::eLoadDependentsNo, error(), lldb_private::ModuleSpec::GetArchitecture(), GetArchitecture(), lldb_private::Target::GetArchitecture(), lldb_private::Target::GetExecutableModule(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::Target::GetOrCreateModule(), ObjectFileELF::GetSegmentData(), lldb_private::Process::GetTarget(), lldb_private::Process::GetUnixSignals(), lldb_private::ModuleSpec::GetUUID(), m_core_aranges, m_core_module_sp, m_core_range_infos, m_core_tag_ranges, m_nt_file_entries, m_thread_data, m_thread_data_valid, lldb_private::ArchSpec::MergeFrom(), ParseThreadContextsFromNoteSegment(), ObjectFileELF::ProgramHeaders(), lldb_private::Target::SetArchitecture(), lldb_private::Process::SetCanJIT(), lldb_private::Target::SetExecutableModule(), lldb_private::FileSpec::SetFile(), lldb_private::Process::SetUnixSignals(), lldb_private::RangeDataVector< B, S, T, N, Compare >::Sort(), and UpdateBuildIdForNTFileEntries().
Referenced by GetNumThreadContexts().
|
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.
[in] | vm_addr | A virtual load address that indicates where to start reading memory from. |
[in] | size | The number of bytes to read. |
[out] | buf | A byte buffer that is at least size bytes long that will receive the memory bytes. |
[out] | error | An 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. |
Implements lldb_private::Process.
Definition at line 375 of file ProcessElfCore.cpp.
References lldb_private::ObjectFile::CopyData(), lldb_private::RangeData< B, S, T >::data, error(), lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContains(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), m_core_aranges, and m_core_module_sp.
Referenced by ReadMemory().
|
overrideprotectedvirtual |
Update the thread list following process plug-in's specific logic.
This method should only be invoked by UpdateThreadList.
Implements lldb_private::Process.
Definition at line 291 of file ProcessElfCore.cpp.
References lldb_private::ThreadCollection::AddThread(), GetNumThreadContexts(), lldb_private::ThreadList::GetSize(), m_thread_data, and m_thread_data_valid.
|
private |
Definition at line 996 of file ProcessElfCore.cpp.
References elf::ELFHeader::e_phentsize, elf::ELFHeader::e_phnum, elf::ELFHeader::e_phoff, error(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), elf::ELFHeader::MagicBytesMatch(), elf::ELFProgramHeader::p_memsz, elf::ELFProgramHeader::p_type, elf::ELFProgramHeader::p_vaddr, elf::ELFProgramHeader::Parse(), elf::ELFHeader::Parse(), parseSegment(), and ReadMemory().
Referenced by UpdateBuildIdForNTFileEntries().
ArchSpec ProcessElfCore::GetArchitecture | ( | ) |
Definition at line 1063 of file ProcessElfCore.cpp.
References lldb_private::Target::GetArchitecture(), lldb_private::Process::GetTarget(), lldb_private::ArchSpec::IsMIPS(), m_core_module_sp, and lldb_private::ArchSpec::MergeFrom().
Referenced by ThreadElfCore::CreateRegisterContextForFrame(), DoLoadCore(), GetProcessInfo(), parseFreeBSDNotes(), parseLinuxNotes(), parseNetBSDNotes(), ParseThreadContextsFromNoteSegment(), and RegisterContextCorePOSIX_arm64::RegisterContextCorePOSIX_arm64().
|
overridevirtual |
Reimplemented from lldb_private::Process.
Definition at line 1079 of file ProcessElfCore.cpp.
References lldb_private::Process::GetAddressByteSize(), lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::DataExtractor::GetByteSize(), and m_auxv.
Referenced by RegisterContextCorePOSIX_arm64::RegisterContextCorePOSIX_arm64().
|
overridevirtual |
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 284 of file ProcessElfCore.cpp.
References lldb_private::DynamicLoader::FindPlugin(), DynamicLoaderPOSIXDYLD::GetPluginNameStatic(), and lldb_private::Process::m_dyld_up.
|
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.
Reimplemented from lldb_private::Process.
Definition at line 468 of file ProcessElfCore.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.
|
private |
Definition at line 1057 of file ProcessElfCore.cpp.
References DoLoadCore(), m_thread_data, and m_thread_data_valid.
Referenced by DoUpdateThreadList().
|
static |
Definition at line 42 of file ProcessElfCore.cpp.
Referenced by Initialize().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 62 of file ProcessElfCore.h.
References GetPluginNameStatic().
Referenced by WillResume().
|
inlinestatic |
Definition at line 42 of file ProcessElfCore.h.
Referenced by GetPluginName(), and Initialize().
|
overridevirtual |
Reimplemented from lldb_private::Process.
Definition at line 1086 of file ProcessElfCore.cpp.
References lldb_private::ProcessInstanceInfo::Clear(), GetArchitecture(), lldb_private::Target::GetExecutableModule(), lldb_private::Process::GetID(), lldb_private::Process::GetTarget(), lldb_private::ProcessInfo::SetArchitecture(), lldb_private::ProcessInfo::SetExecutableFile(), and lldb_private::ProcessInfo::SetProcessID().
|
static |
Definition at line 459 of file ProcessElfCore.cpp.
References CreateInstance(), GetPluginDescriptionStatic(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
|
overridevirtual |
Check if a process is still alive.
Reimplemented from lldb_private::Process.
Definition at line 311 of file ProcessElfCore.cpp.
|
private |
Definition at line 603 of file ProcessElfCore.cpp.
References GetArchitecture(), lldb_private::DataExtractor::GetByteSize(), lldb_private::ArchSpec::GetMachine(), ThreadData::gpregset, m_auxv, m_thread_data, ThreadData::name, ThreadData::notes, ParseFreeBSDPrPsInfo(), and ParseFreeBSDPrStatus().
Referenced by ParseThreadContextsFromNoteSegment().
|
private |
A description of a linux process usually contains the following NOTE entries:
Additionally, for each thread in the process the core file will contain at least the NT_PRSTATUS note, containing the thread id and general purpose registers. It may include additional notes for other register sets (floating point and vector registers, ...). The tricky part here is that some of these notes have "CORE" in their owner fields, while other set it to "LINUX".
Definition at line 884 of file ProcessElfCore.cpp.
References ThreadData::code, ProcessElfCore::NT_FILE_Entry::end, lldb_private::Status::Fail(), ProcessElfCore::NT_FILE_Entry::file_ofs, GetArchitecture(), lldb_private::DataExtractor::GetByteSize(), ELFLinuxPrStatus::GetSize(), ThreadData::gpregset, m_auxv, m_nt_file_entries, m_thread_data, ThreadData::name, ThreadData::notes, ELFLinuxPrStatus::Parse(), ELFLinuxSigInfo::Parse(), ELFLinuxPrPsInfo::Parse(), ELFLinuxPrStatus::pr_cursig, ELFLinuxPrPsInfo::pr_fname, ELFLinuxPrStatus::pr_pid, ELFLinuxPrPsInfo::pr_pid, ThreadData::prstatus_sig, lldb_private::Process::SetID(), ELFLinuxSigInfo::si_code, ELFLinuxSigInfo::si_signo, ThreadData::signo, ProcessElfCore::NT_FILE_Entry::start, ThreadData::tid, and lldb_private::Status::ToError().
Referenced by ParseThreadContextsFromNoteSegment().
|
private |
NetBSD specific Thread context from PT_NOTE segment.
NetBSD ELF core files use notes to provide information about the process's state. The note name is "NetBSD-CORE" for information that is global to the process, and "NetBSD-CORE@nn", where "nn" is the lwpid of the LWP that the information belongs to (such as register state).
NetBSD uses the following note identifiers:
ELF_NOTE_NETBSD_CORE_PROCINFO (value 1) Note is a "netbsd_elfcore_procinfo" structure. ELF_NOTE_NETBSD_CORE_AUXV (value 2; since NetBSD 8.0) Note is an array of AuxInfo structures.
NetBSD also uses ptrace(2) request numbers (the ones that exist in machine-dependent space) to identify register info notes. The info in such notes is in the same format that ptrace(2) would export that information.
For more information see /usr/include/sys/exec_elf.h
Definition at line 680 of file ProcessElfCore.cpp.
References error(), GetArchitecture(), lldb_private::DataExtractor::GetByteSize(), ThreadData::gpregset, m_auxv, m_thread_data, ThreadData::notes, lldb_private::NETBSD::NT_AUXV, lldb_private::NETBSD::AARCH64::NT_FPREGS, lldb_private::NETBSD::AMD64::NT_FPREGS, lldb_private::NETBSD::I386::NT_FPREGS, lldb_private::NETBSD::NT_PROCINFO, lldb_private::NETBSD::AARCH64::NT_REGS, lldb_private::NETBSD::AMD64::NT_REGS, lldb_private::NETBSD::I386::NT_REGS, ParseNetBSDProcInfo(), lldb_private::Process::SetID(), and ThreadData::tid.
Referenced by ParseThreadContextsFromNoteSegment().
|
private |
Definition at line 840 of file ProcessElfCore.cpp.
References lldb_private::DataExtractor::GetByteSize(), ThreadData::gpregset, m_auxv, m_thread_data, ThreadData::notes, lldb_private::OPENBSD::NT_AUXV, lldb_private::OPENBSD::NT_PROCINFO, lldb_private::OPENBSD::NT_REGS, and ParseOpenBSDProcInfo().
Referenced by ParseThreadContextsFromNoteSegment().
|
private |
Definition at line 583 of file ProcessElfCore.cpp.
References lldb_private::DataExtractor::GetByteSize(), ELFNote::n_descsz, and ELFNote::Parse().
Referenced by FindBuidIdInCoreMemory(), and ParseThreadContextsFromNoteSegment().
|
private |
Parse Thread context from PT_NOTE segment and store it in the thread list A note segment consists of one or more NOTE entries, but their types and meaning differ depending on the OS.
Definition at line 972 of file ProcessElfCore.cpp.
References GetArchitecture(), elf::ELFProgramHeader::p_type, parseFreeBSDNotes(), parseLinuxNotes(), parseNetBSDNotes(), parseOpenBSDNotes(), and parseSegment().
Referenced by DoLoadCore().
|
overridevirtual |
Read of memory from a process.
This function will read memory from the current process's address space and remove any traps that may have been inserted into the memory.
This function is not meant to be overridden by Process subclasses, the subclasses should implement Process::DoReadMemory (lldb::addr_t, size_t, void *).
[in] | vm_addr | A virtual load address that indicates where to start reading memory from. |
[out] | buf | A byte buffer that is at least size bytes long that will receive the memory bytes. |
[in] | size | The number of bytes to read. |
[out] | error | An 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. |
Reimplemented from lldb_private::Process.
Definition at line 314 of file ProcessElfCore.cpp.
References DoReadMemory(), error(), and lldb_private::Process::GetABI().
Referenced by FindBuidIdInCoreMemory().
|
overridevirtual |
Read memory tags for the range addr to addr+len.
It is assumed that this range has already been granule aligned. (see MemoryTagManager::MakeTaggedRange)
This calls DoReadMemoryTags to do the target specific operations.
[in] | addr | Start of memory range to read tags for. |
[in] | len | Length of memory range to read tags for (in bytes). |
Reimplemented from lldb_private::Process.
Definition at line 422 of file ProcessElfCore.cpp.
References lldb_private::ObjectFile::CopyData(), lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContains(), lldb_private::Process::GetMemoryTagManager(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), m_core_module_sp, m_core_tag_ranges, and lldb_private::MemoryTagManager::UnpackTagsFromCoreFileSegment().
|
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 305 of file ProcessElfCore.cpp.
|
inlineoverrideprotectedvirtual |
Check whether the process supports memory tagging.
Reimplemented from lldb_private::Process.
Definition at line 112 of file ProcessElfCore.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::IsEmpty(), and m_core_tag_ranges.
|
static |
Definition at line 46 of file ProcessElfCore.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
private |
Definition at line 278 of file ProcessElfCore.cpp.
References FindBuidIdInCoreMemory(), and m_nt_file_entries.
Referenced by DoLoadCore().
|
inlineoverridevirtual |
Before lldb detaches from a process, it warns the user that they are about to lose their debug session.
In some cases, this warning doesn't need to be emitted – for instance, with core file debugging where the user can reconstruct the "state" by simply re-running the debugger on the core file.
Reimplemented from lldb_private::Process.
Definition at line 79 of file ProcessElfCore.h.
|
inlineoverridevirtual |
Called before resuming to a process.
Allow Process plug-ins to execute some code before resuming a process.
Reimplemented from lldb_private::Process.
Definition at line 69 of file ProcessElfCore.h.
References error(), and GetPluginName().
|
private |
Definition at line 143 of file ProcessElfCore.h.
Referenced by GetAuxvData(), parseFreeBSDNotes(), parseLinuxNotes(), parseNetBSDNotes(), and parseOpenBSDNotes().
|
private |
Definition at line 146 of file ProcessElfCore.h.
Referenced by AddAddressRangeFromLoadSegment(), DoLoadCore(), and DoReadMemory().
|
private |
Definition at line 133 of file ProcessElfCore.h.
Referenced by CanDebug(), DoLoadCore(), DoReadMemory(), GetArchitecture(), and ReadMemoryTags().
|
private |
Definition at line 149 of file ProcessElfCore.h.
Referenced by AddAddressRangeFromLoadSegment(), DoGetMemoryRegionInfo(), and DoLoadCore().
|
private |
Definition at line 152 of file ProcessElfCore.h.
Referenced by AddAddressRangeFromMemoryTagSegment(), DoGetMemoryRegionInfo(), DoLoadCore(), ReadMemoryTags(), and SupportsMemoryTagging().
|
private |
Definition at line 134 of file ProcessElfCore.h.
|
private |
Definition at line 155 of file ProcessElfCore.h.
Referenced by DoLoadCore(), parseLinuxNotes(), and UpdateBuildIdForNTFileEntries().
|
private |
Definition at line 140 of file ProcessElfCore.h.
Referenced by DoLoadCore(), DoUpdateThreadList(), GetNumThreadContexts(), parseFreeBSDNotes(), parseLinuxNotes(), parseNetBSDNotes(), and parseOpenBSDNotes().
|
private |
Definition at line 137 of file ProcessElfCore.h.
Referenced by DoLoadCore(), DoUpdateThreadList(), and GetNumThreadContexts().