[Lldb-commits] [lldb] r204170 - Fix expression parsing (on FreeBSD, at least)

2014-03-18 Thread Ed Maste
Author: emaste
Date: Tue Mar 18 13:55:06 2014
New Revision: 204170

URL: http://llvm.org/viewvc/llvm-project?rev=204170view=rev
Log:
Fix expression parsing (on FreeBSD, at least)

This reverts part of r204112 (Expression: cleanup unused include).
It looks like MCJIT.h is required to force MCJIT to be linked.

Modified:
lldb/trunk/source/Expression/ClangExpressionParser.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=204170r1=204169r2=204170view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Mar 18 13:55:06 
2014
@@ -55,6 +55,7 @@
 #include llvm/Support/FileSystem.h
 #include llvm/Support/TargetSelect.h
 
+#include llvm/ExecutionEngine/MCJIT.h
 #include llvm/IR/LLVMContext.h
 #include llvm/IR/Module.h
 #include llvm/Support/ErrorHandling.h


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r204206 - Expected failure printing std::string::c_str() due to flubbing the typedef lookup.

2014-03-18 Thread Jim Ingham
Author: jingham
Date: Tue Mar 18 19:30:31 2014
New Revision: 204206

URL: http://llvm.org/viewvc/llvm-project?rev=204206view=rev
Log:
Expected failure printing std::string::c_str() due to flubbing the typedef 
lookup.

Modified:

lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py

Modified: 
lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py?rev=204206r1=204205r2=204206view=diff
==
--- 
lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py 
(original)
+++ 
lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py 
Tue Mar 18 19:30:31 2014
@@ -20,6 +20,7 @@ class ExprCommandCallFunctionTestCase(Te
 
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dsym_test
+@expectedFailureDarwin(16361880) # rdar://problem/16361880, we get the 
result correctly, but fail to invoke the Summary formatter.
 def test_with_dsym(self):
 Test calling std::String member function.
 self.buildDsym()
@@ -29,6 +30,7 @@ class ExprCommandCallFunctionTestCase(Te
 @expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot
 @expectedFailureGcc # llvm.org/pr14437, fails with GCC 4.6.3 and 4.7.2
 @expectedFailureIcc # llvm.org/pr14437, fails with ICC 13.1
+@expectedFailureDarwin(16361880) # rdar://problem/16361880, we get the 
result correctly, but fail to invoke the Summary formatter.
 def test_with_dwarf(self):
 Test calling std::String member function.
 self.buildDwarf()
@@ -46,12 +48,8 @@ class ExprCommandCallFunctionTestCase(Te
 self.expect(print str,
 substrs = ['Hello world'])
 
-# Should be fixed with r142717.
-#
-# rdar://problem/9471744 test failure: ./dotest.py -C clang -v -w -t 
-p CallStdString
-# runCmd: print str.c_str()
-# runCmd failed!
-# error: Couldn't convert the expression to DWARF
+# Calling this function now succeeds, but we follow the typedef return 
type through to
+# const char *, and thus don't invoke the Summary formatter.
 self.expect(print str.c_str(),
 substrs = ['Hello world'])
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r204208 - Don't use the Disassembly test to report the fact that we don't decorate up

2014-03-18 Thread Jim Ingham
Author: jingham
Date: Tue Mar 18 20:41:19 2014
New Revision: 204208

URL: http://llvm.org/viewvc/llvm-project?rev=204208view=rev
Log:
Don't use the Disassembly test to report the fact that we don't decorate up
constructors with their class name, that seems inessential.  We can make another
test specifically for this if we want to.

Modified:
lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py?rev=204208r1=204207r2=204208view=diff
==
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py Tue Mar 
18 20:41:19 2014
@@ -57,18 +57,21 @@ class IterateFrameAndDisassembleTestCase
 self.runCmd(file  + exe, CURRENT_EXECUTABLE_SET)
 
 # Break on the ctor function of class C.
-lldbutil.run_break_set_by_file_and_line (self, main.cpp, self.line, 
num_expected_locations=-1)
+bpno = lldbutil.run_break_set_by_file_and_line (self, main.cpp, 
self.line, num_expected_locations=-1)
 
 self.runCmd(run, RUN_SUCCEEDED)
 
 # The stop reason of the thread should be breakpoint.
 self.expect(thread list, STOPPED_DUE_TO_BREAKPOINT,
 substrs = ['stopped',
-   'stop reason = breakpoint'])
+   'stop reason = breakpoint %d.'%(bpno)])
 
+# This test was failing because we fail to put the C:: in front of 
constructore.
+# We should maybe make another testcase to cover that specifically, 
but we shouldn't
+# fail this whole testcase for an inessential issue.
 # We should be stopped on the ctor function of class C.
-self.expect(thread backtrace, BACKTRACE_DISPLAYED_CORRECTLY,
-substrs = ['C::C'])
+# self.expect(thread backtrace, BACKTRACE_DISPLAYED_CORRECTLY,
+#  substrs = ['C::C'])
 
 def disassemble_call_stack(self):
 Disassemble each call frame when stopped on C's constructor.


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r204209 - Add a test to check the C's constructor's name is C::C, which will fail everywhere now,

2014-03-18 Thread Jim Ingham
Author: jingham
Date: Tue Mar 18 20:54:41 2014
New Revision: 204209

URL: http://llvm.org/viewvc/llvm-project?rev=204209view=rev
Log:
Add a test to check the C's constructor's name is C::C, which will fail 
everywhere now,
so mark as expected fail.  And find another way to check that we hit our 
constructor
breakpoint, so we don't need to expected fail the Disassembly tests.

Modified:
lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py?rev=204209r1=204208r2=204209view=diff
==
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py Tue Mar 18 20:54:41 
2014
@@ -10,6 +10,7 @@ import lldbutil
 class ClassTypesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+failing_compilers = ['clang', 'gcc']
 
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dsym_test
@@ -59,6 +60,27 @@ class ClassTypesTestCase(TestBase):
 self.buildDwarf()
 self.class_types_expr_parser()
 
+@unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
+# rdar://problem/8557478
+# test/class_types test failures: runCmd: expr this-m_c_int
+@dsym_test
+@expectedFailureDarwin(16362674)
+def test_with_dsym_and_constructor_name(self):
+Test 'frame variable this' and 'expr this' when stopped inside a 
constructor.
+self.buildDsym()
+self.class_types_constructor_name()
+
+# rdar://problem/8557478
+# test/class_types test failures: runCmd: expr this-m_c_int
+@dwarf_test
+@expectedFailureFreeBSD('llvm.org/pr14540')
+@expectedFailureLinux('llvm.org/pr14540', failing_compilers)
+@expectedFailureDarwin(16362674)
+def test_with_dwarf_and_constructor_name (self):
+Test 'frame variable this' and 'expr this' when stopped inside a 
constructor.
+self.buildDwarf()
+self.class_types_constructor_name()
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -206,6 +228,55 @@ class ClassTypesTestCase(TestBase):
 patterns = ['\(int\) \$[0-9]+ = 66'])
 
 
+def class_types_constructor_name (self):
+Check whether the constructor name has the class name prepended.
+exe = os.path.join(os.getcwd(), a.out)
+
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+filespec = target.GetExecutable()
+self.assertTrue(filespec, VALID_FILESPEC)
+
+fsDir = filespec.GetDirectory()
+fsFile = filespec.GetFilename()
+
+self.assertTrue(fsDir == os.getcwd() and fsFile == a.out,
+FileSpec matches the executable)
+
+bpfilespec = lldb.SBFileSpec(main.cpp, False)
+
+breakpoint = target.BreakpointCreateByLocation(bpfilespec, self.line)
+self.assertTrue(breakpoint, VALID_BREAKPOINT)
+
+# Verify the breakpoint just created.
+self.expect(str(breakpoint), BREAKPOINT_CREATED, exe=False,
+substrs = ['main.cpp',
+   str(self.line)])
+
+# Now launch the process, and do not stop at entry point.
+process = target.LaunchSimple (None, None, 
self.get_process_working_directory())
+
+if not process:
+self.fail(SBTarget.Launch() failed)
+
+if process.GetState() != lldb.eStateStopped:
+self.fail(Process should be in the 'stopped' state, 
+  instead the actual state is: '%s' %
+  lldbutil.state_type_to_str(process.GetState()))
+
+# The stop reason of the thread should be breakpoint.
+thread = process.GetThreadAtIndex(0)
+if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
+from lldbutil import stop_reason_to_str
+self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
+  stop_reason_to_str(thread.GetStopReason()))
+
+frame = thread.frames[0]
+self.assertTrue (frame.IsValid(), Got a valid frame.)
+
+self.assertTrue (C::C in frame.name, Constructor name includes 
class name.)
+
 if __name__ == '__main__':
 import atexit
 lldb.SBDebugger.Initialize()

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py?rev=204209r1=204208r2=204209view=diff
==
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py Tue Mar 
18