[lldb][dwarf] Compute fully qualified names on simplified template names with DWARFT...
[llvm-project.git] / lldb / source / Interpreter / Interfaces / ScriptedInterfaceUsages.cpp
blob05d7a5d852f8cea141cba200ee60894afc1b34ee
1 //===-- ScriptedInterfaceUsages.cpp --------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Interpreter/Interfaces/ScriptedInterfaceUsages.h"
11 using namespace lldb;
12 using namespace lldb_private;
14 void ScriptedInterfaceUsages::Dump(Stream &s, UsageKind kind) const {
15 s.IndentMore();
16 s.Indent();
17 llvm::StringRef usage_kind =
18 (kind == UsageKind::CommandInterpreter) ? "Command Interpreter" : "API";
19 s << usage_kind << " Usages:";
20 const std::vector<llvm::StringRef> &usages =
21 (kind == UsageKind::CommandInterpreter) ? GetCommandInterpreterUsages()
22 : GetSBAPIUsages();
23 if (usages.empty())
24 s << " None\n";
25 else if (usages.size() == 1)
26 s << " " << usages.front() << '\n';
27 else {
28 s << '\n';
29 for (llvm::StringRef usage : usages) {
30 s.IndentMore();
31 s.Indent();
32 s << usage << '\n';
33 s.IndentLess();
36 s.IndentLess();