[Lldb-commits] [lldb] r226730 - Speed these tests up quite significantly by using the SB API instead of running the "continue" command at each step
Enrico Granata
egranata at apple.com
Wed Jan 21 14:51:59 PST 2015
Author: enrico
Date: Wed Jan 21 16:51:59 2015
New Revision: 226730
URL: http://llvm.org/viewvc/llvm-project?rev=226730&view=rev
Log:
Speed these tests up quite significantly by using the SB API instead of running the "continue" command at each step
The reason why one mechanism is so much faster than the other (as in, ~10 seconds vs. ~1 minute) is quite baffling to me at the moment, but these are not process handling tests, so do what's faster
Modified:
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile Wed Jan 21 16:51:59 2015
@@ -3,6 +3,3 @@ LEVEL = ../../../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py Wed Jan 21 16:51:59 2015
@@ -34,7 +34,7 @@ class LibcxxMapDataFormatterTestCase(Tes
"""Test that that file and class static variables display correctly."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
@@ -56,14 +56,12 @@ class LibcxxMapDataFormatterTestCase(Tes
self.addTearDownHook(cleanup)
self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
- self.runCmd("frame variable ii --show-types")
self.expect('frame variable ii',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
substrs = ['size=2',
@@ -74,7 +72,7 @@ class LibcxxMapDataFormatterTestCase(Tes
'first = 1',
'second = 1'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
substrs = ['size=4',
@@ -85,7 +83,7 @@ class LibcxxMapDataFormatterTestCase(Tes
'first = 3',
'second = 1'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
substrs = ['size=8',
@@ -129,8 +127,6 @@ class LibcxxMapDataFormatterTestCase(Tes
self.expect('frame variable ii',
substrs = ['size=0',
'{}'])
-
- self.runCmd("frame variable si --show-types")
self.expect('frame variable si',
substrs = ['size=0',
@@ -144,7 +140,7 @@ class LibcxxMapDataFormatterTestCase(Tes
'first = \"zero\"',
'second = 0'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
substrs = ['size=4',
@@ -192,20 +188,19 @@ class LibcxxMapDataFormatterTestCase(Tes
#self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
- self.runCmd("frame variable is --show-types")
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
substrs = ['size=4',
@@ -253,20 +248,19 @@ class LibcxxMapDataFormatterTestCase(Tes
#self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
- self.runCmd("frame variable ss --show-types")
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
substrs = ['size=3',
@@ -307,7 +301,7 @@ class LibcxxMapDataFormatterTestCase(Tes
#self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
substrs = ['size=0',
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp Wed Jan 21 16:51:59 2015
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <map>
#define intint_map std::map<int, int>
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile Wed Jan 21 16:51:59 2015
@@ -3,6 +3,3 @@ LEVEL = ../../../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0 -std=c++11
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py Wed Jan 21 16:51:59 2015
@@ -34,7 +34,7 @@ class LibcxxMultiMapDataFormatterTestCas
"""Test that that file and class static variables display correctly."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
@@ -56,14 +56,12 @@ class LibcxxMultiMapDataFormatterTestCas
self.addTearDownHook(cleanup)
self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
- self.runCmd("frame variable ii --show-types")
self.expect('frame variable ii',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
substrs = ['size=2',
@@ -74,7 +72,7 @@ class LibcxxMultiMapDataFormatterTestCas
'first = 1',
'second = 1'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
substrs = ['size=4',
@@ -85,7 +83,7 @@ class LibcxxMultiMapDataFormatterTestCas
'first = 3',
'second = 1'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
substrs = ['size=8',
@@ -124,19 +122,17 @@ class LibcxxMultiMapDataFormatterTestCas
#self.expect("expression ii[8]", matching=False, error=True,
# substrs = ['1234567'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
substrs = ['size=0',
'{}'])
-
- self.runCmd("frame variable si --show-types")
self.expect('frame variable si',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
substrs = ['size=1',
@@ -144,7 +140,7 @@ class LibcxxMultiMapDataFormatterTestCas
'first = \"zero\"',
'second = 0'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
substrs = ['size=4',
@@ -192,20 +188,19 @@ class LibcxxMultiMapDataFormatterTestCas
#self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
- self.runCmd("frame variable is --show-types")
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
substrs = ['size=4',
@@ -253,20 +248,19 @@ class LibcxxMultiMapDataFormatterTestCas
#self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
- self.runCmd("frame variable ss --show-types")
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
substrs = ['size=0',
'{}'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
substrs = ['size=3',
@@ -307,7 +301,7 @@ class LibcxxMultiMapDataFormatterTestCas
#self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
- self.runCmd("continue");
+ lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
substrs = ['size=0',
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp?rev=226730&r1=226729&r2=226730&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp Wed Jan 21 16:51:59 2015
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <map>
#define intint_map std::multimap<int, int>
More information about the lldb-commits
mailing list