-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdotbash_valgrind
41 lines (33 loc) · 1.14 KB
/
dotbash_valgrind
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#
# Valgrind Customisations
#
VALGRIND=`which valgrind`
alias valmem="$VALGRIND --smc-check=all-non-file --leak-check=full --log-file=valgrind-mem.log "
alias valchk="$VALGRIND --smc-check=all-non-file --leak-check=no --log-file=valgrind-chk.log "
alias valdrd="$VALGRIND --smc-check=all-non-file --tool=drd --exclusive-threshold=10 --shared-threshold=10 --log-file=valgrind-drd.log"
alias valhel="$VALGRIND --smc-check=all-non-file --tool=helgrind --log-file=valgrind-helgrind.log"
function objdiff
{
if [ $# != 2 ]; then
echo "need two objects"
return
fi
SOURCES=()
OBJ_OPTS="-d -l --no-show-raw-insn"
for o in $@;
do
BN=$(basename $o)
TN="/tmp/${BN}.S"
echo "$o -> $BN -> $TN"
objdump ${OBJ_OPTS} $o > ${TN}
perl -p -i.orig -e "s/[[:xdigit:]]{1,5}\:/----\:/" ${TN}
SOURCES=("${SOURCES[@]}" ${TN})
echo $SOURCES
done
TW=$(tput cols)
DIFF_OPTS="-y -W ${TW}"
# echo "${DIFF_OPTS} ${SOURCES[0]} ${SOURCES[1]}"
diff ${DIFF_OPTS} ${SOURCES[0]} ${SOURCES[1]} | less
}
alias .valgrind=". ~/.bash_valgrind"