[Lldb-commits] [lldb] r129871 - /lldb/trunk/test/source-manager/TestSourceManager.py
Johnny Chen
johnny.chen at apple.com
Wed Apr 20 13:36:00 PDT 2011
Author: johnny
Date: Wed Apr 20 15:35:59 2011
New Revision: 129871
URL: http://llvm.org/viewvc/llvm-project?rev=129871&view=rev
Log:
Add a test scenario for 'source list -b' which shows the line table locations from
the debug information which indicates valid places to set source level breakpoints.
Modified:
lldb/trunk/test/source-manager/TestSourceManager.py
Modified: lldb/trunk/test/source-manager/TestSourceManager.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/source-manager/TestSourceManager.py?rev=129871&r1=129870&r2=129871&view=diff
==============================================================================
--- lldb/trunk/test/source-manager/TestSourceManager.py (original)
+++ lldb/trunk/test/source-manager/TestSourceManager.py Wed Apr 20 15:35:59 2011
@@ -86,13 +86,28 @@
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
- 'main.c',
+ 'main.c:%d' % self.line,
'stop reason = breakpoint'])
# Display some source code.
self.expect("list -f main.c -l %d" % self.line, SOURCE_DISPLAYED_CORRECTLY,
substrs = ['Hello world'])
+ # The '-b' option shows the line table locations from the debug information
+ # that indicates valid places to set source level breakpoints.
+
+ # The file to display is implicit in this case.
+ self.runCmd("list -l %d -c 3 -b" % self.line)
+ output = self.res.GetOutput().splitlines()[0]
+
+ # If the breakpoint set command succeeded, we should expect a positive number
+ # of breakpoints for the current line, i.e., self.line.
+ import re
+ m = re.search('^\[(\d+)\].*// Set break point at this line.', output)
+ if not m:
+ self.fail("Fail to display source level breakpoints")
+ self.assertTrue(int(m.group(1)) > 0)
+
# Read the main.c file content.
with open('main.c', 'r') as f:
original_content = f.read()
More information about the lldb-commits
mailing list