diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
commit | 14f1b3e8826ce43b978db93a62d1166055db5394 (patch) | |
tree | 0a00ad8d3498783fe0193f3b656bca17c4c8697d /packages/Python/lldbsuite/test/functionalities/frame-diagnose/array | |
parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/frame-diagnose/array')
3 files changed, 43 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/Makefile b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/Makefile new file mode 100644 index 0000000000000..b09a579159d48 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/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/array/TestArray.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py new file mode 100644 index 0000000000000..46264f3dfe8d0 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py @@ -0,0 +1,29 @@ +""" +Test the output of `frame diagnose` for an array access +""" + +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 TestArray(TestBase): + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + def test_array(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", + substrs=["a[10]"]) diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/main.c b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/main.c new file mode 100644 index 0000000000000..95c6515e5f54e --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/main.c @@ -0,0 +1,9 @@ +struct Foo { + int b; + int c; +}; + +int main() { + struct Foo *a = 0; + return a[10].c; +} |