Monday, September 27, 2010

gen_ctags

# setting
WORKDIR=`pwd`
# get all file list
echo "get all file list"
rm ctags.Uranus ctags.utopia 2>/dev/null
find $WORKDIR/Uranus/ -name '*.[HhCc]' >> ctags.Uranus
find $WORKDIR/Uranus/ -name '*.cc' >> ctags.Uranus
find $WORKDIR/Uranus/ -name '*.cpp' >> ctags.Uranus
find $WORKDIR/utopia/ -name '*.[HhCc]' >> ctags.utopia
find $WORKDIR/utopia/ -name '*.cc' >> ctags.utopia
find $WORKDIR/utopia/ -name '*.cpp' >> ctags.utopia

# remove unwanted files

echo "remove unwanted files"
# Uranus
sed -i /Cus60/d ctags.Uranus
sed -i /eCospro/d ctags.Uranus
sed -i /Trunk/d ctags.Uranus
sed -i /u3/d ctags.Uranus
# utopis
sed -i /u2/d ctags.utopia
sed -i /u3/d ctags.utopia

sed -i /t2/d ctags.utopia
sed -i /t4/d ctags.utopia
sed -i /t7/d ctags.utopia
sed -i /t8/d ctags.utopia
sed -i /t9/d ctags.utopia
sed -i /t11/d ctags.utopia
sed -i /t12/d ctags.utopia
sed -i /t13/d ctags.utopia
sed -i /titania4/d ctags.utopia
sed -i /titania7/d ctags.utopia
sed -i /titania8/d ctags.utopia
sed -i /titania9/d ctags.utopia

sed -i /Janus/d ctags.utopia
sed -i /janus/d ctags.utopia
sed -i /j2/d ctags.utopia

sed -i /s7/d ctags.utopia
sed -i /s7j/d ctags.utopia
sed -i /s7ml/d ctags.utopia
sed -i /s7ld/d ctags.utopia
sed -i /s8/d ctags.utopia

sed -i /maria10/d ctags.utopia
sed -i /prans2/d ctags.utopia

sed -i /r2/d ctags.utopia

# generate tag file
cat ctags.Uranus ctags.utopia > ctags.files
echo "generate tag file"
ctags -L ctags.files
#cscope -b -q -k

# generate file list for Perforce
echo "generate file list for Perforce"
ESCSTR=$(echo "$WORKDIR" | sed -e 's/\//\\\//g')
echo $ESCSTR
echo "sed -e 's/$ESCSTR//g' ctags.files > ctags.p4"
sed -e "s/$ESCSTR//g" ctags.files > ctags.p4

# export global variable
echo "===== IMPORTANT ====="
echo "please export the following variable"
echo "export CTAGFILE=$WORKDIR/tags"

Saturday, September 25, 2010

linux dump stace functions

1) dump_stack

Thursday, September 2, 2010

vimrc

ab tl Tlist
ab tls TlistSync

where

Tlist is for ctag list
TlistSync is for syncing the ctag navigating window with the current cursor