summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-01 00:35:55 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-01 00:35:55 +0000
commitdf2963ed46ee860c28b3c3b20cb3d2f1ad2637e7 (patch)
tree018bd852712bcbfea39dfc0b32acbd52855bf36a /lldb/source/API/SBModule.cpp
parent95bf0fd3abcefce429f40f875f0f9ae3b0deed9e (diff)
downloadbcm5719-llvm-df2963ed46ee860c28b3c3b20cb3d2f1ad2637e7.tar.gz
bcm5719-llvm-df2963ed46ee860c28b3c3b20cb3d2f1ad2637e7.zip
Add TestSymbolAPI.py to test the newly added SBSymbol and SBAddress APIs:
lldb::SymbolType SBSymbol::GetType(); lldb::SectionType SBAddress::GetSectionType (); lldb::SBModule SBAddress::GetModule (); Also add an lldb::SBModule::GetUUIDString() API which is easier for Python to work with in the test script. llvm-svn: 128695
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 0a5c8aaacc3..e7e95be1e8b 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -95,6 +95,31 @@ SBModule::GetUUIDBytes () const
}
+const char *
+SBModule::GetUUIDString () const
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ static char uuid_string[80];
+ const char * uuid_c_string = NULL;
+ if (m_opaque_sp)
+ uuid_c_string = (const char *)m_opaque_sp->GetUUID().GetAsCString(uuid_string, sizeof(uuid_string));
+
+ if (log)
+ {
+ if (uuid_c_string)
+ {
+ StreamString s;
+ m_opaque_sp->GetUUID().Dump (&s);
+ log->Printf ("SBModule(%p)::GetUUIDString () => %s", m_opaque_sp.get(), s.GetData());
+ }
+ else
+ log->Printf ("SBModule(%p)::GetUUIDString () => NULL", m_opaque_sp.get());
+ }
+ return uuid_c_string;
+}
+
+
bool
SBModule::operator == (const SBModule &rhs) const
{
OpenPOWER on IntegriCloud