@@ -162,50 +162,70 @@ struct DAP {
162
162
lldb::SBFile in;
163
163
OutputRedirector out;
164
164
OutputRedirector err;
165
+
165
166
// / Configuration specified by the launch or attach commands.
166
167
protocol::Configuration configuration;
168
+
169
+ // / The debugger instance for this DAP session.
167
170
lldb::SBDebugger debugger;
171
+
172
+ // / The target instance for this DAP session.
168
173
lldb::SBTarget target;
174
+
169
175
Variables variables;
170
176
lldb::SBBroadcaster broadcaster;
171
177
llvm::StringMap<SourceBreakpointMap> source_breakpoints;
172
178
FunctionBreakpointMap function_breakpoints;
173
179
InstructionBreakpointMap instruction_breakpoints;
174
180
std::optional<std::vector<ExceptionBreakpoint>> exception_breakpoints;
175
181
llvm::once_flag init_exception_breakpoints_flag;
176
- // Map step in target id to list of function targets that user can choose.
182
+
183
+ // / Map step in target id to list of function targets that user can choose.
177
184
llvm::DenseMap<lldb::addr_t , std::string> step_in_targets;
178
- // A copy of the last LaunchRequest so we can reuse its arguments if we get a
179
- // RestartRequest. Restarting an AttachRequest is not supported.
185
+
186
+ // / A copy of the last LaunchRequest so we can reuse its arguments if we get a
187
+ // / RestartRequest. Restarting an AttachRequest is not supported.
180
188
std::optional<protocol::LaunchRequestArguments> last_launch_request;
181
- lldb::tid_t focus_tid;
189
+
190
+ // / The focused thread for this DAP session.
191
+ lldb::tid_t focus_tid = LLDB_INVALID_THREAD_ID;
192
+
182
193
bool disconnecting = false ;
183
194
llvm::once_flag terminated_event_flag;
184
- bool stop_at_entry;
185
- bool is_attach;
186
- // The process event thread normally responds to process exited events by
187
- // shutting down the entire adapter. When we're restarting, we keep the id of
188
- // the old process here so we can detect this case and keep running.
189
- lldb::pid_t restarting_process_id;
195
+ bool stop_at_entry = false ;
196
+ bool is_attach = false ;
197
+
198
+ // / The process event thread normally responds to process exited events by
199
+ // / shutting down the entire adapter. When we're restarting, we keep the id of
200
+ // / the old process here so we can detect this case and keep running.
201
+ lldb::pid_t restarting_process_id = LLDB_INVALID_PROCESS_ID;
202
+
203
+ // / Whether we have received the ConfigurationDone request, indicating that
204
+ // / the client has finished initialization of the debug adapter.
190
205
bool configuration_done;
191
- bool waiting_for_run_in_terminal;
206
+
207
+ bool waiting_for_run_in_terminal = false ;
192
208
ProgressEventReporter progress_event_reporter;
193
- // Keep track of the last stop thread index IDs as threads won't go away
194
- // unless we send a "thread" event to indicate the thread exited.
209
+
210
+ // / Keep track of the last stop thread index IDs as threads won't go away
211
+ // / unless we send a "thread" event to indicate the thread exited.
195
212
llvm::DenseSet<lldb::tid_t > thread_ids;
196
- uint32_t reverse_request_seq;
213
+
214
+ uint32_t reverse_request_seq = 0 ;
197
215
std::mutex call_mutex;
198
216
llvm::SmallDenseMap<int64_t , std::unique_ptr<ResponseHandler>>
199
217
inflight_reverse_requests;
200
218
ReplMode repl_mode;
201
219
lldb::SBFormat frame_format;
202
220
lldb::SBFormat thread_format;
203
- // This is used to allow request_evaluate to handle empty expressions
204
- // (ie the user pressed 'return' and expects the previous expression to
205
- // repeat). If the previous expression was a command, this string will be
206
- // empty; if the previous expression was a variable expression, this string
207
- // will contain that expression.
221
+
222
+ // / This is used to allow request_evaluate to handle empty expressions
223
+ // / (ie the user pressed 'return' and expects the previous expression to
224
+ // / repeat). If the previous expression was a command, this string will be
225
+ // / empty; if the previous expression was a variable expression, this string
226
+ // / will contain that expression.
208
227
std::string last_nonempty_var_expression;
228
+
209
229
// / The set of features supported by the connected client.
210
230
llvm::DenseSet<ClientFeature> clientFeatures;
211
231
@@ -257,8 +277,6 @@ struct DAP {
257
277
// / Configures the debug adapter for launching/attaching.
258
278
void SetConfiguration (const protocol::Configuration &confing, bool is_attach);
259
279
260
- void SetConfigurationDone ();
261
-
262
280
// / Configure source maps based on the current `DAPConfiguration`.
263
281
void ConfigureSourceMaps ();
264
282
0 commit comments