mib created this revision.
mib added reviewers: jingham, JDevlieghere.
mib added a project: LLDB.
Herald added a subscriber: lldb-commits.
mib edited the summary of this revision.

When trying to interprete an expression with a function call, if the
process haven't been launched, the expression fails to be interpreted
and the user gets the following  error message:

  error: Interpreting the expression locally failed:
            Interpreter doesn't handle one of the expression's opcodes

This message doesn't explain why the expression failed to be
interpreted, that's why this patch introduces a new
`non_running_target_error` that is displayed when the expression
contains a function call that can't be ignored when no process is
running.

rdar://11991708

Signed-off-by: Med Ismail Bennani <medismail.benn...@gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72510

Files:
  lldb/source/Expression/IRInterpreter.cpp


Index: lldb/source/Expression/IRInterpreter.cpp
===================================================================
--- lldb/source/Expression/IRInterpreter.cpp
+++ lldb/source/Expression/IRInterpreter.cpp
@@ -428,7 +428,8 @@
     return data_address;
   }
 };
-
+static const char *non_running_target_error =
+    "Interpreter requires to run the program to interprete the expression";
 static const char *unsupported_opcode_error =
     "Interpreter doesn't handle one of the expression's opcodes";
 static const char *unsupported_operand_error =
@@ -531,10 +532,10 @@
         }
 
         if (!CanIgnoreCall(call_inst) && !support_function_calls) {
-          LLDB_LOGF(log, "Unsupported instruction: %s",
+          LLDB_LOGF(log, "Non-running target: %s",
                     PrintValue(&*ii).c_str());
           error.SetErrorToGenericError();
-          error.SetErrorString(unsupported_opcode_error);
+          error.SetErrorString(non_running_target_error);
           return false;
         }
       } break;


Index: lldb/source/Expression/IRInterpreter.cpp
===================================================================
--- lldb/source/Expression/IRInterpreter.cpp
+++ lldb/source/Expression/IRInterpreter.cpp
@@ -428,7 +428,8 @@
     return data_address;
   }
 };
-
+static const char *non_running_target_error =
+    "Interpreter requires to run the program to interprete the expression";
 static const char *unsupported_opcode_error =
     "Interpreter doesn't handle one of the expression's opcodes";
 static const char *unsupported_operand_error =
@@ -531,10 +532,10 @@
         }
 
         if (!CanIgnoreCall(call_inst) && !support_function_calls) {
-          LLDB_LOGF(log, "Unsupported instruction: %s",
+          LLDB_LOGF(log, "Non-running target: %s",
                     PrintValue(&*ii).c_str());
           error.SetErrorToGenericError();
-          error.SetErrorString(unsupported_opcode_error);
+          error.SetErrorString(non_running_target_error);
           return false;
         }
       } break;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to