diff options
Diffstat (limited to 'lldb/scripts/Python/interface/SBProcess.i')
-rw-r--r-- | lldb/scripts/Python/interface/SBProcess.i | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBProcess.i b/lldb/scripts/Python/interface/SBProcess.i index b2ab9231a26..920aefb4c80 100644 --- a/lldb/scripts/Python/interface/SBProcess.i +++ b/lldb/scripts/Python/interface/SBProcess.i @@ -208,6 +208,57 @@ public: size_t WriteMemory (addr_t addr, const void *buf, size_t size, lldb::SBError &error); + %feature("autodoc", " + Reads a NULL terminated C string from the current process's address space. + It returns a python string of the exact length, or truncates the string if + the maximum character limit is reached. Example: + + # Read a C string of at most 256 bytes from address '0x1000' + error = lldb.SBError() + cstring = process.ReadMemory(0x1000, 256, error) + if error.Success(): + print 'cstring: ', cstring + else + print 'error: ', error + ") ReadCStringFromMemory; + + size_t + ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error); + + %feature("autodoc", " + Reads an unsigned integer from memory given a byte size and an address. + Returns the unsigned integer that was read. Example: + + # Read a 4 byte unsigned integer from address 0x1000 + error = lldb.SBError() + uint = ReadUnsignedFromMemory(0x1000, 4, error) + if error.Success(): + print 'integer: %u' % uint + else + print 'error: ', error + + ") ReadUnsignedFromMemory; + + uint64_t + ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error); + + %feature("autodoc", " + Reads a pointer from memory from an address and returns the value. Example: + + # Read a pointer from address 0x1000 + error = lldb.SBError() + ptr = ReadPointerFromMemory(0x1000, error) + if error.Success(): + print 'pointer: 0x%x' % ptr + else + print 'error: ', error + + ") ReadPointerFromMemory; + + lldb::addr_t + ReadPointerFromMemory (addr_t addr, lldb::SBError &error); + + // Events static lldb::StateType GetStateFromEvent (const lldb::SBEvent &event); |