Modernize llgdb script and make it easier to debug.
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 @@
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 @@
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;
}