diff options
author | Adrian Prantl <aprantl@apple.com> | 2024-03-12 16:11:45 -0700 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2024-03-12 16:12:19 -0700 |
commit | 418f0066ebfcde8cd72d33cc103fc1c3e36a1205 (patch) | |
tree | 3fa553753736a5d64f8345c45d0d2c9461c44fba | |
parent | 422d240dc9b4b36f505c43e6fe650af4f4cf4f98 (diff) | |
download | llvm-418f0066ebfcde8cd72d33cc103fc1c3e36a1205.zip llvm-418f0066ebfcde8cd72d33cc103fc1c3e36a1205.tar.gz llvm-418f0066ebfcde8cd72d33cc103fc1c3e36a1205.tar.bz2 |
Modernize llgdb script and make it easier to debug.
-rwxr-xr-x | cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl b/cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl index 6dbc3b9..fa52a50 100755 --- a/cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl +++ b/cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl @@ -56,7 +56,7 @@ my $my_debugger = $ENV{'DEBUGGER'}; if (!$my_debugger) { if ($use_lldb) { my $path = dirname(Cwd::abs_path($0)); - $my_debugger = "/usr/bin/env python3 $path/llgdb.py"; + $my_debugger = "/usr/bin/xcrun python3 $path/llgdb.py"; } else { $my_debugger = "gdb"; } @@ -66,12 +66,18 @@ if (!$my_debugger) { my $debugger_options = "-q -batch -n -x"; # run debugger and capture output. +print("Running debugger\n"); system("$my_debugger $debugger_options $debugger_script_file $executable_file > $output_file 2>&1"); - +if ($?) { + print("Debugger output was:\n"); + system("cat", "$output_file"); + exit 1; +} # validate output. +print("Running FileCheck\n"); system("FileCheck", "-input-file", "$output_file", "$testcase_file"); -if ($?>>8 == 1) { - print "Debugger output was:\n"; +if ($?) { + print("Debugger output was:\n"); system("cat", "$output_file"); exit 1; } |