[Lldb-commits] [lldb] r136785 - in /lldb/trunk: source/Core/Module.cpp test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py test/functionalities/data-formatter/data-formatter-advanced/main.cpp

Enrico Granata granata.enrico at gmail.com
Wed Aug 3 09:23:33 PDT 2011


Author: enrico
Date: Wed Aug  3 11:23:33 2011
New Revision: 136785

URL: http://llvm.org/viewvc/llvm-project?rev=136785&view=rev
Log:
testing for a previous issue where formats in summaries where not enforced in all cases ; removed an unused local variable

Modified:
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/main.cpp

Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=136785&r1=136784&r2=136785&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Wed Aug  3 11:23:33 2011
@@ -700,7 +700,6 @@
         if (sections != NULL)
         {
             size_t num_sections = sections->GetSize();
-            bool loaded = false;
             for (size_t sect_idx = 0; sect_idx < num_sections; sect_idx++)
             {
                 SectionSP section_sp = sections->GetSectionAtIndex(sect_idx);

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=136785&r1=136784&r2=136785&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Wed Aug  3 11:23:33 2011
@@ -171,6 +171,24 @@
         self.expect("frame variable sparray",
             substrs = ['[0x0000000f,0x0000000c,0x00000009]'])
         
+        # check that we can format a variable in a summary even if a format is defined for its datatype
+        self.runCmd("type format add -f hex int")
+        self.runCmd("type summary add -f \"x=${var.x%i}\" Simple")
+
+        self.expect("frame variable a_simple_object",
+            substrs = ['x=3'])
+
+        self.expect("frame variable a_simple_object", matching=False,
+                    substrs = ['0x0'])
+
+        # now check that the default is applied if we do not hand out a format
+        self.runCmd("type summary add -f \"x=${var.x}\" Simple")
+
+        self.expect("frame variable a_simple_object", matching=False,
+                    substrs = ['x=3'])
+
+        self.expect("frame variable a_simple_object", matching=True,
+                    substrs = ['x=0x00000003'])
 
 
 if __name__ == '__main__':

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/main.cpp?rev=136785&r1=136784&r2=136785&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/main.cpp Wed Aug  3 11:23:33 2011
@@ -106,5 +106,7 @@
         SimpleWithPointers(-4,-5,'6'),
         SimpleWithPointers(-7,-8,'9')};
     
+    Simple a_simple_object(3,0.14,'E');
+    
     return 0; // Set break point at this line.
 }
\ No newline at end of file





More information about the lldb-commits mailing list