@@ -162,50 +162,70 @@ struct DAP {
162162 lldb::SBFile in;
163163 OutputRedirector out;
164164 OutputRedirector err;
165+
165166 // / Configuration specified by the launch or attach commands.
166167 protocol::Configuration configuration;
168+
169+ // / The debugger instance for this DAP session.
167170 lldb::SBDebugger debugger;
171+
172+ // / The target instance for this DAP session.
168173 lldb::SBTarget target;
174+
169175 Variables variables;
170176 lldb::SBBroadcaster broadcaster;
171177 llvm::StringMap<SourceBreakpointMap> source_breakpoints;
172178 FunctionBreakpointMap function_breakpoints;
173179 InstructionBreakpointMap instruction_breakpoints;
174180 std::optional<std::vector<ExceptionBreakpoint>> exception_breakpoints;
175181 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.
177184 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.
180188 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+
182193 bool disconnecting = false ;
183194 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.
190205 bool configuration_done;
191- bool waiting_for_run_in_terminal;
206+
207+ bool waiting_for_run_in_terminal = false ;
192208 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.
195212 llvm::DenseSet<lldb::tid_t > thread_ids;
196- uint32_t reverse_request_seq;
213+
214+ uint32_t reverse_request_seq = 0 ;
197215 std::mutex call_mutex;
198216 llvm::SmallDenseMap<int64_t , std::unique_ptr<ResponseHandler>>
199217 inflight_reverse_requests;
200218 ReplMode repl_mode;
201219 lldb::SBFormat frame_format;
202220 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.
208227 std::string last_nonempty_var_expression;
228+
209229 // / The set of features supported by the connected client.
210230 llvm::DenseSet<ClientFeature> clientFeatures;
211231
@@ -257,8 +277,6 @@ struct DAP {
257277 // / Configures the debug adapter for launching/attaching.
258278 void SetConfiguration (const protocol::Configuration &confing, bool is_attach);
259279
260- void SetConfigurationDone ();
261-
262280 // / Configure source maps based on the current `DAPConfiguration`.
263281 void ConfigureSourceMaps ();
264282
0 commit comments