[Lldb-commits] [lldb] r119445 - in /lldb/trunk/test: lldbtest.py namespace/TestNamespace.py plugins/darwin.py
Johnny Chen
johnny.chen at apple.com
Tue Nov 16 16:52:41 PST 2010
Author: johnny
Date: Tue Nov 16 18:52:41 2010
New Revision: 119445
URL: http://llvm.org/viewvc/llvm-project?rev=119445&view=rev
Log:
Make the string matching for 'frame variable' more stringent with respect to
output from clang and llvm-gcc compiled program; both generate the correct debug
info with respect to the typedef scoped inside a namespace.
Add a TestBase.getCompiler(self) method which returns the compiler in effect the
test suite is now running with. Subclasses (like TestNamespace) can use it to
distinguish among different compilers.
Modified:
lldb/trunk/test/lldbtest.py
lldb/trunk/test/namespace/TestNamespace.py
lldb/trunk/test/plugins/darwin.py
Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=119445&r1=119444&r2=119445&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Tue Nov 16 18:52:41 2010
@@ -808,11 +808,16 @@
# End of while loop.
+ def getCompiler(self):
+ """Returns the compiler in effect the test suite is now running with."""
+ module = __import__(sys.platform)
+ return module.getCompiler()
+
def getRunSpec(self):
"""Environment variable spec to run this test again, invoked from within
dumpSessionInfo()."""
module = __import__(sys.platform)
- return module.getRunSpec()
+ return module.getRunSpec()
def buildDefault(self, architecture=None, compiler=None, dictionary=None):
"""Platform specific way to build the default binaries."""
Modified: lldb/trunk/test/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/namespace/TestNamespace.py?rev=119445&r1=119444&r2=119445&view=diff
==============================================================================
--- lldb/trunk/test/namespace/TestNamespace.py (original)
+++ lldb/trunk/test/namespace/TestNamespace.py Tue Nov 16 18:52:41 2010
@@ -54,17 +54,18 @@
substrs = ['state is stopped',
'stop reason = breakpoint'])
- # rdar://problem/8668740
- # 'frame variable' output for namespace variables look wrong
- # (lldb) frame variable
- # (int) a = 12
- # (A::B::uint_t) anon_uint = 0
- # (A::B::uint_t) a_uint = 1
- # (A::B::uint_t) b_uint = 2
- # (A::B::uint_t) y_uint = 3
- # (lldb)
+ # On Mac OS X, gcc 4.2 emits the wrong debug info with respect to types.
+ slist = ['(int) a = 12', 'anon_uint', 'a_uint', 'b_uint', 'y_uint']
+ if sys.platform.startswith("darwin") and self.getCompiler() in ['clang', 'llvm-gcc']:
+ slist = ['(int) a = 12',
+ '(my_uint_t) anon_uint = 0',
+ '(A::uint_t) a_uint = 1',
+ '(A::B::uint_t) b_uint = 2',
+ '(Y::uint_t) y_uint = 3']
+
+ # 'frame variable' displays the local variables with type information.
self.expect('frame variable', VARIABLES_DISPLAYED_CORRECTLY,
- substrs = [''])
+ substrs = slist)
# 'frame variable' with basename 'i' should work.
self.expect("frame variable -c -G i",
Modified: lldb/trunk/test/plugins/darwin.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/darwin.py?rev=119445&r1=119444&r2=119445&view=diff
==============================================================================
--- lldb/trunk/test/plugins/darwin.py (original)
+++ lldb/trunk/test/plugins/darwin.py Tue Nov 16 18:52:41 2010
@@ -17,6 +17,10 @@
#print "Hello, darwin plugin!"
+def getCompiler():
+ """Returns the compiler in effect the test suite is now running with."""
+ return os.environ["CC"] if "CC" in os.environ else ""
+
def getRunSpec():
"""Environment variable spec to run this test again, invoked from within
dumpSessionInfo()."""
More information about the lldb-commits
mailing list