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/SBFileSpec.cpp | |
| parent | 31575f758c4defb5bf7b54cbf0238e414ff4e3b3 (diff) | |
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/SBFileSpec.cpp')
| -rw-r--r-- | lldb/source/API/SBFileSpec.cpp | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp index a4fda531cdb2..3fc6a3ad04e4 100644 --- a/lldb/source/API/SBFileSpec.cpp +++ b/lldb/source/API/SBFileSpec.cpp @@ -34,7 +34,7 @@ SBFileSpec::SBFileSpec (const SBFileSpec &rhs) : { SBStream sstr; GetDescription (sstr); - log->Printf ("SBFileSpec::SBFileSpec (const SBFileSpec rhs.ap=%p) => this.ap = %p ('%s')", + log->Printf ("SBFileSpec::SBFileSpec (const SBFileSpec rhs.ap=%p) => SBFileSpec(%p) ('%s')", rhs.m_opaque_ap.get(), m_opaque_ap.get(), sstr.GetData()); } } @@ -51,8 +51,8 @@ SBFileSpec::SBFileSpec (const char *path, bool resolve) : Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); if (log) - log->Printf ("SBFileSpec::SBFileSpec (path='%s', resolve='%s') => this.ap = %p", path, - (resolve ? "true" : "false"), m_opaque_ap.get()); + log->Printf ("SBFileSpec::SBFileSpec (path='%s', resolve=%i) => SBFileSpec(%p)", path, + resolve, m_opaque_ap.get()); } SBFileSpec::~SBFileSpec () @@ -81,15 +81,12 @@ SBFileSpec::Exists () const { Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); - //if (log) - // log->Printf ("SBFileSpec::Exists (this.ap=%p)", m_opaque_ap.get()); - bool result = false; if (m_opaque_ap.get()) result = m_opaque_ap->Exists(); if (log) - log->Printf ("SBFileSpec::Exists (this.ap=%p) => %s", m_opaque_ap.get(), (result ? "true" : "false")); + log->Printf ("SBFileSpec(%p)::Exists () => %s", m_opaque_ap.get(), (result ? "true" : "false")); return result; } @@ -113,20 +110,17 @@ SBFileSpec::GetFilename() const { Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); - //if (log) - // log->Printf ("SBFileSpec::GetFilename (this.ap=%p)", m_opaque_ap.get()); - if (m_opaque_ap.get()) { if (log) - log->Printf ("SBFileSpec::GetFilename (this.ap=%p) => %s", m_opaque_ap.get(), + log->Printf ("SBFileSpec(%p)::GetFilename () => %s", m_opaque_ap.get(), m_opaque_ap->GetFilename().AsCString()); return m_opaque_ap->GetFilename().AsCString(); } if (log) - log->Printf ("SBFileSpec::GetFilename (this.ap=%p) => NULL", m_opaque_ap.get()); + log->Printf ("SBFileSpec(%p)::GetFilename () => NULL", m_opaque_ap.get()); return NULL; } @@ -144,21 +138,18 @@ SBFileSpec::GetPath (char *dst_path, size_t dst_len) const { Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); - //if (log) - // log->Printf ("SBFileSpec::GetPath (dst_path, dst_len)"); - uint32_t result; if (m_opaque_ap.get()) { result = m_opaque_ap->GetPath (dst_path, dst_len); if (log) - log->Printf ("SBFileSpec::GetPath (this.ap=%p, dst_path, dst_len) => dst_path='%s', dst_len='%d', " + log->Printf ("SBFileSpec(%p)::GetPath (dst_path, dst_len) => dst_path='%s', dst_len='%d', " "result='%d'", m_opaque_ap.get(), dst_path, (uint32_t) dst_len, result); return result; } if (log) - log->Printf ("SBFileSpec::GetPath (this.ap=%p, dst_path, dst_len) => NULL (0)", m_opaque_ap.get()); + log->Printf ("SBFileSpec(%p)::GetPath (dst_path, dst_len) => NULL (0)", m_opaque_ap.get()); if (dst_path && dst_len) *dst_path = '\0'; @@ -202,26 +193,6 @@ SBFileSpec::SetFileSpec (const lldb_private::FileSpec& fs) } bool -SBFileSpec::GetDescription (SBStream &description) -{ - if (m_opaque_ap.get()) - { - const char *filename = GetFilename(); - const char *dir_name = GetDirectory(); - if (!filename && !dir_name) - description.Printf ("No value"); - else if (!dir_name) - description.Printf ("%s", filename); - else - description.Printf ("%s/%s", dir_name, filename); - } - else - description.Printf ("No value"); - - return true; -} - -bool SBFileSpec::GetDescription (SBStream &description) const { if (m_opaque_ap.get()) |
