Print this page
11972 resync smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/smatch_data/db/vim_smdb
+++ new/usr/src/tools/smatch/src/smatch_data/db/vim_smdb
1 1 #!/bin/bash
2 2
3 3 # Add these lines to your .vimrc file
4 4 #
5 5 # map <C-r> :! vim_smdb return_states <cword> <CR> :execute 'edit' system("cat ~/.smdb_tmp/cur") <CR>
6 6 # map <C-c> :! vim_smdb <cword> <CR> :execute 'edit' system("cat ~/.smdb_tmp/cur") <CR>
7 7 #
8 8 # Now you can move your cursor over a function and hit CTRL-c to see how it's
9 9 # called or CTRL-r to see what it returns. Use the ":bd" command to get back to
10 10 # your source.
11 11
12 12 DIR="$HOME/.smdb_tmp"
13 13 mkdir -p $DIR
14 14
15 15 for i in $(seq 1 100) ; do
16 16 if [ ! -e $DIR/$i ] ; then
17 17 break
18 18 fi
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 done
20 20
21 21 if [ $i == 100 ] ; then
22 22 i=1
23 23 fi
24 24
25 25 next=$(($i + 1))
26 26
27 27 rm -f $DIR/$next
28 28 rm -f $DIR/.${i}.swp
29 -smdb $* > $DIR/$i
30 29
30 +func=""
31 +if [[ "$3" != "" ]] ; then
32 + func="$3"
33 +elif [[ "$2" != "" ]] ; then
34 + func="$2"
35 +elif [[ "$1" != "" ]] ; then
36 + func="$1"
37 +fi
38 +
39 +echo "$func" >> $DIR/history
40 +tail -n 7 $DIR/history | tac | perl -ne 's/\n/ /; print' | perl -ne 's/ $//; print' > $DIR/$i
41 +echo "" >> $DIR/$i
42 +echo "==========================" >> $DIR/$i
43 +smdb $* >> $DIR/$i
44 +
31 45 echo "$DIR/$i" > $DIR/cur
32 46
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX