This patch hooks the reproducer infrastructure with the signal handlers. When lldb crashes with reproducers capture enabled, it will now generate the reproducer and print a short message the standard out. This doesn't affect the pretty stack traces, which are still printed before. This patch also introduces a new reproducer sub-command that intentionally raises a given signal to test the reproducer signal handling. Currently the signal handler is doing too much work. Instead of copying over files into the reproducers in the signal handler, we should re-invoke ourselves with a special command line flag that looks at the VFS mapping and performs the copy. This is a NO-OP when reproducers are disabled. Differential revision: https://reviews.llvm.org/D70474
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
# UNSUPPORTED: system-windows, system-freebsd
|
|
|
|
# This tests the replaying of GDB remote packets.
|
|
#
|
|
# We issue the same commands and ensure the output is identical to the original
|
|
# process. To ensure we're not actually running the original binary we check
|
|
# that the string "testing" is not printed.
|
|
|
|
# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
|
|
|
|
# Test reproducer generate command.
|
|
# RUN: rm -rf %t.repro
|
|
# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE
|
|
# RUN: env FOO=BAR %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY
|
|
|
|
# Test crash reproducer.
|
|
# RUN: rm -rf %t.repro
|
|
# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCrashCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE
|
|
# RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY
|
|
|
|
# CHECK: Breakpoint 1
|
|
# CHECK: Process {{.*}} stopped
|
|
# CHECK: Process {{.*}} launched
|
|
# CHECK: thread {{.*}} stop reason = breakpoint
|
|
# CHECK: frame {{.*}} simple.c
|
|
|
|
# CAPTURE: testing
|
|
# REPLAY-NOT: testing
|
|
|
|
# CHECK: Process {{.*}} resuming
|
|
# CHECK: Process {{.*}} exited
|
|
|
|
# CAPTURE: Reproducer is in capture mode.
|
|
# CAPTURE: Reproducer written
|