]> granicus.if.org Git - strace/blob - tests/attach-f-p.test
7a0a88b8817e0e028354bceda2ca04459c3940df
[strace] / tests / attach-f-p.test
1 #!/bin/sh
2 #
3 # Check that -f -p attaches to threads properly.
4 #
5 # Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
6 # Copyright (c) 2016-2017 The strace developers.
7 # All rights reserved.
8 #
9 # SPDX-License-Identifier: GPL-2.0-or-later
10
11 . "${srcdir=.}/init.sh"
12
13 run_prog_skip_if_failed \
14         kill -0 $$
15 run_prog ../attach-f-p-cmd > /dev/null
16
17 ../set_ptracer_any sh -c "exec ../attach-f-p >> $EXP" > /dev/null &
18 tracee_pid=$!
19
20 while ! [ -s "$EXP" ]; do
21         kill -0 $tracee_pid 2> /dev/null ||
22                 fail_ 'set_ptracer_any sh failed'
23 done
24
25 run_strace -a32 -f -echdir -p $tracee_pid ../attach-f-p-cmd > "$EXP"
26 match_diff "$LOG" "$EXP"