File: ice-gdb.in

package info (click to toggle)
avarice 2.13%2Bsvn347-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,880 kB
  • sloc: cpp: 22,872; sh: 4,129; ansic: 1,134; makefile: 92
file content (44 lines) | stat: -rwxr-xr-x 1,056 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!@pathperl@
$prefix = "@prefix@";
$datadir = "@datadir@";
$debugger = "avr-gdb";

@argcmds = ( "-b", "--cd", "--command", "--core", "--pid", "--directory",
	     "--exec", "--interpreter", "--se", "--symbols", "--tty",
	     "-s", "-e", "-se", "-x", "-d" );

for ($i = 0; $i <= $#ARGV; $i++) {
    $arg = $ARGV[$i];

    if ($arg =~ /^-/ &&
	(grep $_ eq $arg, @argcmds || grep /^-$arg$/, @argcmds)) {
	$i++;
    }
    elsif ($arg eq "--debugger" && $i < $#ARGV) {
	$debugger = $ARGV[$i + 1];
	splice @ARGV, $i, 2;
	$i--;
    }
    elsif ($arg eq "--capture" || $arg eq "--ignore-intr") {
	$ENV{AVARICE_ARGS} = "$ENV{AVARICE_ARGS} $arg";
	splice @ARGV, $i, 1;
	# Don't load an executable
	$capture = 1 if $arg eq "--capture";
	$i--;
    }
    elsif ($arg eq "--external") {
	$avarice_running = 1;
	splice @ARGV, $i, 1;
	$i--;
    }
    elsif (!($arg =~ /^-/)) {
	$exe = $arg;
	break;
    }
}

$exe = "" if $capture;

system "start-avarice $exe" unless $avarice_running;
unshift @ARGV, ($debugger, "-x", "$datadir/avarice/gdb-avarice-script" );
exec @ARGV;