Skip to content

Commit

Permalink
[lldb] Fix version string when using LLDB_REVISION but not LLDB_REPOS…
Browse files Browse the repository at this point in the history
…ITORY

Summary:
lldb's format string (line one) is:
`lldb version $clang_version ($lldb_repo revision $lldb_revision)`

When only using $lldb_revision and not $lldb_repo, this might look like:
`lldb version 11 ( revision 12345)`
which looks pretty ugly.

Aside: I'm not sure we really need all the different versions since we've moved to the monorepo layout -- I don't think anyone is using different llvm/clang/lldb revisions, are they? We could likely tidy this up further if we knew how people consumed the output of lldb --version.

Reviewers: labath, JDevlieghere, friss

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74859
  • Loading branch information
rupprecht committed Feb 20, 2020
1 parent af64b31 commit 0ffa6e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lldb/source/lldb.cpp
Expand Up @@ -50,8 +50,10 @@ const char *lldb_private::GetVersion() {
g_version_str += " (";
if (lldb_repo)
g_version_str += lldb_repo;
if (lldb_repo && lldb_rev)
g_version_str += " ";
if (lldb_rev) {
g_version_str += " revision ";
g_version_str += "revision ";
g_version_str += lldb_rev;
}
g_version_str += ")";
Expand Down

0 comments on commit 0ffa6e1

Please sign in to comment.