diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-29 04:59:35 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-29 04:59:35 +0000 |
commit | 93aa84e83b28fd32f370ac99d15ffa49d0f116a9 (patch) | |
tree | 2d787806911b85581db69b2d4299b2ac56f0a141 /lldb/source/API/SBValue.cpp | |
parent | 31575f758c4defb5bf7b54cbf0238e414ff4e3b3 (diff) | |
download | bcm5719-llvm-93aa84e83b28fd32f370ac99d15ffa49d0f116a9.tar.gz bcm5719-llvm-93aa84e83b28fd32f370ac99d15ffa49d0f116a9.zip |
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.
llvm-svn: 117641
Diffstat (limited to 'lldb/source/API/SBValue.cpp')
-rw-r--r-- | lldb/source/API/SBValue.cpp | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index ac818234389..e5476ff277c 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -48,8 +48,7 @@ SBValue::SBValue (const lldb::ValueObjectSP &value_sp) : { 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 @@ SBValue::GetName() { 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 @@ SBValue::GetDescription (SBStream &description) { 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"); |