diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-05-06 10:21:11 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-05-06 10:21:11 +0000 |
commit | db7d11c7a27e59e01c7ea09149098a078df00c80 (patch) | |
tree | 1b0b67705ca569dd1de6738662aeeba983cd96f9 /lldb/source/Host/common/FileSpec.cpp | |
parent | 5e37e99ba697487671f713ad62e15b3e9b1faa49 (diff) | |
download | bcm5719-llvm-db7d11c7a27e59e01c7ea09149098a078df00c80.tar.gz bcm5719-llvm-db7d11c7a27e59e01c7ea09149098a078df00c80.zip |
A few small fixes to make things like image list not
print "//mach_kernel" if you are debugging an executable
in the top level directory.
llvm-svn: 181190
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 82f5b344b9a..3e56e5c204e 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -523,10 +523,11 @@ FileSpec::Equal (const FileSpec& a, const FileSpec& b, bool full) void FileSpec::Dump(Stream *s) const { + static ConstString g_slash_only ("/"); if (s) { m_directory.Dump(s); - if (m_directory) + if (m_directory && m_directory != g_slash_only) s->PutChar('/'); m_filename.Dump(s); } @@ -705,13 +706,14 @@ FileSpec::GetPath(char *path, size_t path_max_len) const std::string FileSpec::GetPath (void) const { + static ConstString g_slash_only ("/"); std::string path; const char *dirname = m_directory.GetCString(); const char *filename = m_filename.GetCString(); if (dirname) { path.append (dirname); - if (filename) + if (filename && m_directory != g_slash_only) path.append ("/"); } if (filename) |