o lldbutil.py:
For the print_stacktrace(thread, string_buffer = False) function, if we have debug info
for a frame function, let's also emit the args for the current function.
o TestFrameUtils.py:
Add stronger assertTrue for frame0's args.
o TestPrintStackTraces.py:
Launch the inferior with ["abc", "xyz"] and expect '(int)argc=3' in the stack traces, since
by design the inferior is built with debug info.
llvm-svn: 133204
diff --git a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
index 1fd337a..d980aba 100644
--- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
@@ -48,7 +48,7 @@
self.assertTrue(parent and parent.GetFrameID() == frame1.GetFrameID())
frame0_args = lldbutil.get_args_as_string(frame0)
parent_args = lldbutil.get_args_as_string(parent)
- self.assertTrue(frame0_args and parent_args)
+ self.assertTrue(frame0_args and parent_args and "(int)val=1" in frame0_args)
if self.TraceOn():
lldbutil.print_stacktrace(thread)
print "Current frame: %s" % frame0_args
diff --git a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
index 8995072..0e65219 100644
--- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
+++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -35,7 +35,7 @@
# Now launch the process, and do not stop at entry point.
rc = lldb.SBError()
- process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+ process = target.Launch (self.dbg.GetListener(), ["abc", "xyz"], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
if not rc.Success() or not process:
self.fail("SBTarget.LaunchProcess() failed")
@@ -46,8 +46,9 @@
"instead the actual state is: '%s'" %
lldbutil.state_type_to_str(process.GetState()))
- if self.TraceOn():
- lldbutil.print_stacktraces(process)
+ stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
+ self.expect(stacktraces, exe=False,
+ substrs = ['(int)argc=3'])
if __name__ == '__main__':