[Lldb-commits] [lldb] r155605 - in /lldb/trunk: examples/summaries/cocoa/NSDate.py source/Core/FormatManager.cpp test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py test/lang/objc/rdar-10967107/TestRdar10967107.py
Enrico Granata
egranata at apple.com
Wed Apr 25 18:40:38 PDT 2012
Author: enrico
Date: Wed Apr 25 20:40:38 2012
New Revision: 155605
URL: http://llvm.org/viewvc/llvm-project?rev=155605&view=rev
Log:
Automatically enabling the Cocoa formatter categories for command-line LLDB. Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing
Modified:
lldb/trunk/examples/summaries/cocoa/NSDate.py
lldb/trunk/source/Core/FormatManager.cpp
lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py
lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py
Modified: lldb/trunk/examples/summaries/cocoa/NSDate.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/summaries/cocoa/NSDate.py?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/examples/summaries/cocoa/NSDate.py (original)
+++ lldb/trunk/examples/summaries/cocoa/NSDate.py Wed Apr 25 20:40:38 2012
@@ -211,7 +211,7 @@
wrapper = NSTimeZoneClass_SummaryProvider(valobj, class_data.sys_params)
statistics.metric_hit('code_notrun',valobj)
else:
- wrapper = NSUnknownDate_SummaryProvider(valobj, class_data.sys_params)
+ wrapper = NSUnknownDate_SummaryProvider(valobj)
statistics.metric_hit('unknown_class',valobj.GetName() + " seen as " + name_string)
return wrapper;
Modified: lldb/trunk/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatManager.cpp (original)
+++ lldb/trunk/source/Core/FormatManager.cpp Wed Apr 25 20:40:38 2012
@@ -597,13 +597,13 @@
#endif
EnableCategory(m_objc_category_name,CategoryMap::Last);
- //EnableCategory(m_corefoundation_category_name,CategoryMap::Last);
- //EnableCategory(m_appkit_category_name,CategoryMap::Last);
- //EnableCategory(m_coreservices_category_name,CategoryMap::Last);
- //EnableCategory(m_coregraphics_category_name,CategoryMap::Last);
+ EnableCategory(m_corefoundation_category_name,CategoryMap::Last);
+ EnableCategory(m_appkit_category_name,CategoryMap::Last);
+ EnableCategory(m_coreservices_category_name,CategoryMap::Last);
+ EnableCategory(m_coregraphics_category_name,CategoryMap::Last);
EnableCategory(m_gnu_cpp_category_name,CategoryMap::Last);
EnableCategory(m_libcxx_category_name,CategoryMap::Last);
- //EnableCategory(m_vectortypes_category_name,CategoryMap::Last);
+ EnableCategory(m_vectortypes_category_name,CategoryMap::Last);
EnableCategory(m_system_category_name,CategoryMap::Last);
}
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Wed Apr 25 20:40:38 2012
@@ -127,17 +127,11 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("type category enable AppKit")
-
self.expect('frame variable italian', substrs = ['L\'Italia è una Repubblica democratica, fondata sul lavoro. La sovranità appartiene al popolo, che la esercita nelle forme e nei limiti della Costituzione.'])
self.expect('frame variable french', substrs = ['Que veut cette horde d\'esclaves, De traîtres, de rois conjurés?'])
self.expect('frame variable german', substrs = ['Ãber-Ich und aus den Ansprüchen der sozialen Umwelt'])
@@ -165,11 +159,6 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
-
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -227,16 +216,11 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# Now enable AppKit and check we are displaying Cocoa classes correctly
- self.runCmd("type category enable AppKit")
self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num8_Y num8_N num9',
substrs = ['(NSNumber *) num1 = ',' (int)5',
'(NSNumber *) num2 = ',' (float)3.1',
@@ -359,8 +343,6 @@
'@"Europe/Rome"',
'@"Europe/Paris"'])
-
- self.runCmd('type category list')
self.runCmd('type summary list')
self.expect('frame variable myclass',
substrs = ['(Class) myclass = NSValue'])
@@ -396,17 +378,10 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- # Now enable AppKit
- self.runCmd("type category enable AppKit")
-
# check that the formatters are able to deal safely and correctly
# with ValueObjects that the expression parser returns
self.expect('expression ((id)@"Hello")', matching=False,
@@ -449,10 +424,6 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
self.runCmd('log timers disable', check=False)
@@ -460,10 +431,6 @@
self.addTearDownHook(cleanup)
# check formatters for common Objective-C types
- self.runCmd('type category enable CoreFoundation')
- self.runCmd('type category enable CoreGraphics')
- self.runCmd('type category enable CoreServices')
- self.runCmd("type category enable AppKit")
self.runCmd("log timers enable")
self.expect("frame variable",
substrs = ['(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
@@ -514,18 +481,10 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
-
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- # check formatters for common Objective-C types
- self.runCmd('type category enable AppKit')
-
# as long as KVO is implemented by subclassing, this test should succeed
# we should be able to dynamically figure out that the KVO implementor class
# is a subclass of Molecule, and use the appropriate summary for it
Modified: lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py Wed Apr 25 20:40:38 2012
@@ -51,13 +51,10 @@
# clean slate for the next test case.
def cleanup():
self.runCmd('type summary clear', check=False)
- self.runCmd('type category disable VectorTypes', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd('type category enable VectorTypes')
-
self.expect('frame variable',
substrs = ['(vFloat) valueFL = (1, 0, 4, 0)',
'(int16_t [8]) valueI16 = (1, 0, 4, 0, 0, 1, 0, 4)',
Modified: lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py Wed Apr 25 20:40:38 2012
@@ -54,16 +54,11 @@
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('type category disable CoreFoundation', check=False)
- self.runCmd('type category disable CoreGraphics', check=False)
- self.runCmd('type category disable CoreServices', check=False)
- self.runCmd('type category disable AppKit', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- # Now enable AppKit and check we are displaying Cocoa classes correctly
- self.runCmd("type category enable AppKit")
+ # Now check that we are displaying Cocoa classes correctly
self.expect('frame variable key',
substrs = ['@"1 object"'])
self.expect('frame variable key', matching=False,
Modified: lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py?rev=155605&r1=155604&r2=155605&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py (original)
+++ lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py Wed Apr 25 20:40:38 2012
@@ -49,10 +49,10 @@
self.runCmd("run", RUN_SUCCEEDED)
# check that each type is correctly bound to its list of children
- self.expect("frame variable cf_greg_date", substrs = ['year','month','day','hour','minute','second'])
- self.expect("frame variable cf_range", substrs = ['location','length'])
+ self.expect("frame variable cf_greg_date --raw", substrs = ['year','month','day','hour','minute','second'])
+ self.expect("frame variable cf_range --raw", substrs = ['location','length'])
# check that printing both does not somehow confuse LLDB
- self.expect("frame variable", substrs = ['year','month','day','hour','minute','second','location','length'])
+ self.expect("frame variable --raw", substrs = ['year','month','day','hour','minute','second','location','length'])
if __name__ == '__main__':
import atexit
More information about the lldb-commits
mailing list