kernel: update kernel 4.4 to version 4.4.22
[openwrt/openwrt.git] / scripts / remote-gdb
index cd59033e7a5399d0ee6206f219120fa1deeea359..efb321c24376c5f886973f9263ff0d813824e4dc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
@@ -14,7 +14,7 @@ if( opendir SD, "$Bin/../staging_dir" )
 {
        my ( $tid, $arch, $libc, @arches );
 
-       if( $ARGV[1] =~ m!\btarget-(.+?)_(([^/_]+libc|musl)[^/]+)\b!i )
+       if( $ARGV[1] =~ m!\btarget-(.+?)_(([^/_]+libc|musl)[^/_]+)\b!i )
        {
                print("Using target $1 ($2)\n");
                ($arch, $libc) = ($1, $2);
@@ -58,7 +58,7 @@ if( opendir SD, "$Bin/../staging_dir" )
                my ( $fh, $fp ) = tempfile();
 
                # Find sysroot
-               my ($sysroot) = glob("$Bin/../staging_dir/target-${arch}_${libc}/root-*/");
+               my ($sysroot) = glob("$Bin/../staging_dir/target-${arch}_${libc}*/root-*/");
 
                print $fh "set sysroot $sysroot\n" if $sysroot;
                my $cmd = "target extended-remote";