[Lldb-commits] [lldb] r220414 - Fix a problem where summary strings could not use a synthetically generated value as part of themselves

Enrico Granata egranata at apple.com
Wed Oct 22 13:14:09 PDT 2014


Author: enrico
Date: Wed Oct 22 15:14:09 2014
New Revision: 220414

URL: http://llvm.org/viewvc/llvm-project?rev=220414&view=rev
Log:
Fix a problem where summary strings could not use a synthetically generated value as part of themselves

Modified:
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=220414&r1=220413&r2=220414&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 22 15:14:09 2014
@@ -1802,6 +1802,7 @@ FormatPromptRecurse
                                             log->Printf("[Debugger::FormatPrompt] ALL RIGHT: unparsed portion = %s, why stopping = %d,"
                                                " final_value_type %d",
                                                first_unparsed, reason_to_stop, final_value_type);
+                                        target = target->GetQualifiedRepresentationIfAvailable(target->GetDynamicValueType(), true).get();
                                     }
                                 }
                                 else

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py?rev=220414&r1=220413&r2=220414&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py Wed Oct 22 15:14:09 2014
@@ -90,6 +90,11 @@ class DataFormatterSynthValueTestCase(Te
         
         # check that an aptly defined synthetic provider does not affect one-lining
         self.expect("expression struct S { myInt theInt{12}; }; S()", substrs = ['(theInt = 12)'])
+        
+        # check that we can use a synthetic value in a summary
+        self.runCmd("type summary add hasAnInt -s ${var.theInt}")
+        hi = self.frame().FindVariable("hi")
+        self.assertEqual(hi.GetSummary(), "42")
 
 if __name__ == '__main__':
     import atexit

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp?rev=220414&r1=220413&r2=220414&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/main.cpp Wed Oct 22 15:14:09 2014
@@ -5,11 +5,18 @@ class myInt {
     int val() { return theValue; }
 };
 
+class hasAnInt {
+    public:
+        myInt theInt;
+        hasAnInt() : theInt(42) {}  
+};
+
 myInt operator + (myInt x, myInt y) { return myInt(x.val() + y.val()); }
 
 int main() {
     myInt x{3};
     myInt y{4};
     myInt z {x+y};
+    hasAnInt hi;
     return z.val(); // break here
 }





More information about the lldb-commits mailing list