From 14f1b3e8826ce43b978db93a62d1166055db5394 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:26:05 +0000 Subject: Vendor import of lldb trunk r290819: https://llvm.org/svn/llvm-project/lldb/trunk@290819 --- .../frame-diagnose/local-variable/Makefile | 5 +++++ .../local-variable/TestLocalVariable.py | 26 ++++++++++++++++++++++ .../frame-diagnose/local-variable/main.c | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/Makefile create mode 100644 packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py create mode 100644 packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/main.c (limited to 'packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable') diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/Makefile b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/Makefile new file mode 100644 index 000000000000..b09a579159d4 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py new file mode 100644 index 000000000000..a1a17c941760 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py @@ -0,0 +1,26 @@ +""" +Test the output of `frame diagnose` for dereferencing a local variable +""" + +from __future__ import print_function + +import os +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestLocalVariable(TestBase): + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + def test_local_variable(self): + TestBase.setUp(self) + self.build() + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + self.runCmd("run", RUN_SUCCEEDED) + self.expect("thread list", "Thread should be stopped", + substrs=['stopped']) + self.expect("frame diagnose", "Crash diagnosis was accurate", "myInt") diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/main.c b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/main.c new file mode 100644 index 000000000000..33307beb0703 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/main.c @@ -0,0 +1,4 @@ +int main() { + int *myInt = 0; + return *myInt; +} -- cgit v1.2.3