diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 | 
| commit | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch) | |
| tree | dd2a1ddf0476664c2b823409c36cbccd52662ca7 /packages/Python/lldbsuite/test/expression_command/radar_9531204 | |
| parent | 3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/expression_command/radar_9531204')
3 files changed, 72 insertions, 0 deletions
| diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9531204/Makefile b/packages/Python/lldbsuite/test/expression_command/radar_9531204/Makefile new file mode 100644 index 000000000000..0d70f2595019 --- /dev/null +++ b/packages/Python/lldbsuite/test/expression_command/radar_9531204/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py new file mode 100644 index 000000000000..fb16d2a93326 --- /dev/null +++ b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py @@ -0,0 +1,42 @@ +""" +The evaluating printf(...) after break stop and then up a stack frame. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + +class Radar9531204TestCase(TestBase): + +    mydir = TestBase.compute_mydir(__file__) + +    # rdar://problem/9531204 +    @expectedFailureWindows("llvm.org/pr21765") +    def test_expr_commands(self): +        """The evaluating printf(...) after break stop and then up a stack frame.""" +        self.build() + +        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + +        lldbutil.run_break_set_by_symbol (self, 'foo', sym_exact=True, num_expected_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)') diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9531204/main.c b/packages/Python/lldbsuite/test/expression_command/radar_9531204/main.c new file mode 100644 index 000000000000..2bf05f2b3065 --- /dev/null +++ b/packages/Python/lldbsuite/test/expression_command/radar_9531204/main.c @@ -0,0 +1,25 @@ +//===-- 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); +  return 0; +} + +int main (int argc, char **argv) +{ +  foo (argc); +  printf ("Hello there: %d.\n", argc); +  return 0; +} | 
