Skip to content

Commit b11201f

Browse files
committed
Using an optional for frame and thread format
1 parent 087ab33 commit b11201f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,10 +1215,10 @@ void DAP::SetConfiguration(const protocol::Configuration &config,
12151215
stop_at_entry = config.stopOnEntry;
12161216
this->is_attach = is_attach;
12171217

1218-
if (!configuration.customFrameFormat.empty())
1219-
SetFrameFormat(configuration.customFrameFormat);
1220-
if (!configuration.customThreadFormat.empty())
1221-
SetThreadFormat(configuration.customThreadFormat);
1218+
if (configuration.customFrameFormat)
1219+
SetFrameFormat(*configuration.customFrameFormat);
1220+
if (configuration.customThreadFormat)
1221+
SetThreadFormat(*configuration.customThreadFormat);
12221222
}
12231223

12241224
void DAP::SetFrameFormat(llvm::StringRef format) {

lldb/tools/lldb-dap/Protocol/ProtocolRequests.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ struct Configuration {
160160

161161
/// If a variable is displayed using a synthetic children, also display the
162162
/// actual contents of the variable at the end under a [raw] entry. This is
163-
/// useful when creating sythetic child plug-ins as it lets you see the actual
164-
/// contents of the variable.
163+
/// useful when creating synthetic child plug-ins as it lets you see the
164+
/// actual contents of the variable.
165165
bool enableSyntheticChildDebugging = false;
166166

167167
/// Enable language specific extended backtraces.
@@ -170,7 +170,7 @@ struct Configuration {
170170
/// Stop at the entry point of the program when launching or attaching.
171171
bool stopOnEntry = false;
172172

173-
/// Optional timeout when waiting for the program to `runInTermianl` or
173+
/// Optional timeout when waiting for the program to `runInTerminal` or
174174
/// attach.
175175
std::chrono::seconds timeout = std::chrono::seconds(30);
176176

@@ -187,10 +187,10 @@ struct Configuration {
187187
/// default frame names will be used. This might come with a performance cost
188188
/// because debug information might need to be processed to generate the
189189
/// description.
190-
std::string customFrameFormat = "";
190+
std::optional<std::string> customFrameFormat;
191191

192192
/// Same as `customFrameFormat`, but for threads instead of stack frames.
193-
std::string customThreadFormat = "";
193+
std::optional<std::string> customThreadFormat;
194194

195195
/// Specify a source path to remap "./" to allow full paths to be used when
196196
/// setting breakpoints in binaries that have relative source paths.
@@ -275,8 +275,8 @@ struct LaunchRequestArguments {
275275
/// with values or just "VAR" for environment variables with no values.
276276
llvm::StringMap<std::string> env;
277277

278-
/// If set, then the client stub should detach rather than killing the debugee
279-
/// if it loses connection with lldb.
278+
/// If set, then the client stub should detach rather than killing the
279+
/// debuggee if it loses connection with lldb.
280280
bool detachOnError = false;
281281

282282
/// Disable ASLR (Address Space Layout Randomization) when launching the

0 commit comments

Comments
 (0)