aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-01-29 06:07:39 +0000
committerGreg Clayton <gclayton@apple.com>2012-01-29 06:07:39 +0000
commit13d1950ae6eaf579cbecab1c0515d58f5fa2b648 (patch)
tree082fa177e8ac54f51cf9cec03db79f892dd39985 /lldb/source/API/SBModule.cpp
parent6e1c0123855f6eacda37bd2c1bd9b29c8c99c1cb (diff)
downloadllvm-13d1950ae6eaf579cbecab1c0515d58f5fa2b648.zip
llvm-13d1950ae6eaf579cbecab1c0515d58f5fa2b648.tar.gz
llvm-13d1950ae6eaf579cbecab1c0515d58f5fa2b648.tar.bz2
Added the ability to get the target triple, byte order and address byte size
from the SBTarget and SBModule interfaces. Also added many python properties for easier access to many things from many SB objects. llvm-svn: 149191
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index ea893df..0c1307c 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -475,3 +475,34 @@ SBModule::FindSection (const char *sect_name)
return sb_section;
}
+lldb::ByteOrder
+SBModule::GetByteOrder ()
+{
+ if (m_opaque_sp)
+ return m_opaque_sp->GetArchitecture().GetByteOrder();
+ return eByteOrderInvalid;
+}
+
+const char *
+SBModule::GetTriple ()
+{
+ if (m_opaque_sp)
+ {
+ std::string triple (m_opaque_sp->GetArchitecture().GetTriple().str());
+ // Unique the string so we don't run into ownership issues since
+ // the const strings put the string into the string pool once and
+ // the strings never comes out
+ ConstString const_triple (triple.c_str());
+ return const_triple.GetCString();
+ }
+ return NULL;
+}
+
+uint32_t
+SBModule::GetAddressByteSize()
+{
+ if (m_opaque_sp)
+ return m_opaque_sp->GetArchitecture().GetAddressByteSize();
+ return sizeof(void*);
+}
+