Modified the lldb_private::TypeList to use a std::multimap for quicker lookup
by type ID (the most common type of type lookup).
Changed the API logging a bit to always show the objects in the OBJECT(POINTER)
format so it will be easy to locate all instances of an object or references
to it when looking at logs.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117641 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index ac81823..e5476ff 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -48,8 +48,7 @@
{
SBStream sstr;
GetDescription (sstr);
- log->Printf ("SBValue::SBValue (value_sp=%p) => this.sp = %p (%s)",
- value_sp.get(), m_opaque_sp.get(), sstr.GetData());
+ log->Printf ("SBValue::SBValue (%p) => (%s)", m_opaque_sp.get(), sstr.GetData());
}
}
@@ -79,23 +78,15 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBValue::GetName ()");
+ if (log)
+ log->Printf ("SBValue::GetName () ptr=%p => '%s'",
+ m_opaque_sp.get(),
+ m_opaque_sp ? m_opaque_sp->GetName().AsCString() : "<invalid>");
if (IsValid())
- {
- if (log)
- log->Printf ("SBValue::GetName (this.sp=%p) => '%s'", m_opaque_sp.get(),
- m_opaque_sp->GetName().AsCString());
+ return m_opaque_sp->GetName().GetCString();
- return m_opaque_sp->GetName().AsCString();
- }
- else
- {
- if (log)
- log->Printf ("SBValue::GetName (this.sp=%p) ==> NULL", m_opaque_sp.get());
- return NULL;
- }
+ return NULL;
}
const char *
@@ -319,18 +310,21 @@
{
if (m_opaque_sp)
{
- const char *name = GetName();
- const char *type_name = GetTypeName ();
- size_t byte_size = GetByteSize ();
- uint32_t num_children = GetNumChildren ();
- bool is_stale = ValueIsStale ();
- description.Printf ("name: '%s', type: %s, size: %d", (name != NULL ? name : "<unknown name>"),
- (type_name != NULL ? type_name : "<unknown type name>"), (int) byte_size);
- if (num_children > 0)
- description.Printf (", num_children: %d", num_children);
-
- if (is_stale)
- description.Printf (" [value is stale]");
+ // Don't call all these APIs and cause more logging!
+// const char *name = GetName();
+// const char *type_name = GetTypeName ();
+// size_t byte_size = GetByteSize ();
+// uint32_t num_children = GetNumChildren ();
+// bool is_stale = ValueIsStale ();
+// description.Printf ("name: '%s', type: %s, size: %d", (name != NULL ? name : "<unknown name>"),
+// (type_name != NULL ? type_name : "<unknown type name>"), (int) byte_size);
+// if (num_children > 0)
+// description.Printf (", num_children: %d", num_children);
+//
+// if (is_stale)
+// description.Printf (" [value is stale]");
+
+ description.Printf ("name: '%s'", m_opaque_sp->GetName().GetCString());
}
else
description.Printf ("No value");