runtests: support -gl. Like -g but for lldb.
Follow-up to 63b5748
Invokes the test case via lldb instead of gdb. Since using gdb is such a
pain on mac, using lldb is sometimes less quirky.
Closes #12547
This commit is contained in:
parent
f58e493e44
commit
3dcf301752
@ -945,9 +945,16 @@ sub singletest_run {
|
|||||||
if($gdbthis) {
|
if($gdbthis) {
|
||||||
my $gdbinit = "$TESTDIR/gdbinit$testnum";
|
my $gdbinit = "$TESTDIR/gdbinit$testnum";
|
||||||
open(my $gdbcmd, ">", "$LOGDIR/gdbcmd") || die "Failure writing gdb file";
|
open(my $gdbcmd, ">", "$LOGDIR/gdbcmd") || die "Failure writing gdb file";
|
||||||
print $gdbcmd "set args $cmdargs\n";
|
if($gdbthis == 1) {
|
||||||
print $gdbcmd "show args\n";
|
# gdb mode
|
||||||
print $gdbcmd "source $gdbinit\n" if -e $gdbinit;
|
print $gdbcmd "set args $cmdargs\n";
|
||||||
|
print $gdbcmd "show args\n";
|
||||||
|
print $gdbcmd "source $gdbinit\n" if -e $gdbinit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# lldb mode
|
||||||
|
print $gdbcmd "set args $cmdargs\n";
|
||||||
|
}
|
||||||
close($gdbcmd) || die "Failure writing gdb file";
|
close($gdbcmd) || die "Failure writing gdb file";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -963,11 +970,18 @@ sub singletest_run {
|
|||||||
$testnum,
|
$testnum,
|
||||||
"$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " -x $LOGDIR/gdbcmd");
|
"$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " -x $LOGDIR/gdbcmd");
|
||||||
}
|
}
|
||||||
elsif($gdbthis) {
|
elsif($gdbthis == 1) {
|
||||||
|
# gdb
|
||||||
my $GDBW = ($gdbxwin) ? "-w" : "";
|
my $GDBW = ($gdbxwin) ? "-w" : "";
|
||||||
runclient("$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " $GDBW -x $LOGDIR/gdbcmd");
|
runclient("$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " $GDBW -x $LOGDIR/gdbcmd");
|
||||||
$cmdres=0; # makes it always continue after a debugged run
|
$cmdres=0; # makes it always continue after a debugged run
|
||||||
}
|
}
|
||||||
|
elsif($gdbthis == 2) {
|
||||||
|
# $gdb is "lldb"
|
||||||
|
print "runs lldb -- $CURL $cmdargs\n";
|
||||||
|
runclient("lldb -- $CURL $cmdargs");
|
||||||
|
$cmdres=0; # makes it always continue after a debugged run
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
# Convert the raw result code into a more useful one
|
# Convert the raw result code into a more useful one
|
||||||
($cmdres, $dumped_core) = normalize_cmdres(runclient("$CMDLINE"));
|
($cmdres, $dumped_core) = normalize_cmdres(runclient("$CMDLINE"));
|
||||||
|
|||||||
@ -116,6 +116,11 @@ Run the given test(s) with gdb. This is best used on a single test case and
|
|||||||
curl built --disable-shared. This then fires up gdb with command line set to
|
curl built --disable-shared. This then fires up gdb with command line set to
|
||||||
run the specified test case. Simply (set a break-point and) type 'run' to
|
run the specified test case. Simply (set a break-point and) type 'run' to
|
||||||
start.
|
start.
|
||||||
|
.IP "-gl"
|
||||||
|
Run the given test(s) with lldb. This is best used on a single test case and
|
||||||
|
curl built --disable-shared. This then fires up lldb with command line set to
|
||||||
|
run the specified test case. Simply (set a break-point and) type 'run' to
|
||||||
|
start.
|
||||||
.IP "-gw"
|
.IP "-gw"
|
||||||
Run the given test(s) with gdb as a windowed application.
|
Run the given test(s) with gdb as a windowed application.
|
||||||
.IP "-h, --help"
|
.IP "-h, --help"
|
||||||
|
|||||||
@ -2215,6 +2215,10 @@ while(@ARGV) {
|
|||||||
# run this test with gdb
|
# run this test with gdb
|
||||||
$gdbthis=1;
|
$gdbthis=1;
|
||||||
}
|
}
|
||||||
|
elsif ($ARGV[0] eq "-gl") {
|
||||||
|
# run this test with lldb
|
||||||
|
$gdbthis=2;
|
||||||
|
}
|
||||||
elsif ($ARGV[0] eq "-gw") {
|
elsif ($ARGV[0] eq "-gw") {
|
||||||
# run this test with windowed gdb
|
# run this test with windowed gdb
|
||||||
$gdbthis=1;
|
$gdbthis=1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user