[Lldb-commits] [lldb] 0082f1e - [lldb] Improve error message when running static initializers in an expression fails

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 7 04:46:54 PST 2020


Author: Raphael Isemann
Date: 2020-02-07T13:46:28+01:00
New Revision: 0082f1e0ccb215592d187b0a343608ad7813db30

URL: https://github.com/llvm/llvm-project/commit/0082f1e0ccb215592d187b0a343608ad7813db30
DIFF: https://github.com/llvm/llvm-project/commit/0082f1e0ccb215592d187b0a343608ad7813db30.diff

LOG: [lldb] Improve error message when running static initializers in an expression fails

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py
    lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py b/lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py
index cec0e50911cf..6abdb226be29 100644
--- a/lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py
+++ b/lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py
@@ -30,4 +30,4 @@ def test_failing_init(self):
 
         # FIXME: This error message is not even remotely helpful.
         self.expect("expr -p -- struct Foo2 { Foo2() { do_abort(); } }; Foo2 f;", error=True,
-                    substrs=["error: couldn't run static initializers: couldn't run static initializer:"])
+                    substrs=["error: couldn't run static initializer:"])

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 1bdc0d158593..6d781934c174 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -659,7 +659,7 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
       const char *error_cstr = static_init_error.AsCString();
       if (error_cstr && error_cstr[0])
         diagnostic_manager.Printf(eDiagnosticSeverityError,
-                                  "couldn't run static initializers: %s\n",
+                                  "%s\n",
                                   error_cstr);
       else
         diagnostic_manager.PutString(eDiagnosticSeverityError,


        


More information about the lldb-commits mailing list