1 //===-- CommandCompletions.h ------------------------------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
10 #define LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
11 
12 #include <set>
13 
14 #include "lldb/Core/SearchFilter.h"
15 #include "lldb/Interpreter/Options.h"
16 #include "lldb/Utility/CompletionRequest.h"
17 #include "lldb/Utility/FileSpecList.h"
18 #include "lldb/Utility/RegularExpression.h"
19 #include "lldb/lldb-private.h"
20 
21 #include "llvm/ADT/Twine.h"
22 
23 namespace lldb_private {
24 class TildeExpressionResolver;
25 class CommandCompletions {
26 public:
27   static bool InvokeCommonCompletionCallbacks(
28       CommandInterpreter &interpreter, uint32_t completion_mask,
29       lldb_private::CompletionRequest &request, SearchFilter *searcher);
30 
31   // These are the generic completer functions:
32   static void DiskFiles(CommandInterpreter &interpreter,
33                         CompletionRequest &request, SearchFilter *searcher);
34 
35   static void DiskFiles(const llvm::Twine &partial_file_name,
36                         StringList &matches, TildeExpressionResolver &Resolver);
37 
38   static void DiskDirectories(CommandInterpreter &interpreter,
39                               CompletionRequest &request,
40                               SearchFilter *searcher);
41 
42   static void DiskDirectories(const llvm::Twine &partial_file_name,
43                               StringList &matches,
44                               TildeExpressionResolver &Resolver);
45 
46   static void RemoteDiskFiles(CommandInterpreter &interpreter,
47                               CompletionRequest &request,
48                               SearchFilter *searcher);
49 
50   static void RemoteDiskDirectories(CommandInterpreter &interpreter,
51                                     CompletionRequest &request,
52                                     SearchFilter *searcher);
53 
54   static void SourceFiles(CommandInterpreter &interpreter,
55                           CompletionRequest &request, SearchFilter *searcher);
56 
57   static void Modules(CommandInterpreter &interpreter,
58                       CompletionRequest &request, SearchFilter *searcher);
59 
60   static void ModuleUUIDs(CommandInterpreter &interpreter,
61                           CompletionRequest &request, SearchFilter *searcher);
62 
63   static void Symbols(CommandInterpreter &interpreter,
64                       CompletionRequest &request, SearchFilter *searcher);
65 
66   static void SettingsNames(CommandInterpreter &interpreter,
67                             CompletionRequest &request, SearchFilter *searcher);
68 
69   static void PlatformPluginNames(CommandInterpreter &interpreter,
70                                   CompletionRequest &request,
71                                   SearchFilter *searcher);
72 
73   static void ArchitectureNames(CommandInterpreter &interpreter,
74                                 CompletionRequest &request,
75                                 SearchFilter *searcher);
76 
77   static void VariablePath(CommandInterpreter &interpreter,
78                            CompletionRequest &request, SearchFilter *searcher);
79 
80   static void Registers(CommandInterpreter &interpreter,
81                         CompletionRequest &request, SearchFilter *searcher);
82 
83   static void Breakpoints(CommandInterpreter &interpreter,
84                           CompletionRequest &request, SearchFilter *searcher);
85 
86   static void BreakpointNames(CommandInterpreter &interpreter,
87                               CompletionRequest &request,
88                               SearchFilter *searcher);
89 
90   static void ProcessPluginNames(CommandInterpreter &interpreter,
91                                  CompletionRequest &request,
92                                  SearchFilter *searcher);
93 
94   static void ProcessIDs(CommandInterpreter &interpreter,
95                          CompletionRequest &request, SearchFilter *searcher);
96 
97   static void ProcessNames(CommandInterpreter &interpreter,
98                            CompletionRequest &request, SearchFilter *searcher);
99 
100   static void DisassemblyFlavors(CommandInterpreter &interpreter,
101                                  CompletionRequest &request,
102                                  SearchFilter *searcher);
103 
104   static void TypeLanguages(CommandInterpreter &interpreter,
105                             CompletionRequest &request, SearchFilter *searcher);
106 
107   static void FrameIndexes(CommandInterpreter &interpreter,
108                            CompletionRequest &request, SearchFilter *searcher);
109 
110   static void StopHookIDs(CommandInterpreter &interpreter,
111                           CompletionRequest &request, SearchFilter *searcher);
112 
113   static void ThreadIndexes(CommandInterpreter &interpreter,
114                             CompletionRequest &request, SearchFilter *searcher);
115 
116   static void WatchPointIDs(CommandInterpreter &interpreter,
117                             CompletionRequest &request, SearchFilter *searcher);
118 
119   static void TypeCategoryNames(CommandInterpreter &interpreter,
120                                 CompletionRequest &request,
121                                 SearchFilter *searcher);
122 
123   static void ThreadIDs(CommandInterpreter &interpreter,
124                         CompletionRequest &request, SearchFilter *searcher);
125 
126   /// This completer works for commands whose only arguments are a command path.
127   /// It isn't tied to an argument type because it completes not on a single
128   /// argument but on the sequence of arguments, so you have to invoke it by
129   /// hand.
130   static void
131   CompleteModifiableCmdPathArgs(CommandInterpreter &interpreter,
132                                 CompletionRequest &request,
133                                 OptionElementVector &opt_element_vector);
134 };
135 
136 } // namespace lldb_private
137 
138 #endif // LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
139