[Lldb-commits] [lldb] r236825 - Fix -var-create for undefined variables (MI)

Ilia K ki.stfu at gmail.com
Fri May 8 03:58:45 PDT 2015


Author: ki.stfu
Date: Fri May  8 05:58:45 2015
New Revision: 236825

URL: http://llvm.org/viewvc/llvm-project?rev=236825&view=rev
Log:
Fix -var-create for undefined variables (MI)


Modified:
    lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py
    lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp

Modified: lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py?rev=236825&r1=236824&r2=236825&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py (original)
+++ lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py Fri May  8 05:58:45 2015
@@ -32,7 +32,7 @@ class MiVarTestCase(lldbmi_testcase.MiTe
 
         # Print non-existant variable
         self.runCmd("-var-create var1 * undef")
-        #self.expect("\^error") #FIXME: shows undef as {...}
+        self.expect("\^error,msg=\"Failed to create variable object for 'undef'\"")
         self.runCmd("-data-evaluate-expression undef")
         self.expect("\^error,msg=\"Could not evaluate expression\"")
 

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp?rev=236825&r1=236824&r2=236825&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp Fri May  8 05:58:45 2015
@@ -197,7 +197,7 @@ CMICmdCmdVarCreate::Execute(void)
     if (!value.IsValid())
         value = frame.EvaluateExpression(rStrExpression.c_str());
 
-    if (value.IsValid())
+    if (value.IsValid() && value.GetError().Success())
     {
         CompleteSBValue(value);
         m_bValid = true;





More information about the lldb-commits mailing list