generic.sh

来自「linux下的多线程调试工具」· Shell 代码 · 共 47 行

SH
47
字号
#! /bin/sh# Trace an application, listing events with optional parameters (thread name# and NPTL object name). Compare this list with a reference file.PROG=$1; shiftCOLUMNS=$1; shift# trace name: trace is keeping if an error occuredRES=$PROG.errorTMP=$PROG.tmp# 2 possible reference filesREF=ref/$PROG.refREF2=ref/$PROG.ref2./init.shPTT_TRACE=./ptt_tracePTT_VIEW=../src/decode/ptt_view$PTT_TRACE -n trace prog/$PROG > /dev/null$PTT_VIEW -a alias $@ trace.bin > $TMPif [ $COLUMNS -eq 0 ]; thenawk '{if (NR > 7) print $3}' $TMP > $RESfiif [ $COLUMNS -eq 1 ]; thenawk '{if (NR > 7) print $3,$7}' $TMP > $RESfiif [ $COLUMNS -eq 2 ]; thenawk '{if (NR > 7) print $3,$7,$9}' $TMP > $RESfi# if ($RES != $REF) and ($RES != $REF2) then error else okif [ "`diff $RES $REF`" != "" ]; then    if [ ! -f $REF2 ]; then        rm -f alias trace.bin $TMP $PTT_TRACE        exit 1    fi    if [ "`diff $RES $REF2`" != "" ]; then        rm -f alias trace.bin $TMP $PTT_TRACE        exit 1    fifirm -f alias trace.bin $TMP $PTT_TRACE $RESexit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?