diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-30 04:51:46 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-30 04:51:46 +0000 |
commit | 4838131baf832b78fc9d8df3d38b11ef56ce67d0 (patch) | |
tree | f1456c8ceb42bf81a72fc59727d7e8a87969a0ea /lldb/source/API/SBFileSpec.cpp | |
parent | 549a31cd3475ba74244f70cc29b8edb6c597e3ce (diff) | |
download | llvm-4838131baf832b78fc9d8df3d38b11ef56ce67d0.zip llvm-4838131baf832b78fc9d8df3d38b11ef56ce67d0.tar.gz llvm-4838131baf832b78fc9d8df3d38b11ef56ce67d0.tar.bz2 |
Improved API logging.
llvm-svn: 117772
Diffstat (limited to 'lldb/source/API/SBFileSpec.cpp')
-rw-r--r-- | lldb/source/API/SBFileSpec.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp index 3fc6a3a..9aa3f8a 100644 --- a/lldb/source/API/SBFileSpec.cpp +++ b/lldb/source/API/SBFileSpec.cpp @@ -108,29 +108,27 @@ SBFileSpec::ResolvePath (const char *src_path, char *dst_path, size_t dst_len) const char * SBFileSpec::GetFilename() const { - Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); - + const char *s = NULL; if (m_opaque_ap.get()) - { - if (log) - log->Printf ("SBFileSpec(%p)::GetFilename () => %s", m_opaque_ap.get(), - m_opaque_ap->GetFilename().AsCString()); - - return m_opaque_ap->GetFilename().AsCString(); - } + s = m_opaque_ap->GetFilename().AsCString(); + Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); if (log) - log->Printf ("SBFileSpec(%p)::GetFilename () => NULL", m_opaque_ap.get()); + log->Printf ("SBFileSpec(%p)::GetFilename () => \"%s\"", m_opaque_ap.get(), s ? s : ""); - return NULL; + return s; } const char * SBFileSpec::GetDirectory() const { + const char *s = NULL; if (m_opaque_ap.get()) - return m_opaque_ap->GetDirectory().AsCString(); - return NULL; + s = m_opaque_ap->GetDirectory().AsCString(); + Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); + if (log) + log->Printf ("SBFileSpec(%p)::GetDirectory () => \"%s\"", m_opaque_ap.get(), s ? s : ""); + return s; } uint32_t |