[Lldb-commits] [lldb] [LLDB] Add DIL code for handling plain variable names. (PR #120971)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 15 10:43:28 PST 2025


================
@@ -511,22 +513,58 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
     VariableSP &var_sp, Status &error) {
   ExecutionContext exe_ctx;
   CalculateExecutionContext(exe_ctx);
+
   bool use_DIL = exe_ctx.GetTargetRef().GetUseDIL(&exe_ctx);
+
   if (use_DIL)
     return DILGetValueForVariableExpressionPath(var_expr, use_dynamic, options,
                                                 var_sp, error);
-
-  return LegacyGetValueForVariableExpressionPath(var_expr, use_dynamic, options,
-                                                 var_sp, error);
+  else
+    return LegacyGetValueForVariableExpressionPath(var_expr, use_dynamic,
+                                                   options, var_sp, error);
 }
 
 ValueObjectSP StackFrame::DILGetValueForVariableExpressionPath(
     llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
     uint32_t options, lldb::VariableSP &var_sp, Status &error) {
-  // This is a place-holder for the calls into the DIL parser and
-  // evaluator.  For now, just call the "real" frame variable implementation.
-  return LegacyGetValueForVariableExpressionPath(var_expr, use_dynamic, options,
-                                                 var_sp, error);
+  ValueObjectSP ret_val;
+  std::shared_ptr<std::string> source =
+      std::make_shared<std::string>(var_expr.data());
----------------
cmtice wrote:

Done. Updated it to just be an llvm::StringRef; use .str() instead of .data() to convert to strings.

https://github.com/llvm/llvm-project/pull/120971


More information about the lldb-commits mailing list