diff options
author | Matthew Gardiner <mg11@csr.com> | 2014-10-22 07:22:56 +0000 |
---|---|---|
committer | Matthew Gardiner <mg11@csr.com> | 2014-10-22 07:22:56 +0000 |
commit | c928de3e8e95ab02418720b765b2342123ade5b8 (patch) | |
tree | be7a7544734d5488eb64d096f0558f61a84a7e03 /lldb/scripts/Python/interface/SBTarget.i | |
parent | 0cf39569bf9e58db2d975fb06d1f94fcd2c648ee (diff) | |
download | bcm5719-llvm-c928de3e8e95ab02418720b765b2342123ade5b8.tar.gz bcm5719-llvm-c928de3e8e95ab02418720b765b2342123ade5b8.zip |
Added functions to the C++ API, for the benefit of non-8-bit byte architectures.
New functions to give client applications to tools to discover target byte sizes
for addresses prior to ReadMemory. Also added GetPlatform and ReadMemory to the
SBTarget class, since they seemed to be useful utilities to have.
Each new API has had a test case added.
http://reviews.llvm.org/D5867
llvm-svn: 220372
Diffstat (limited to 'lldb/scripts/Python/interface/SBTarget.i')
-rw-r--r-- | lldb/scripts/Python/interface/SBTarget.i | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i index 345929a80dc..7a0096c41e3 100644 --- a/lldb/scripts/Python/interface/SBTarget.i +++ b/lldb/scripts/Python/interface/SBTarget.i @@ -282,6 +282,21 @@ public: lldb::SBProcess GetProcess (); + + %feature("docstring", " + //------------------------------------------------------------------ + /// Return the platform object associated with the target. + /// + /// After return, the platform object should be checked for + /// validity. + /// + /// @return + /// A platform object. + //------------------------------------------------------------------ + ") GetPlatform; + lldb::SBPlatform + GetPlatform (); + %feature("docstring", " //------------------------------------------------------------------ /// Install any binaries that need to be installed. @@ -579,6 +594,30 @@ public: const char * GetTriple (); + %feature("docstring", " + //------------------------------------------------------------------ + /// Architecture data byte width accessor + /// + /// @return + /// The size in 8-bit (host) bytes of a minimum addressable + /// unit from the Architecture's data bus + //------------------------------------------------------------------ + ") GetDataByteSize; + uint32_t + GetDataByteSize (); + + %feature("docstring", " + //------------------------------------------------------------------ + /// Architecture code byte width accessor + /// + /// @return + /// The size in 8-bit (host) bytes of a minimum addressable + /// unit from the Architecture's code bus + //------------------------------------------------------------------ + ") GetCodeByteSize; + uint32_t + GetCodeByteSize (); + lldb::SBError SetSectionLoadAddress (lldb::SBSection section, lldb::addr_t section_base_addr); @@ -676,6 +715,19 @@ public: void Clear (); + %feature("docstring", " + //------------------------------------------------------------------ + /// Resolve a current file address into a section offset address. + /// + /// @param[in] file_addr + /// + /// @return + /// An SBAddress which will be valid if... + //------------------------------------------------------------------ + ") ResolveFileAddress; + lldb::SBAddress + ResolveFileAddress (lldb::addr_t file_addr); + lldb::SBAddress ResolveLoadAddress (lldb::addr_t vm_addr); @@ -686,6 +738,33 @@ public: ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope); + %feature("docstring", " + //------------------------------------------------------------------ + /// Read target memory. If a target process is running then memory + /// is read from here. Otherwise the memory is read from the object + /// files. For a target whose bytes are sized as a multiple of host + /// bytes, the data read back will preserve the target's byte order. + /// + /// @param[in] addr + /// A target address to read from. + /// + /// @param[out] buf + /// The buffer to read memory into. + /// + /// @param[in] size + /// The maximum number of host bytes to read in the buffer passed + /// into this call + /// + /// @param[out] error + /// Error information is written here if the memory read fails. + /// + /// @return + /// The amount of data read in host bytes. + //------------------------------------------------------------------ + ") ReadMemory; + size_t + ReadMemory (const SBAddress addr, void *buf, size_t size, lldb::SBError &error); + lldb::SBBreakpoint BreakpointCreateByLocation (const char *file, uint32_t line); @@ -904,6 +983,15 @@ public: __swig_getmethods__["triple"] = GetTriple if _newclass: triple = property(GetTriple, None, doc='''A read only property that returns the target triple (arch-vendor-os) for this target as a string.''') + + __swig_getmethods__["data_byte_size"] = GetDataByteSize + if _newclass: addr_size = property(GetDataByteSize, None, doc='''A read only property that returns the size in host bytes of a byte in the data address space for this target.''') + + __swig_getmethods__["code_byte_size"] = GetCodeByteSize + if _newclass: addr_size = property(GetCodeByteSize, None, doc='''A read only property that returns the size in host bytes of a byte in the code address space for this target.''') + + __swig_getmethods__["platform"] = GetPlatform + if _newclass: platform = property(GetPlatform, None, doc='''A read only property that returns the platform associated with with this target.''') %} }; |