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
This commit is contained in:
Johnny Chen
2011-04-01 00:35:55 +00:00
parent 95bf0fd3ab
commit df2963ed46
3 changed files with 124 additions and 0 deletions

View File

@@ -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
{