[Lldb-commits] [PATCH] D72510: [lldb/Expression] Improve interpreter error message with a non-running process

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 10 07:52:51 PST 2020


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.bennani at 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72510.237327.patch
Type: text/x-patch
Size: 1023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200110/20139915/attachment.bin>


More information about the lldb-commits mailing list