/
CommandCompletions.h
158 lines (123 loc) · 6.5 KB
/
CommandCompletions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//===-- CommandCompletions.h ------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
#define LLDB_INTERPRETER_COMMANDCOMPLETIONS_H
#include <set>
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/lldb-private.h"
#include "llvm/ADT/Twine.h"
namespace lldb_private {
class TildeExpressionResolver;
class CommandCompletions {
public:
enum CommonCompletionTypes {
eNoCompletion = 0u,
eSourceFileCompletion = (1u << 0),
eDiskFileCompletion = (1u << 1),
eDiskDirectoryCompletion = (1u << 2),
eSymbolCompletion = (1u << 3),
eModuleCompletion = (1u << 4),
eSettingsNameCompletion = (1u << 5),
ePlatformPluginCompletion = (1u << 6),
eArchitectureCompletion = (1u << 7),
eVariablePathCompletion = (1u << 8),
eRegisterCompletion = (1u << 9),
eBreakpointCompletion = (1u << 10),
eProcessPluginCompletion = (1u << 11),
eDisassemblyFlavorCompletion = (1u << 12),
eTypeLanguageCompletion = (1u << 13),
eFrameIndexCompletion = (1u << 14),
eModuleUUIDCompletion = (1u << 15),
eStopHookIDCompletion = (1u << 16),
eThreadIndexCompletion = (1u << 17),
eWatchPointIDCompletion = (1u << 18),
eBreakpointNameCompletion = (1u << 19),
eProcessIDCompletion = (1u << 20),
eProcessNameCompletion = (1u << 21),
eRemoteDiskFileCompletion = (1u << 22),
eRemoteDiskDirectoryCompletion = (1u << 23),
eTypeCategoryNameCompletion = (1u << 24),
// This item serves two purposes. It is the last element in the enum, so
// you can add custom enums starting from here in your Option class. Also
// if you & in this bit the base code will not process the option.
eCustomCompletion = (1u << 24)
};
static bool InvokeCommonCompletionCallbacks(
CommandInterpreter &interpreter, uint32_t completion_mask,
lldb_private::CompletionRequest &request, SearchFilter *searcher);
// These are the generic completer functions:
static void DiskFiles(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void DiskFiles(const llvm::Twine &partial_file_name,
StringList &matches, TildeExpressionResolver &Resolver);
static void DiskDirectories(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void DiskDirectories(const llvm::Twine &partial_file_name,
StringList &matches,
TildeExpressionResolver &Resolver);
static void RemoteDiskFiles(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void RemoteDiskDirectories(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void SourceFiles(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void Modules(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void ModuleUUIDs(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void Symbols(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void SettingsNames(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void PlatformPluginNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void ArchitectureNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void VariablePath(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void Registers(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void Breakpoints(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void BreakpointNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void ProcessPluginNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void ProcessIDs(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void ProcessNames(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void DisassemblyFlavors(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
static void TypeLanguages(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void FrameIndexes(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void StopHookIDs(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void ThreadIndexes(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void WatchPointIDs(CommandInterpreter &interpreter,
CompletionRequest &request, SearchFilter *searcher);
static void TypeCategoryNames(CommandInterpreter &interpreter,
CompletionRequest &request,
SearchFilter *searcher);
};
} // namespace lldb_private
#endif // LLDB_INTERPRETER_COMMANDCOMPLETIONS_H