aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbpb4crash.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/bpb4crash.sh b/bpb4crash.sh
index 51c3004..bb80caf 100755
--- a/bpb4crash.sh
+++ b/bpb4crash.sh
@@ -179,6 +179,10 @@ mkfifo "$fifo" || {
# Determine number of times that the TRACKED_FUNC function
# was executed before the crash.
gdb -q --interpreter=mi2 --args "$@" <"$fifo" | handle_commands 3>"$fifo"
+if [ ! -e "$resultfile" ]; then
+ # E.g. a non-crashing program. Abort early
+ exit
+fi
read -r bp_times TRACKED_FUNC <"$resultfile"
#echo "times: $bp_times"
bp_times=$(($bp_times - $STEPS_BEFORE))