diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 73 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/Makefile new file mode 100644 index 00000000000..b09a579159d --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/TestGdbRemoteReproducer.py b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/TestGdbRemoteReproducer.py new file mode 100644 index 00000000000..adbbd1be645 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/TestGdbRemoteReproducer.py @@ -0,0 +1,49 @@ +""" +Test the GDB remote reproducer. +""" + +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 TestGdbRemoteReproducer(TestBase): + + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True + + def test(self): + """Test record and replay of gdb-remote packets.""" + self.build() + + # Create temp directory for the reproducer. + exe = self.getBuildArtifact("a.out") + + # First capture a regular debugging session. + self.runCmd("reproducer capture enable") + + reproducer_path = self.dbg.GetReproducerPath() + + self.runCmd("file {}".format(exe)) + self.runCmd("breakpoint set -f main.c -l 13") + self.runCmd("run") + self.runCmd("bt") + self.runCmd("cont") + + # Generate the reproducer and stop capturing. + self.runCmd("reproducer generate") + self.runCmd("reproducer capture disable") + + # Replay the session from the reproducer. + self.runCmd("reproducer replay {}".format(reproducer_path)) + + # We have to issue the same commands. + self.runCmd("file {}".format(exe)) + self.runCmd("breakpoint set -f main.c -l 13") + self.runCmd("run") + self.runCmd("bt") + self.expect("cont") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/main.c b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/main.c new file mode 100644 index 00000000000..a4585b380ca --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/reproducer/gdb-remote/main.c @@ -0,0 +1,19 @@ +//===-- 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> + +void foo() { + printf("testing\n"); +} + +int main (int argc, char const *argv[]) { + foo(); + return 0; +} |