aboutsummaryrefslogtreecommitdiff
path: root/bpb4crash.sh
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2024-06-02 21:01:19 +0200
committerSamuel Lidén Borell <samuel@kodafritt.se>2024-06-02 21:01:19 +0200
commitf04a0e20619deaf7512db5e5533d382a539bca22 (patch)
tree86164cf062a08bf08b463e26b867feecd08c2636 /bpb4crash.sh
parent5f5f70783e21f095207464e8054e42e02689041b (diff)
downloadbpb4crash-main.tar.gz
bpb4crash-main.tar.bz2
bpb4crash-main.zip
Abort early if debugged program does not crashHEADv0.1.1main
Diffstat (limited to 'bpb4crash.sh')
-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))