diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2022-01-15 10:23:06 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2022-01-15 10:31:49 -0800 |
commit | a6469cdbc426437dcb8442ae398f0a863336de37 (patch) | |
tree | 5bfb736c5b1ce6debdac568bc37f94f002dca4fe /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | a7e7f541c0813e9d3f6c641ad8ff89619ec749d8 (diff) | |
download | llvm-a6469cdbc426437dcb8442ae398f0a863336de37.zip llvm-a6469cdbc426437dcb8442ae398f0a863336de37.tar.gz llvm-a6469cdbc426437dcb8442ae398f0a863336de37.tar.bz2 |
[lldb] Correctly display the number of types found
Correctly display the number of types found for `target modules lookup
--type` and add a test.
Fixes #53219
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 2a42eb2..bd19ac5 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1605,7 +1605,6 @@ static size_t LookupTypeInModule(Target *target, TypeList type_list; if (module && name_cstr && name_cstr[0]) { const uint32_t max_num_matches = UINT32_MAX; - size_t num_matches = 0; bool name_is_fully_qualified = false; ConstString name(name_cstr); @@ -1616,8 +1615,10 @@ static size_t LookupTypeInModule(Target *target, if (type_list.Empty()) return 0; + const uint64_t num_matches = type_list.GetSize(); + strm.Indent(); - strm.Printf("%" PRIu64 " match%s found in ", (uint64_t)num_matches, + strm.Printf("%" PRIu64 " match%s found in ", num_matches, num_matches > 1 ? "es" : ""); DumpFullpath(strm, &module->GetFileSpec(), 0); strm.PutCString(":\n"); |