Allow a SBAddress to be created from a SBSection and an offset.
Changed the lldb.SBModule.section[<str>] property to return a single section.
Added a lldb.SBSection.addr property which returns an lldb.SBAddress object.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149755 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBAddress.cpp b/source/API/SBAddress.cpp
index 430e11a..7397588 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -103,6 +103,12 @@
m_opaque_ap.reset (new AddressImpl(*rhs.m_opaque_ap.get()));
}
+
+SBAddress::SBAddress (lldb::SBSection section, lldb::addr_t offset) :
+ m_opaque_ap(new AddressImpl (Address(section.GetSection(), offset)))
+{
+}
+
// Create an address by resolving a load address using the supplied target
SBAddress::SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target) :
m_opaque_ap()
@@ -142,6 +148,15 @@
}
void
+SBAddress::SetAddress (lldb::SBSection section, lldb::addr_t offset)
+{
+ Address &addr = ref();
+ addr.SetSection (section.GetSection());
+ addr.SetOffset (offset);
+}
+
+
+void
SBAddress::SetAddress (const Address *lldb_object_ptr)
{
if (lldb_object_ptr)