DebugServer2
Loading...
Searching...
No Matches
ds2::Target::Darwin::Process Class Reference
Inheritance diagram for ds2::Target::Darwin::Process:
Collaboration diagram for ds2::Target::Darwin::Process:

Public Member Functions

ErrorCode terminate () override
 
ErrorCode suspend () override
 
ErrorCode getMemoryRegionInfo (Address const &address, MemoryRegionInfo &info) override
 
ErrorCode allocateMemory (size_t size, uint32_t protection, uint64_t *address) override
 
ErrorCode deallocateMemory (uint64_t address, size_t size) override
 
ErrorCode readString (Address const &address, std::string &str, size_t length, size_t *count=nullptr) override
 
ErrorCode readMemory (Address const &address, void *data, size_t length, size_t *count=nullptr) override
 
ErrorCode writeMemory (Address const &address, void const *data, size_t length, size_t *count=nullptr) override
 
ErrorCode wait () override
 
Host::POSIX::PTrace & ptrace () const override
 
ErrorCode afterResume () override
 
- Public Member Functions inherited from ds2::Target::Darwin::MachOProcess
ErrorCode getAuxiliaryVector (std::string &auxv) override
 
uint64_t getAuxiliaryVectorValue (uint64_t type) override
 
virtual ErrorCode getSharedLibraryInfoAddress (Address &address)
 
ErrorCode enumerateSharedLibraries (std::function< void(SharedLibraryInfo const &)> const &cb) override
 
Host::Darwin::Mach & mach ()
 
- Public Member Functions inherited from ds2::Target::POSIX::Process
ErrorCode detach (bool stopped) override
 
ErrorCode interrupt () override
 
ErrorCode terminate () override
 
bool isAlive () const override
 
ErrorCode readString (Address const &address, std::string &str, size_t length, size_t *count=nullptr) override
 
ErrorCode readMemory (Address const &address, void *data, size_t length, size_t *count=nullptr) override
 
ErrorCode writeMemory (Address const &address, void const *data, size_t length, size_t *count=nullptr) override
 
void resetSignalPass ()
 
void setSignalPass (int signo, bool set)
 
ErrorCode wait () override
 
- Public Member Functions inherited from ds2::Target::ProcessBase
ProcessId pid () const
 
bool attached () const
 
bool hasExtension (Extension extension) const
 
uint32_t enabledExtensions () const
 
bool forkEventsEnabled () const
 
bool vforkEventsEnabled () const
 
void setEnabledExtensions (uint32_t extensions)
 
void setForkEventsEnabled (bool fork, bool vfork)
 
Address const & loadBase () const
 
Address const & entryPoint () const
 
Thread * currentThread () const
 
Thread * thread (ThreadId tid) const
 
virtual ErrorCode getInfo (ProcessInfo &info)
 
virtual ErrorCode resume (int signal=0, std::set< Thread * > const &excluded=std::set< Thread * >())
 
virtual ErrorCode enumerateThreads (std::function< void(Thread *)> const &cb) const
 
virtual ErrorCode enumerateMappedFiles (std::function< void(MappedFileInfo const &)> const &cb)
 
ErrorCode readMemoryBuffer (Address const &address, size_t length, ByteVector &buffer)
 
ErrorCode writeMemoryBuffer (Address const &address, ByteVector const &buffer, size_t *nwritten=nullptr)
 
ErrorCode writeMemoryBuffer (Address const &address, ByteVector const &buffer, size_t length, size_t *nwritten=nullptr)
 
virtual void getThreadIds (std::vector< ThreadId > &tids)
 
virtual SoftwareBreakpointManager * softwareBreakpointManager () const final
 
virtual HardwareBreakpointManager * hardwareBreakpointManager () const final
 
virtual void prepareForDetach ()
 
virtual ErrorCode beforeResume ()
 
virtual int getMaxBreakpoints () const
 
virtual int getMaxWatchpoints () const
 
virtual int getMaxWatchpointSize () const
 
virtual Architecture::GDBDescriptor const * getGDBRegistersDescriptor () const final
 
virtual Architecture::LLDBDescriptor const * getLLDBRegistersDescriptor () const final
 

Protected Member Functions

ErrorCode attach (int waitStatus) override
 
ErrorCode executeCode (ByteVector const &code, uint64_t &result)
 
ErrorCode updateInfo () override
 
ErrorCode updateAuxiliaryVector () override
 
ErrorCode readCPUState (ThreadId tid, Architecture::CPUState &state, uint32_t flags=0)
 
ErrorCode writeCPUState (ThreadId tid, Architecture::CPUState const &state, uint32_t flags=0)
 
- Protected Member Functions inherited from ds2::Target::Darwin::MachOProcess
- Protected Member Functions inherited from ds2::Target::POSIX::Process
ErrorCode initialize (ProcessId pid, uint32_t flags) override
 
ErrorCode sendInterrupt ()
 
bool checkInterrupt (ThreadId tid, int waitStatus)
 
int convertMemoryProtectionToPOSIX (uint32_t protection) const
 
uint32_t convertMemoryProtectionFromPOSIX (int POSIXProtection) const
 
- Protected Member Functions inherited from ds2::Target::ProcessBase
virtual void cleanup ()
 
virtual void insert (ThreadBase *thread)
 
virtual void remove (ThreadBase *thread)
 
virtual void removeThread (ThreadId tid)
 

Protected Attributes

Host::Darwin::PTrace _ptrace
 
- Protected Attributes inherited from ds2::Target::Darwin::MachOProcess
std::string _auxiliaryVector
 
Address _sharedLibraryInfoAddress
 
Host::Darwin::Mach _mach
 
- Protected Attributes inherited from ds2::Target::POSIX::Process
std::set< int > _passthruSignals
 
struct { 
 
   std::mutex   mutex 
 
   ProcessId   pid = 0 
 
} _interruptState 
 
- Protected Attributes inherited from ds2::Target::ProcessBase
bool _terminated
 
uint32_t _flags
 
uint32_t _enabledExtensions = 0
 
ProcessId _pid
 
ProcessInfo _info
 
Address _loadBase
 
Address _entryPoint
 
IdentityMap _threads
 
Thread * _currentThread
 
std::unique_ptr< SoftwareBreakpointManager > _softwareBreakpointManager
 
std::unique_ptr< HardwareBreakpointManager > _hardwareBreakpointManager
 

Friends

class Thread
 
class POSIX::Process
 

Additional Inherited Members

- Public Types inherited from ds2::Target::ProcessBase
enum  { kFlagNewProcess = (1 << 0) , kFlagAttachedProcess = (1 << 1) }
 
enum  Extension : uint32_t { kExtensionForkEvents = (1u << 0) , kExtensionVForkEvents = (1u << 1) }
 
typedef std::map< ThreadId, Thread * > IdentityMap
 
- Static Public Member Functions inherited from ds2::Target::POSIX::Process
static ds2::Target::Process * Create (Host::ProcessSpawner &spawner)
 
static ds2::Target::Process * Attach (ProcessId pid)
 
- Public Attributes inherited from ds2::Target::POSIX::Process

Member Function Documentation

◆ afterResume()

ErrorCode ds2::Target::Darwin::Process::afterResume ( )
overridevirtual

Reimplemented from ds2::Target::ProcessBase.

◆ allocateMemory()

ErrorCode ds2::Target::Darwin::Process::allocateMemory ( size_t size,
uint32_t protection,
uint64_t * address )
overridevirtual

◆ attach()

ErrorCode ds2::Target::Darwin::Process::attach ( int waitStatus)
overrideprotectedvirtual

◆ deallocateMemory()

ErrorCode ds2::Target::Darwin::Process::deallocateMemory ( uint64_t address,
size_t size )
overridevirtual

◆ getMemoryRegionInfo()

ErrorCode ds2::Target::Darwin::Process::getMemoryRegionInfo ( Address const & address,
MemoryRegionInfo & info )
overridevirtual

◆ ptrace()

ds2::Host::POSIX::PTrace & ds2::Target::Darwin::Process::ptrace ( ) const
overridevirtual

◆ readMemory()

ErrorCode ds2::Target::Darwin::Process::readMemory ( Address const & address,
void * data,
size_t length,
size_t * count = nullptr )
overridevirtual

◆ readString()

ErrorCode ds2::Target::Darwin::Process::readString ( Address const & address,
std::string & str,
size_t length,
size_t * count = nullptr )
overridevirtual

◆ suspend()

ErrorCode ds2::Target::Darwin::Process::suspend ( )
overridevirtual

Reimplemented from ds2::Target::ProcessBase.

◆ terminate()

ErrorCode ds2::Target::Darwin::Process::terminate ( )
overridevirtual

◆ updateAuxiliaryVector()

ErrorCode ds2::Target::Darwin::Process::updateAuxiliaryVector ( )
overrideprotectedvirtual

Reimplemented from ds2::Target::Darwin::MachOProcess.

◆ updateInfo()

ErrorCode ds2::Target::Darwin::Process::updateInfo ( )
overrideprotectedvirtual

Reimplemented from ds2::Target::Darwin::MachOProcess.

◆ wait()

ErrorCode ds2::Target::Darwin::Process::wait ( )
overridevirtual

◆ writeMemory()

ErrorCode ds2::Target::Darwin::Process::writeMemory ( Address const & address,
void const * data,
size_t length,
size_t * count = nullptr )
overridevirtual

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