Skip to content

Commit 418f006

Browse files
committed
Modernize llgdb script and make it easier to debug.
1 parent 422d240 commit 418f006

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cross-project-tests/debuginfo-tests/llgdb-tests/test_debuginfo.pl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
if (!$my_debugger) {
5757
if ($use_lldb) {
5858
my $path = dirname(Cwd::abs_path($0));
59-
$my_debugger = "/usr/bin/env python3 $path/llgdb.py";
59+
$my_debugger = "/usr/bin/xcrun python3 $path/llgdb.py";
6060
} else {
6161
$my_debugger = "gdb";
6262
}
@@ -66,12 +66,18 @@
6666
my $debugger_options = "-q -batch -n -x";
6767

6868
# run debugger and capture output.
69+
print("Running debugger\n");
6970
system("$my_debugger $debugger_options $debugger_script_file $executable_file > $output_file 2>&1");
70-
71+
if ($?) {
72+
print("Debugger output was:\n");
73+
system("cat", "$output_file");
74+
exit 1;
75+
}
7176
# validate output.
77+
print("Running FileCheck\n");
7278
system("FileCheck", "-input-file", "$output_file", "$testcase_file");
73-
if ($?>>8 == 1) {
74-
print "Debugger output was:\n";
79+
if ($?) {
80+
print("Debugger output was:\n");
7581
system("cat", "$output_file");
7682
exit 1;
7783
}

0 commit comments

Comments
 (0)