#! /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' |

# filter python loading denied error message (see also filter_gdb.in)
$SED -e '/warning: File .*valgrind-monitor.py.*declined.*/d' |
# and remove loading error messages when python scripts haven't
# been installed yet (running against vg-in-place)
$SED -e '/warning: Missing auto-load script.*/d' |
$SED -e '/of file .*vgpreload.*so.*/d' |
$SED -e '/Use.*info auto-load python-scripts.*/d' |
$SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' |
$SED -e "/Use .info auto-load python .REGEXP.. to list them./d" |

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