LLDB  mainline
CommandCompletions.h
Go to the documentation of this file.
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/FileSpecList.h"
15 #include "lldb/Core/SearchFilter.h"
19 #include "lldb/lldb-private.h"
20 
21 #include "llvm/ADT/Twine.h"
22 
23 namespace lldb_private {
24 class TildeExpressionResolver;
26 public:
29  eSourceFileCompletion = (1u << 0),
30  eDiskFileCompletion = (1u << 1),
32  eSymbolCompletion = (1u << 3),
33  eModuleCompletion = (1u << 4),
38  eRegisterCompletion = (1u << 9),
39  eBreakpointCompletion = (1u << 10),
43  eFrameIndexCompletion = (1u << 14),
44  eModuleUUIDCompletion = (1u << 15),
45  eStopHookIDCompletion = (1u << 16),
46  eThreadIndexCompletion = (1u << 17),
49  eProcessIDCompletion = (1u << 20),
50  eProcessNameCompletion = (1u << 21),
54  // This item serves two purposes. It is the last element in the enum, so
55  // you can add custom enums starting from here in your Option class. Also
56  // if you & in this bit the base code will not process the option.
57  eCustomCompletion = (1u << 24)
58  };
59 
61  CommandInterpreter &interpreter, uint32_t completion_mask,
62  lldb_private::CompletionRequest &request, SearchFilter *searcher);
63 
64  // These are the generic completer functions:
65  static void DiskFiles(CommandInterpreter &interpreter,
66  CompletionRequest &request, SearchFilter *searcher);
67 
68  static void DiskFiles(const llvm::Twine &partial_file_name,
69  StringList &matches, TildeExpressionResolver &Resolver);
70 
71  static void DiskDirectories(CommandInterpreter &interpreter,
72  CompletionRequest &request,
73  SearchFilter *searcher);
74 
75  static void DiskDirectories(const llvm::Twine &partial_file_name,
76  StringList &matches,
77  TildeExpressionResolver &Resolver);
78 
79  static void RemoteDiskFiles(CommandInterpreter &interpreter,
80  CompletionRequest &request,
81  SearchFilter *searcher);
82 
83  static void RemoteDiskDirectories(CommandInterpreter &interpreter,
84  CompletionRequest &request,
85  SearchFilter *searcher);
86 
87  static void SourceFiles(CommandInterpreter &interpreter,
88  CompletionRequest &request, SearchFilter *searcher);
89 
90  static void Modules(CommandInterpreter &interpreter,
91  CompletionRequest &request, SearchFilter *searcher);
92 
93  static void ModuleUUIDs(CommandInterpreter &interpreter,
94  CompletionRequest &request, SearchFilter *searcher);
95 
96  static void Symbols(CommandInterpreter &interpreter,
97  CompletionRequest &request, SearchFilter *searcher);
98 
99  static void SettingsNames(CommandInterpreter &interpreter,
100  CompletionRequest &request, SearchFilter *searcher);
101 
102  static void PlatformPluginNames(CommandInterpreter &interpreter,
103  CompletionRequest &request,
104  SearchFilter *searcher);
105 
106  static void ArchitectureNames(CommandInterpreter &interpreter,
107  CompletionRequest &request,
108  SearchFilter *searcher);
109 
110  static void VariablePath(CommandInterpreter &interpreter,
111  CompletionRequest &request, SearchFilter *searcher);
112 
113  static void Registers(CommandInterpreter &interpreter,
114  CompletionRequest &request, SearchFilter *searcher);
115 
116  static void Breakpoints(CommandInterpreter &interpreter,
117  CompletionRequest &request, SearchFilter *searcher);
118 
119  static void BreakpointNames(CommandInterpreter &interpreter,
120  CompletionRequest &request,
121  SearchFilter *searcher);
122 
123  static void ProcessPluginNames(CommandInterpreter &interpreter,
124  CompletionRequest &request,
125  SearchFilter *searcher);
126 
127  static void ProcessIDs(CommandInterpreter &interpreter,
128  CompletionRequest &request, SearchFilter *searcher);
129 
130  static void ProcessNames(CommandInterpreter &interpreter,
131  CompletionRequest &request, SearchFilter *searcher);
132 
133  static void DisassemblyFlavors(CommandInterpreter &interpreter,
134  CompletionRequest &request,
135  SearchFilter *searcher);
136 
137  static void TypeLanguages(CommandInterpreter &interpreter,
138  CompletionRequest &request, SearchFilter *searcher);
139 
140  static void FrameIndexes(CommandInterpreter &interpreter,
141  CompletionRequest &request, SearchFilter *searcher);
142 
143  static void StopHookIDs(CommandInterpreter &interpreter,
144  CompletionRequest &request, SearchFilter *searcher);
145 
146  static void ThreadIndexes(CommandInterpreter &interpreter,
147  CompletionRequest &request, SearchFilter *searcher);
148 
149  static void WatchPointIDs(CommandInterpreter &interpreter,
150  CompletionRequest &request, SearchFilter *searcher);
151 
152  static void TypeCategoryNames(CommandInterpreter &interpreter,
153  CompletionRequest &request,
154  SearchFilter *searcher);
155 
156  /// This completer works for commands whose only arguments are a command path.
157  /// It isn't tied to an argument type because it completes not on a single
158  /// argument but on the sequence of arguments, so you have to invoke it by
159  /// hand.
160  static void
162  CompletionRequest &request,
163  OptionElementVector &opt_element_vector);
164 };
165 
166 } // namespace lldb_private
167 
168 #endif // LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
RegularExpression.h
lldb_private::CommandCompletions::ePlatformPluginCompletion
@ ePlatformPluginCompletion
Definition: CommandCompletions.h:35
lldb_private::CommandCompletions::RemoteDiskDirectories
static void RemoteDiskDirectories(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:505
lldb_private::CommandCompletions::PlatformPluginNames
static void PlatformPluginNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:581
lldb_private::CommandCompletions::BreakpointNames
static void BreakpointNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:648
lldb_private::CommandCompletions::eProcessPluginCompletion
@ eProcessPluginCompletion
Definition: CommandCompletions.h:40
lldb_private::CommandCompletions::WatchPointIDs
static void WatchPointIDs(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:771
lldb_private::CommandCompletions::ProcessPluginNames
static void ProcessPluginNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:662
lldb_private::CommandCompletions::ModuleUUIDs
static void ModuleUUIDs(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:528
lldb_private::CommandCompletions::RemoteDiskFiles
static void RemoteDiskFiles(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:496
lldb_private::CommandCompletions::eModuleUUIDCompletion
@ eModuleUUIDCompletion
Definition: CommandCompletions.h:44
lldb_private::CommandCompletions::eProcessNameCompletion
@ eProcessNameCompletion
Definition: CommandCompletions.h:50
lldb_private::CommandCompletions::CommonCompletionTypes
CommonCompletionTypes
Definition: CommandCompletions.h:27
lldb_private::CommandCompletions::eProcessIDCompletion
@ eProcessIDCompletion
Definition: CommandCompletions.h:49
lldb_private::CommandCompletions::VariablePath
static void VariablePath(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:594
lldb_private::CommandCompletions::SettingsNames
static void SettingsNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:560
lldb_private::CommandCompletions::eTypeCategoryNameCompletion
@ eTypeCategoryNameCompletion
Definition: CommandCompletions.h:53
CompletionRequest.h
lldb_private::CommandCompletions::SourceFiles
static void SourceFiles(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:305
lldb_private::CommandCompletions::eFrameIndexCompletion
@ eFrameIndexCompletion
Definition: CommandCompletions.h:43
lldb_private::CommandCompletions::eCustomCompletion
@ eCustomCompletion
Definition: CommandCompletions.h:57
Options.h
lldb_private::CommandCompletions::eWatchPointIDCompletion
@ eWatchPointIDCompletion
Definition: CommandCompletions.h:47
lldb_private::CommandCompletions::eSourceFileCompletion
@ eSourceFileCompletion
Definition: CommandCompletions.h:29
lldb_private::CommandCompletions::eBreakpointCompletion
@ eBreakpointCompletion
Definition: CommandCompletions.h:39
lldb_private::CommandCompletions
Definition: CommandCompletions.h:25
lldb_private::CommandCompletions::eStopHookIDCompletion
@ eStopHookIDCompletion
Definition: CommandCompletions.h:45
lldb_private::SearchFilter
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
lldb_private::CommandCompletions::ProcessNames
static void ProcessNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:693
SearchFilter.h
lldb_private::CommandCompletions::eRegisterCompletion
@ eRegisterCompletion
Definition: CommandCompletions.h:38
lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:51
lldb_private::CommandCompletions::eNoCompletion
@ eNoCompletion
Definition: CommandCompletions.h:28
lldb_private::StringList
Definition: StringList.h:25
FileSpecList.h
lldb_private::CommandCompletions::eModuleCompletion
@ eModuleCompletion
Definition: CommandCompletions.h:33
lldb_private::CommandCompletions::Symbols
static void Symbols(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:546
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::CommandCompletions::eRemoteDiskFileCompletion
@ eRemoteDiskFileCompletion
Definition: CommandCompletions.h:51
lldb_private::CommandCompletions::DiskDirectories
static void DiskDirectories(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:484
lldb_private::OptionElementVector
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:42
lldb_private::CommandCompletions::eRemoteDiskDirectoryCompletion
@ eRemoteDiskDirectoryCompletion
Definition: CommandCompletions.h:52
lldb_private::CommandCompletions::DiskFiles
static void DiskFiles(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:472
lldb_private::CommandCompletions::Breakpoints
static void Breakpoints(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:617
lldb_private::CommandCompletions::ThreadIndexes
static void ThreadIndexes(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:754
lldb-private.h
lldb_private::CommandCompletions::eDiskDirectoryCompletion
@ eDiskDirectoryCompletion
Definition: CommandCompletions.h:31
lldb_private::CommandCompletions::eDisassemblyFlavorCompletion
@ eDisassemblyFlavorCompletion
Definition: CommandCompletions.h:41
lldb_private::CommandCompletions::eBreakpointNameCompletion
@ eBreakpointNameCompletion
Definition: CommandCompletions.h:48
uint32_t
lldb_private::CommandCompletions::Registers
static void Registers(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:600
lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs
static void CompleteModifiableCmdPathArgs(CommandInterpreter &interpreter, CompletionRequest &request, OptionElementVector &opt_element_vector)
This completer works for commands whose only arguments are a command path.
Definition: CommandCompletions.cpp:798
lldb_private::CommandCompletions::TypeLanguages
static void TypeLanguages(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:706
lldb_private::CommandCompletions::Modules
static void Modules(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:514
lldb_private::CommandCompletions::ArchitectureNames
static void ArchitectureNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:588
lldb_private::CommandCompletions::eTypeLanguageCompletion
@ eTypeLanguageCompletion
Definition: CommandCompletions.h:42
lldb_private::CommandCompletions::eVariablePathCompletion
@ eVariablePathCompletion
Definition: CommandCompletions.h:37
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CommandCompletions::TypeCategoryNames
static void TypeCategoryNames(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:787
lldb_private::CommandCompletions::StopHookIDs
static void StopHookIDs(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:733
lldb_private::CommandCompletions::eSettingsNameCompletion
@ eSettingsNameCompletion
Definition: CommandCompletions.h:34
lldb_private::CommandCompletions::FrameIndexes
static void FrameIndexes(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:716
lldb_private::CommandCompletions::ProcessIDs
static void ProcessIDs(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:679
lldb_private::CommandCompletions::eArchitectureCompletion
@ eArchitectureCompletion
Definition: CommandCompletions.h:36
lldb_private::CommandCompletions::DisassemblyFlavors
static void DisassemblyFlavors(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher)
Definition: CommandCompletions.cpp:668
lldb_private::CommandCompletions::eThreadIndexCompletion
@ eThreadIndexCompletion
Definition: CommandCompletions.h:46
lldb_private::CommandCompletions::eDiskFileCompletion
@ eDiskFileCompletion
Definition: CommandCompletions.h:30
lldb_private::TildeExpressionResolver
Definition: TildeExpressionResolver.h:20
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
lldb_private::CommandCompletions::eSymbolCompletion
@ eSymbolCompletion
Definition: CommandCompletions.h:32