From bd76ebcf35dd667a5e4a85918fb0a30ecc042cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Tue, 1 May 2018 14:15:29 +0200 Subject: [PATCH] debug log viewer: skip-crap didn't skip everything --- debug | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debug b/debug index 07eed76..49a99e4 100755 --- a/debug +++ b/debug @@ -5,27 +5,31 @@ function skip-crap { local crap_continue=( -e ".*: == Stack trace for context.*" - -e ".*: #[0-9]+ 0x.*" + -e ".*: #[0-9]+\s*0x.*" ) local skip=0 + local skipped=0 # Could probably be done more elegantly with awk/sed ? while read -r line; do if echo $line | grep -E $crap_start --quiet; then # echo setting skip skip=1 + ((skipped += 1)) continue fi if [[ $skip == 1 ]]; then if echo $line | grep -E $crap_continue --quiet; then # echo ignoring + ((skipped += 1)) continue else # echo reset skip + printf "Skipped \"already finalized\" crap ($skipped lines)\n" skip=0 - printf 'Skipped "already finalized" crap\n' + skipped=0 fi fi