#! /bin/sh

dir=`dirname $0`

SED=sed

$dir/filter_stderr                              |

# Anonymise addresses
$dir/../tests/filter_addresses                  |


#       On FreeBSD if the base and/or lib32 dbg components
#       are installed but not system source then these
#       errors get produced by GDB
$SED -e '/\(rtld_start.S\|kill.S\|_exit.S\|_select.S\): No such file or directory/d' |

# filter vgdb process id,
#             pid
# gdb 7.2 sometimes tries to access address 0x0 (same as with standard gdbserver)
# filter a debian 6.0/ppc32 line
$SED -e '/relaying data between gdb and process/d'                        \
    -e 's/\(sending command .* to pid \)[0-9][0-9]*/\1..../'             \
    -e '/Cannot access memory at address 0x......../d'                   \
    -e '/^[1-9][0-9]*	\.\.\/sysdeps\/powerpc\/powerpc32\/dl-start\.S: No such file or directory\./d' |
    
# filter some debuginfo problems with ld.so and SLES11
$SED -e '/^1	rtld.c: No such file or directory\./d' |
$SED -e '/rtld.c: Inappropriate ioctl for device\./d' |
# similar for Debian 11.0 arm64
$SED -e '/_exit.c: Inappropriate ioctl for device\./d' |

# and filter out any remaining empty lines
$SED -e '/^$/d'
