3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 12:12:34 +01:00

Improvements to watchdog

Expand escape sequences
Ignore various text related to no symbol table and to threads
Automatically continue on breakpoints for functions prefixed with underscores (mostly because of C++)
This commit is contained in:
Pragmatic Software 2015-04-09 11:02:20 -07:00
parent 355853c24e
commit 38d109059a

View File

@ -6,6 +6,9 @@ use strict;
use IPC::Open2; use IPC::Open2;
my $stdin_input = (join ' ', @ARGV) || "Lorem ipsum dolor sit amet.\n"; my $stdin_input = (join ' ', @ARGV) || "Lorem ipsum dolor sit amet.\n";
$stdin_input =~ s/\\n/\n/g;
$stdin_input =~ s/\\r/\r/g;
$stdin_input =~ s/\\t/\t/g;
open my $fh, '>', '.input' or die "Couldn't open .input: $!"; open my $fh, '>', '.input' or die "Couldn't open .input: $!";
print $fh $stdin_input; print $fh $stdin_input;
close $fh; close $fh;
@ -40,6 +43,7 @@ sub execute {
next if not length $line; next if not length $line;
<$out> and next if $line =~ m/^\(gdb\) No line \d+ in/; <$out> and next if $line =~ m/^\(gdb\) No line \d+ in/;
next if $line =~ m/^\(gdb\) No symbol table/;
next if $line =~ m/^\[New Thread/; next if $line =~ m/^\[New Thread/;
next if $line =~ m/^\(gdb\) Continuing/; next if $line =~ m/^\(gdb\) Continuing/;
next if $line =~ m/^\(gdb\) \$\d+ = "Ok\."/; next if $line =~ m/^\(gdb\) \$\d+ = "Ok\."/;
@ -49,6 +53,8 @@ sub execute {
next if $line =~ m/^(\(gdb\) )*Starting program/; next if $line =~ m/^(\(gdb\) )*Starting program/;
next if $line =~ m/PRETTY_FUNCTION__ =/; next if $line =~ m/PRETTY_FUNCTION__ =/;
next if $line =~ m/libc_start_main/; next if $line =~ m/libc_start_main/;
next if $line =~ m/Thread debugging using libthread_db enabled/;
next if $line =~ m/Using host libthread_db library/;
if($line =~ m/^\d+: (.*? = .*)/) { if($line =~ m/^\d+: (.*? = .*)/) {
print "$opening$1$closing"; print "$opening$1$closing";
@ -145,6 +151,12 @@ sub execute {
next; next;
} }
if($line =~ m/^Breakpoint \d+, _(.*?) at/) {
<$out>;
gdb $in, "cont\n";
next;
}
if($line =~ m/^Breakpoint \d+, (.*?) at/) { if($line =~ m/^Breakpoint \d+, (.*?) at/) {
my $func = $1; my $func = $1;
my $direction = "entered"; my $direction = "entered";