@@ -23,9 +23,9 @@ namespace lldb_dap {
2323// / indexed children.
2424Expected<VariablesResponseBody>
2525VariablesRequestHandler::Run (const VariablesArguments &arguments) const {
26- uint64_t var_ref = arguments.variablesReference ;
27- uint64_t count = arguments.count ;
28- uint64_t start = arguments.start ;
26+ const uint64_t var_ref = arguments.variablesReference ;
27+ const uint64_t count = arguments.count ;
28+ const uint64_t start = arguments.start ;
2929 bool hex = false ;
3030 if (arguments.format )
3131 hex = arguments.format ->hex ;
@@ -135,16 +135,18 @@ VariablesRequestHandler::Run(const VariablesArguments &arguments) const {
135135 // children.
136136 lldb::SBValue variable = dap.variables .GetVariable (var_ref);
137137 if (variable.IsValid ()) {
138+ bool is_permanent = dap.variables .IsPermanentVariableReference (var_ref);
138139 auto addChild = [&](lldb::SBValue child,
139140 std::optional<std::string> custom_name = {}) {
140141 if (!child.IsValid ())
141142 return ;
142- bool is_permanent = dap.variables .IsPermanentVariableReference (var_ref);
143- int64_t var_ref = dap.variables .InsertVariable (child, is_permanent);
144- variables.emplace_back (CreateVariable (
145- child, var_ref, hex, dap.configuration .enableAutoVariableSummaries ,
146- dap.configuration .enableSyntheticChildDebugging ,
147- /* is_name_duplicated=*/ false , custom_name));
143+ int64_t child_var_ref =
144+ dap.variables .InsertVariable (child, is_permanent);
145+ variables.emplace_back (
146+ CreateVariable (child, child_var_ref, hex,
147+ dap.configuration .enableAutoVariableSummaries ,
148+ dap.configuration .enableSyntheticChildDebugging ,
149+ /* is_name_duplicated=*/ false , custom_name));
148150 };
149151 const int64_t num_children = variable.GetNumChildren ();
150152 int64_t end_idx = start + ((count == 0 ) ? num_children : count);
0 commit comments