Index: lit/tools/lldb-mi/interpreter/cli-support/breakpoint-set.test =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/breakpoint-set.test @@ -0,0 +1,21 @@ +# XFAIL: windows +# -> llvm.org/pr24452 +# +# RUN: %cxx -o %t %p/inputs/main.cpp -g +# RUN: %lldbmi %t < %s | FileCheck %s + +# Test lldb-mi CLI support. 'breakpoint set' command. + +# Check that we have a valid target created via '%lldbmi %t'. +# CHECK: ^done + +breakpoint set --name main +# CHECK: ^done +# CHECK: =breakpoint-created,bkpt={number="1" + +-exec-run +# CHECK: ^running +# CHECK: =breakpoint-modified,bkpt={number="1" +# CHECK: *stopped,reason="breakpoint-hit" + +-gdb-exit Index: lit/tools/lldb-mi/interpreter/cli-support/inputs/main.cpp =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/inputs/main.cpp @@ -0,0 +1,19 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include + +int +main(int argc, char const *argv[]) +{ + printf("argc=%d\n", argc); + for (int i = 0; i < argc; ++i) + printf("argv[%d]=%s\n", i, argv[i]); + return 0; +} Index: lit/tools/lldb-mi/interpreter/cli-support/lit.local.cfg =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test'] Index: lit/tools/lldb-mi/interpreter/cli-support/settings-set-target-run-after.test =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/settings-set-target-run-after.test @@ -0,0 +1,21 @@ +# XFAIL: windows +# -> llvm.org/pr24452 +# +# RUN: %cxx -o %t %p/inputs/main.cpp -g +# RUN: %lldbmi %t < %s | FileCheck %s + +# Test lldb-mi CLI support. 'setting set target.run-args' command after than +# target was created. + +# Check that we have a valid target created via '%lldbmi %t'. +# CHECK: ^done + +# FIXME: --arg1 causes an error. +setting set target.run-args arg1 "2nd arg" third_arg fourth="4th arg" +# CHECK: ^done + +-exec-run +# CHECK: ^running +# CHECK: @"argc=5\r\n" + +-gdb-exit Index: lit/tools/lldb-mi/interpreter/cli-support/settings-set-target-run-before.test =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/settings-set-target-run-before.test @@ -0,0 +1,23 @@ +# XFAIL: windows +# -> llvm.org/pr24452 +# +# We should hardcode executable name since at the moment of running of +# lldb-mi the name must be known. +# RUN: %cxx -o a.exe %p/inputs/main.cpp -g +# RUN: %lldbmi < %s | FileCheck %s + +# Test lldb-mi CLI support. 'setting set target.run-args' command before than +# target was created. + +# FIXME: --arg1 causes an error. +setting set target.run-args arg1 "2nd arg" third_arg fourth="4th arg" +# CHECK: ^done + +-file-exec-and-symbols a.exe +# CHECK: ^done + +-exec-run +# CHECK: ^running +# CHECK: @"argc=5\r\n" + +-gdb-exit Index: lit/tools/lldb-mi/interpreter/cli-support/target-create.test =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/target-create.test @@ -0,0 +1,21 @@ +# XFAIL: windows +# -> llvm.org/pr24452 +# +# We should hardcode executable name since at the moment of running of +# lldb-mi the name must be known. +# RUN: %cxx -o a.exe %p/inputs/main.cpp -g +# RUN: %lldbmi < %s | FileCheck %s + +# Test lldb-mi CLI support. 'target create' command. + +target create a.exe +# CHECK: ^done + +-break-insert -f main +# CHECK: ^done,bkpt={number="1" + +-exec-run +# CHECK: ^running +# CHECK: *stopped,reason="breakpoint-hit" + +-gdb-exit Index: lit/tools/lldb-mi/interpreter/cli-support/target-list.test =================================================================== --- /dev/null +++ lit/tools/lldb-mi/interpreter/cli-support/target-list.test @@ -0,0 +1,20 @@ +# XFAIL: windows +# -> llvm.org/pr24452 +# +# We should hardcode executable name since at the moment of running of +# lldb-mi the name must be known. +# RUN: %cxx -o a.exe %p/inputs/main.cpp -g +# RUN: %lldbmi < %s | FileCheck %s + +# Test lldb-mi CLI support. 'target list' command. + +target list +# CHECK: ~"No targets.\n" + +-file-exec-and-symbols a.exe +# CHECK: ^done + +target list +# CHECK: ~"Current targets:\n* target #0: {{.*}}a.exe{{.*}}\n" + +-gdb-exit