[lldb] Remove lldb-repro utility
Remove lldb-repro which was used to run the test suite against a reproducer. The corresponding functionality has been removed from LLDB so there's no need for the tool anymore.
This commit is contained in:
parent
a9a8351ef1
commit
88591aa0ca
@ -268,12 +268,6 @@ if is_configured("lldb_libs_dir"):
|
||||
if is_configured("lldb_framework_dir"):
|
||||
dotest_cmd += ["--framework", config.lldb_framework_dir]
|
||||
|
||||
if (
|
||||
"lldb-repro-capture" in config.available_features
|
||||
or "lldb-repro-replay" in config.available_features
|
||||
):
|
||||
dotest_cmd += ["--skip-category=lldb-dap", "--skip-category=std-module"]
|
||||
|
||||
if "lldb-simulator-ios" in config.available_features:
|
||||
dotest_cmd += ["--apple-sdk", "iphonesimulator", "--platform-name", "ios-simulator"]
|
||||
elif "lldb-simulator-watchos" in config.available_features:
|
||||
|
@ -1,5 +1,4 @@
|
||||
# REQUIRES: python
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: mkdir -p %t.root
|
||||
# RUN: mkdir -p %t.home
|
||||
|
@ -1,4 +1,2 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: not %lldb -c /bogus/path 2>&1 | FileCheck %s
|
||||
# CHECK: error: file specified in --core (-c) option doesn't exist
|
||||
|
@ -1,3 +1,2 @@
|
||||
UNSUPPORTED: lldb-repro
|
||||
RUN: not %lldb --arch 2>&1 | FileCheck %s
|
||||
CHECK: error: argument to '--arch' is missing
|
||||
|
@ -1,4 +1,2 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: not %lldb -f /bogus/path 2>&1 | FileCheck %s
|
||||
# CHECK: error: file specified in --file (-f) option doesn't exist
|
||||
|
@ -1,5 +1,3 @@
|
||||
UNSUPPORTED: lldb-repro
|
||||
|
||||
RUN: %lldb --help | FileCheck %s
|
||||
RUN: cat %S/../../../docs/man/lldb.rst | FileCheck %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
UNSUPPORTED: lldb-repro
|
||||
|
||||
RUN: echo "int main() { return 0; }" | %clang_host -x c - -o %t.foo
|
||||
|
||||
RUN: %lldb -x -b %t.foo bar baz quux | FileCheck %s
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: echo ':quit' | %lldb -x --repl -O 'expr 42' -S %S/Inputs/Print2.in -o 'expr 999999' -s %s 2>&1 | FileCheck %s
|
||||
# CHECK: {{w}}arning: commands specified to run after file load (via -o or -s) are ignored in REPL mode
|
||||
# CHECK: (int) $0 = 42
|
||||
|
@ -1,5 +1,4 @@
|
||||
UNSUPPORTED: system-windows
|
||||
UNSUPPORTED: lldb-repro
|
||||
|
||||
The double quotes around "BAR" ensure we don't match the command.
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# UNSUPPORTED: system-windows
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# RUN: %python %S/expect_exit_code.py 226 %lldb -b -s %s
|
||||
q -30
|
||||
|
@ -1,4 +1,3 @@
|
||||
# UNSUPPORTED: system-windows
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# RUN: %python %S/expect_exit_code.py 30 %lldb -b -s %s
|
||||
q 30
|
||||
|
@ -1,4 +1,3 @@
|
||||
# UNSUPPORTED: system-windows
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# RUN: %python %S/expect_exit_code.py 10 %lldb -b -s %s
|
||||
q 0xA
|
||||
|
@ -1,4 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# XFAIL: system-windows
|
||||
# REQUIRES: native && target-x86_64
|
||||
# RUN: %clangxx_host %p/Inputs/x86-64-read.cpp -o %t
|
||||
|
@ -1,4 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# XFAIL: system-windows
|
||||
# REQUIRES: native && target-x86_64 && native-cpu-avx
|
||||
# RUN: %clangxx_host %p/Inputs/x86-ymm-read.cpp -o %t
|
||||
|
@ -1,7 +1,6 @@
|
||||
# XFAIL: system-windows
|
||||
# REQUIRES: native && (target-x86 || target-x86_64)
|
||||
# UNSUPPORTED: system-debugserver
|
||||
# UNSUPPORTED: lldb-repro
|
||||
# RUN: %clangxx_host %p/Inputs/x86-multithread-write.cpp -o %t -pthread
|
||||
# RUN: %lldb -b -s %s %t | FileCheck %s
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: cat %s | %lldb --script-language lua 2>&1 | FileCheck %s
|
||||
script
|
||||
debugger = lldb.SBDebugger.Create()
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# This tests that the convenience variables are not nil. Given that there is no
|
||||
# target we only expect the debugger to be valid.
|
||||
#
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: rm -rf %t.stderr %t.stdout
|
||||
# RUN: cat %s | %lldb --script-language lua 2> %t.stderr > %t.stdout
|
||||
# RUN: cat %t.stdout | FileCheck %s --check-prefix STDOUT
|
||||
|
@ -1,5 +1,4 @@
|
||||
# REQUIRES: python
|
||||
# UNSUPPORTED: lldb-repro
|
||||
|
||||
# RUN: mkdir -p %t
|
||||
# RUN: cd %t
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: rm -rf %t.stderr %t.stdout
|
||||
# RUN: cat %s | %lldb --script-language lua 2> %t.stderr > %t.stdout
|
||||
# RUN: cat %t.stdout | FileCheck %s --check-prefix STDOUT
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: cat %s | %lldb --script-language lua 2>&1 | FileCheck %s
|
||||
script
|
||||
print(95000 + 126)
|
||||
|
@ -1,9 +1,6 @@
|
||||
if 'system-darwin' not in config.available_features:
|
||||
config.unsupported = True
|
||||
|
||||
if 'lldb-repro' in config.available_features:
|
||||
config.unsupported = True
|
||||
|
||||
config.environment["LLDB_APPLE_DSYMFORUUID_EXECUTABLE"] = ""
|
||||
|
||||
# Temporary parallel image loading deadlock workaround
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: %lldb -s %s --script-language python 2>&1 | FileCheck %s
|
||||
b main
|
||||
breakpoint command add -s python -o "1234_foo"
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# Test that the SBAddress properties throw an exception when used outside of
|
||||
# the interactive script interpreter.
|
||||
#
|
||||
|
@ -1,5 +1,3 @@
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# Test that the scripting language argument to "breakpoint command" is honored
|
||||
# even if the global scripting language is different.
|
||||
#
|
||||
|
@ -1,5 +1,4 @@
|
||||
# REQUIRES: python
|
||||
# UNSUPPORTED: lldb-repro
|
||||
#
|
||||
# RUN: cat %s | %lldb --script-language lua 2>&1 | FileCheck %s
|
||||
b main
|
||||
|
@ -1,2 +0,0 @@
|
||||
if 'lldb-repro' in config.available_features:
|
||||
config.unsupported = True
|
@ -2,8 +2,6 @@
|
||||
# behavior in the invalid cases is not particularly important, but it should be
|
||||
# "reasonable".
|
||||
|
||||
# UNSUPPORTED: lldb-repro
|
||||
|
||||
# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s --defsym LOC=0 > %t
|
||||
# RUN: %lldb %t -o "image lookup -v -a 0" -o "image lookup -v -a 2" \
|
||||
# RUN: -o "image dump symfile" -o exit | FileCheck %s
|
||||
|
@ -1,2 +0,0 @@
|
||||
if 'lldb-repro' in config.available_features:
|
||||
config.unsupported = True
|
@ -1,2 +0,0 @@
|
||||
if 'lldb-repro' in config.available_features:
|
||||
config.unsupported = True
|
@ -283,20 +283,3 @@ def use_support_substitutions(config):
|
||||
llvm_config.add_tool_substitutions(support_tools, additional_tool_dirs)
|
||||
|
||||
_disallow(config, "clang")
|
||||
|
||||
|
||||
def use_lldb_repro_substitutions(config, mode):
|
||||
lldb_init = _get_lldb_init_path(config)
|
||||
substitutions = [
|
||||
ToolSubst(
|
||||
"%lldb",
|
||||
command=FindTool("lldb-repro"),
|
||||
extra_args=[mode, "--no-lldbinit", "-S", lldb_init],
|
||||
),
|
||||
ToolSubst(
|
||||
"%lldb-init",
|
||||
command=FindTool("lldb-repro"),
|
||||
extra_args=[mode, "-S", lldb_init],
|
||||
),
|
||||
]
|
||||
llvm_config.add_tool_substitutions(substitutions, [config.lldb_tools_dir])
|
||||
|
@ -59,15 +59,6 @@ if "Thread" in config.llvm_use_sanitizer:
|
||||
config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
|
||||
|
||||
|
||||
# Support running the test suite under the lldb-repro wrapper. This makes it
|
||||
# possible to capture a test suite run and then rerun all the test from the
|
||||
# just captured reproducer.
|
||||
lldb_repro_mode = lit_config.params.get("lldb-run-with-repro", None)
|
||||
if lldb_repro_mode:
|
||||
config.available_features.add("lldb-repro")
|
||||
lit_config.note("Running Shell tests in {} mode.".format(lldb_repro_mode))
|
||||
toolchain.use_lldb_repro_substitutions(config, lldb_repro_mode)
|
||||
|
||||
if config.lldb_platform_url and config.cmake_sysroot and config.enable_remote:
|
||||
if re.match(r".*-linux.*", config.target_triple):
|
||||
config.available_features.add("remote-linux")
|
||||
|
@ -1,3 +1,2 @@
|
||||
add_subdirectory(lit-cpuid)
|
||||
add_subdirectory(lldb-dotest)
|
||||
add_subdirectory(lldb-repro)
|
||||
|
@ -1,23 +0,0 @@
|
||||
add_custom_target(lldb-repro)
|
||||
add_dependencies(lldb-repro lldb-test-depends)
|
||||
set_target_properties(lldb-repro PROPERTIES FOLDER "LLDB/Utils")
|
||||
|
||||
# Generate lldb-repro Python script for each build mode.
|
||||
if(LLDB_BUILT_STANDALONE)
|
||||
set(config_types ".")
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
set(config_types ${CMAKE_CONFIGURATION_TYPES})
|
||||
endif()
|
||||
|
||||
foreach(config_type ${config_types})
|
||||
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
||||
configure_file(lldb-repro.py ${config_runtime_output_dir}/lldb-repro COPYONLY)
|
||||
endforeach()
|
||||
elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
||||
foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_REPRO_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
||||
configure_file(lldb-repro.py ${LLDB_REPRO_DIR}/lldb-repro COPYONLY)
|
||||
endforeach()
|
||||
else()
|
||||
configure_file(lldb-repro.py ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-repro COPYONLY)
|
||||
endif()
|
@ -1,86 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""lldb-repro
|
||||
|
||||
lldb-repro is a utility to transparently capture and replay debugger sessions
|
||||
through the command line driver. Its used to test the reproducers by running
|
||||
the test suite twice.
|
||||
|
||||
During the first run, with 'capture' as its first argument, it captures a
|
||||
reproducer for every lldb invocation and saves it to a well-know location
|
||||
derived from the arguments and current working directory.
|
||||
|
||||
During the second run, with 'replay' as its first argument, the test suite is
|
||||
run again but this time every invocation of lldb replays the previously
|
||||
recorded session.
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
def help():
|
||||
print("usage: {} capture|replay [args]".format(sys.argv[0]))
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
help()
|
||||
return 1
|
||||
|
||||
# Compute an MD5 hash based on the input arguments and the current working
|
||||
# directory.
|
||||
h = hashlib.md5()
|
||||
h.update(" ".join(sys.argv[2:]).encode("utf-8"))
|
||||
h.update(os.getcwd().encode("utf-8"))
|
||||
input_hash = h.hexdigest()
|
||||
|
||||
# Use the hash to "uniquely" identify a reproducer path.
|
||||
reproducer_path = os.path.join(tempfile.gettempdir(), input_hash)
|
||||
|
||||
# Create a new lldb invocation with capture or replay enabled.
|
||||
lldb = os.path.join(os.path.dirname(sys.argv[0]), "lldb")
|
||||
new_args = [lldb]
|
||||
if sys.argv[1] == "replay":
|
||||
new_args.extend(["--replay", reproducer_path])
|
||||
elif sys.argv[1] == "capture":
|
||||
new_args.extend(
|
||||
[
|
||||
"--capture",
|
||||
"--capture-path",
|
||||
reproducer_path,
|
||||
"--reproducer-generate-on-exit",
|
||||
]
|
||||
)
|
||||
new_args.extend(sys.argv[2:])
|
||||
else:
|
||||
help()
|
||||
return 1
|
||||
|
||||
exit_code = subprocess.call(new_args)
|
||||
|
||||
# The driver always exists with a zero exit code during replay. Store the
|
||||
# exit code and return that for tests that expect a non-zero exit code.
|
||||
exit_code_path = os.path.join(reproducer_path, "exit_code.txt")
|
||||
if sys.argv[1] == "replay":
|
||||
replay_exit_code = exit_code
|
||||
with open(exit_code_path, "r") as f:
|
||||
exit_code = int(f.read())
|
||||
if replay_exit_code != 0:
|
||||
print("error: replay failed with exit code {}".format(replay_exit_code))
|
||||
print("invocation: " + " ".join(new_args))
|
||||
# Return 1 if the expected exit code is 0 or vice versa.
|
||||
return 1 if (exit_code == 0) else 0
|
||||
shutil.rmtree(reproducer_path, True)
|
||||
elif sys.argv[1] == "capture":
|
||||
with open(exit_code_path, "w") as f:
|
||||
f.write("%d" % exit_code)
|
||||
|
||||
return exit_code
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit(main())
|
Loading…
x
Reference in New Issue
Block a user