[Lldb-commits] [lldb] [lldb] Speed up `SBValue::CreateValueFromExpression` by using DIL (PR #222192)

Yao Qi via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 9 02:01:09 PDT 2026


================
@@ -473,18 +473,57 @@ lldb::SBValue SBValue::CreateValueFromExpression(const char *name,
                                                  SBExpressionOptions &options) {
   LLDB_INSTRUMENT_VA(this, name, expression, options);
 
-  lldb::SBValue sb_value;
+  lldb::ValueObjectSP new_value_sp;
+  StackFrameSP frame_sp(GetFrame().GetFrameSP());
+  TargetSP target_sp(GetTarget().GetSP());
+  // If enabled, attempt to use DIL to evaluate the expression.
+  bool DIL_success = false;
+  if (frame_sp && target_sp) {
+    bool use_DIL = target_sp->GetUseDILForCreatingValues();
+    if (use_DIL) {
+      Status error;
+      if (frame_sp) {
+        uint32_t expr_path_options =
+            StackFrame::eExpressionPathOptionCheckPtrVsMember |
+            StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
+        lldb::VariableSP var_sp;
+        new_value_sp = frame_sp->GetValueForVariableExpressionPath(
+            expression, eNoDynamicValues, expr_path_options, var_sp, error);
----------------
qiyao wrote:

 `eNoDynamicValues` is hardcoded here, ignoring the caller-supplied `options.ref().GetFetchDynamicValue()`.  Does this change observable behaviour  for callers that explicitly request dynamic values?

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


More information about the lldb-commits mailing list