diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-07-28 23:17:20 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-07-28 23:17:20 +0000 |
commit | b15c1dbfa1c79c667afce651dc98f68f138e950e (patch) | |
tree | 607850675786e2506711252749aac045496e22a0 | |
parent | 8b068943a4f0d7edb3dc8aa00e03cba939193756 (diff) | |
download | bcm5719-llvm-b15c1dbfa1c79c667afce651dc98f68f138e950e.tar.gz bcm5719-llvm-b15c1dbfa1c79c667afce651dc98f68f138e950e.zip |
Add regression test for rdar://problem/9531204.
llvm-svn: 136425
3 files changed, 76 insertions, 0 deletions
diff --git a/lldb/test/expression_command/radar_9531204/Makefile b/lldb/test/expression_command/radar_9531204/Makefile new file mode 100644 index 00000000000..0d70f259501 --- /dev/null +++ b/lldb/test/expression_command/radar_9531204/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules diff --git a/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py new file mode 100644 index 00000000000..4e0282fa17c --- /dev/null +++ b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py @@ -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() diff --git a/lldb/test/expression_command/radar_9531204/main.c b/lldb/test/expression_command/radar_9531204/main.c new file mode 100644 index 00000000000..d50c53b3c65 --- /dev/null +++ b/lldb/test/expression_command/radar_9531204/main.c @@ -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; +} |