# Test gdb threading support (PR 47430)

from bracket import make_sh_test_op
import anita

def op():
    return make_sh_test_op('gdb_threads_2',
'''
set -x

# Dig at an unused IP address so that dig fails the
# same way on machines with Internet connectivity
# as on those without.

cat <<EOF >test.gdb
run +time=1 +tries=1 @127.0.0.177
cont
cont
cont
cont
cont
EOF
gdb --batch -x test.gdb dig >gdb.out
cat gdb.out
! grep "Program received signal SIGTRAP" gdb.out
''')
