# post-process script command output from ice.pl, removing backspaces # and deletes, carriage-returns, gdb Breakpoint declaration messages, # and output from exiting gdb. my($in_cat, $skip_til_EOF); while (<>) { s/\r//; while (/[^\cH\x7F][\cH\x7F]/) { s/[^\cH\x7F][\cH\x7F]//g; } $in_cat = 1 if /^cat < to continue,.*$//; $skip_til_EOF = 1 if /^\(gdb\)\s+q/; undef $skip_til_EOF if defined($skip_til_EOF) && /^EOF$/; print if !defined($skip_til_EOF); }