summaryrefslogtreecommitdiff
path: root/tests/tail-2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tail-2')
-rwxr-xr-xtests/tail-2/inotify-race.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/tail-2/inotify-race.sh b/tests/tail-2/inotify-race.sh
index cc0f61b32..53c7a7c5f 100755
--- a/tests/tail-2/inotify-race.sh
+++ b/tests/tail-2/inotify-race.sh
@@ -37,13 +37,17 @@ case $(cat gdb.out) in
*) skip_ "can't run gdb";;
esac
+break_src="$abs_top_builddir/src/tail.c"
+break_line=$(grep -n ^tail_forever_inotify "$break_src") || framework_failure_
+break_line=$(echo "$break_line" | cut -d: -f1) || framework_failure_
+
# See if gdb works and
-# tail_forever_inotify is compiled and not inlined
+# tail_forever_inotify is compiled and run
timeout 10s gdb -nx --batch-silent \
- --eval-command='break tail_forever_inotify' \
+ --eval-command="break $break_line" \
--eval-command='run -f file' \
--eval-command='quit' \
- tail < /dev/null > gdb.out 2>&1
+ tail < /dev/null > gdb.out 2>&1 || skip_ 'breakpoint not hit'
# FIXME: The above is seen to _intermittently_ fail with:
# warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
@@ -54,9 +58,9 @@ test -s gdb.out && { cat gdb.out; skip_ "can't set breakpoints in tail"; }
# inotify initialization, and then continue. Before the fix,
# that just-appended line would never be output.
timeout 10s gdb -nx --batch-silent \
- --eval-command='break tail_forever_inotify' \
+ --eval-command="break $break_line" \
--eval-command='run -f file >> tail.out' \
- --eval-command="shell echo never-seen-with-tail-7.5 >> file" \
+ --eval-command='shell echo never-seen-with-tail-7.5 >> file' \
--eval-command='continue' \
--eval-command='quit' \
tail < /dev/null > /dev/null 2>&1 &