Make the SBAddress class easier to use when using the public
API.
SBTarget changes include changing:
bool
SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr,
lldb::SBAddress& addr);
to be:
lldb::SBAddress
SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr);
SBAddress can how contruct itself using a load address and a target
which can be used to resolve the address:
SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target);
This will actually just call the new SetLoadAddress accessor:
void
SetLoadAddress (lldb::addr_t load_addr,
lldb::SBTarget &target);
This function will always succeed in making a SBAddress object
that can be used in API calls (even if "target" isn't valid).
If "target" is valid and there are sections currently loaded,
then it will resolve the address to a section offset address if
it can. Else an address with a NULL section and an offset that is
the "load_addr" that was passed in. We do this because a load address
might be from the heap or stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135770 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/interface/SBAddress.i b/scripts/Python/interface/SBAddress.i
index 83d624f..91b483b 100644
--- a/scripts/Python/interface/SBAddress.i
+++ b/scripts/Python/interface/SBAddress.i
@@ -50,6 +50,9 @@
SBAddress (const lldb::SBAddress &rhs);
+ // Create an address by resolving a load address using the supplied target
+ SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target);
+
~SBAddress ();
bool
@@ -64,6 +67,10 @@
addr_t
GetLoadAddress (const lldb::SBTarget &target) const;
+ void
+ SetLoadAddress (lldb::addr_t load_addr,
+ lldb::SBTarget &target);
+
bool
OffsetAddress (addr_t offset);