[Lldb-commits] [lldb] r136425 - in /lldb/trunk/test/expression_command/radar_9531204: ./ Makefile TestPrintfAfterUp.py main.c
Johnny Chen
johnny.chen at apple.com
Thu Jul 28 16:17:20 PDT 2011
Author: johnny
Date: Thu Jul 28 18:17:20 2011
New Revision: 136425
URL: http://llvm.org/viewvc/llvm-project?rev=136425&view=rev
Log:
Add regression test for rdar://problem/9531204.
Added:
lldb/trunk/test/expression_command/radar_9531204/
lldb/trunk/test/expression_command/radar_9531204/Makefile
lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
lldb/trunk/test/expression_command/radar_9531204/main.c
Added: lldb/trunk/test/expression_command/radar_9531204/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9531204/Makefile?rev=136425&view=auto
==============================================================================
--- lldb/trunk/test/expression_command/radar_9531204/Makefile (added)
+++ lldb/trunk/test/expression_command/radar_9531204/Makefile Thu Jul 28 18:17:20 2011
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
Added: lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py?rev=136425&view=auto
==============================================================================
--- lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py (added)
+++ lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py Thu Jul 28 18:17:20 2011
@@ -0,0 +1,47 @@
+"""
+The evaluating printf(...) after break stop and then up a stack frame.
+"""
+
+import os, time
+import unittest2
+import lldb
+from lldbtest import *
+
+class Radar9531204TestCase(TestBase):
+
+ mydir = os.path.join("expression_command", "radar_9531204")
+
+ # rdar://problem/9531204
+ @unittest2.expectedFailure
+ def test_expr_commands(self):
+ """The evaluating printf(...) after break stop and then up a stack frame."""
+ self.buildDefault()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ self.expect("breakpoint set -n foo",
+ BREAKPOINT_CREATED,
+ startstr = "Breakpoint created: 1: name = 'foo', locations = 1")
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ self.runCmd("frame variable")
+
+ # This works fine.
+ self.runCmd('expression (int)printf("value is: %d.\\n", value);')
+
+ # rdar://problem/9531204
+ # "Error dematerializing struct" error when evaluating expressions "up" on the stack
+ self.runCmd('up') # frame select -r 1
+
+ self.runCmd("frame variable")
+
+ # This does not currently.
+ self.runCmd('expression (int)printf("argc is: %d.\\n", argc)')
+
+
+if __name__ == '__main__':
+ import atexit
+ lldb.SBDebugger.Initialize()
+ atexit.register(lambda: lldb.SBDebugger.Terminate())
+ unittest2.main()
Added: lldb/trunk/test/expression_command/radar_9531204/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9531204/main.c?rev=136425&view=auto
==============================================================================
--- lldb/trunk/test/expression_command/radar_9531204/main.c (added)
+++ lldb/trunk/test/expression_command/radar_9531204/main.c Thu Jul 28 18:17:20 2011
@@ -0,0 +1,24 @@
+//===-- main.c --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdio.h>
+
+// breakpoint set -n foo
+//
+//
+int foo (int value)
+{
+ printf ("I got the value: %d.\n", value);
+}
+
+int main (int argc, char **argv)
+{
+ foo (argc);
+ printf ("Hello there: %d.\n", argc);
+ return 0;
+}
More information about the lldb-commits
mailing list