- # Find library paths
- my $libdirs = join ':', (
- glob("$Bin/../staging_dir/target-${arch}_${libc}/root-*/{,usr/}lib/"),
- glob("$Bin/../staging_dir/target-${arch}_${libc}/{,usr/}lib/"),
- glob("$Bin/../staging_dir/toolchain-${arch}_*_${libc}/lib/")
- );
+ # Find sysroot
+ my ($sysroot) = glob("$Bin/../staging_dir/target-${arch}_${libc}*/root-*/");
+
+ print $fh "set sysroot $sysroot\n" if $sysroot;
+ my $cmd = "target extended-remote";
+ -f $ARGV[0] and $cmd = "core-file";
+ print $fh "$cmd $ARGV[0]\n";