git://git.jankratochvil.net
/
nethome.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
host0 state
[nethome.git]
/
bin
/
gdblogtocmd
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
5
undef $/;
6
local $_=<>;
7
tr/\r//d;
8
my $G=qr/\Q(gdb) \E/;
9
1 while s/^(${G})(?:PASS|FAIL): .*?^((?!(?:command is |result is |output is |section |get_compiler_info))[a-z][^\n]+).*?(\n$G)/$1$2$3/mgs;
10
s/^(?!$G).*\n//mg;
11
s/^$G//mg;
12
13
s/^kill\n//mg;
14
#s/^set debug .*\n//mg;
15
s/\n+PASS:.*\n*$//;
16
17
$_=<<"EOH".$_;
18
set confirm no
19
set breakpoint pending on
20
EOH
21
my $n=0;
22
s/^(.+)\n/"echo ".($n+=2).": $1\\n\n$1\n"/mge;
23
$_.="\nquit";
24
25
print;