2011年6月28日 星期二

vim & cscope

reference:
http://blog.chhsu.org/2009/03/multi-projects-of-vim-using-cscope.html
http://rickey-nctu.blogspot.com/2009/02/vim-srcexpl.html

Installing:
sudo apt-get install cscope ctags

Build my environment:
step1: Put debug.sh into ~/bin/
#!/bin/bash
CSCOPE_FILE=cscope.out
if [ -n "$1" ]; then
echo "Source code directory: " $1
echo "Create file map : " $CSCOPE_FILE
find $1 -name "*.h" -o -name "*.c" -o -name "*.cpp" > $CSCOPE_FILE
cscope -bkq -i $CSCOPE_FILE
# cscope -Rbkq
ctags -R
else
echo "Please key-in path of project"
fi

step2: modify cscope_map.bin on /usr/share/vim/vim72/plugin/cscope-map.bin
let i = 1
while i < 20
if filereadable("cscope.out")
let db = getcwd() . "/cscope.out"
"echo db
let $CSCOPE_DB = db
cs add $CSCOPE_DB
let i = 20
else
cd ..
let i += 1
endif
endwhile

Debug:
step1:
go to project and type: #debug.sh

step2:
Open you want to trace code via vi
ex: vi /arch/arm/mach-xxx/board_xxxx.c

Trace code :
(Ctrl+\+c) : who call this function --> (Ctrl+\+t): return back
(Ctrl+\+g) : find this function defination --> (Ctrl+\+t) : return back
(Ctrl+\+s) : which function uses this function --> (Ctrl+\+t) : retunn back

2011年6月27日 星期一

view code by ctags

Exuberant Ctags
Installing :apt-get install exuberant-ctags

@setup taglist

Edit: /etc/vim/vimrc

"Tglist edit
set tags=tags;
set autochdir
nnoremap :TlistToggle

@ Create tags into root directory of project
# ctags -R *

@ Operation
step1 : Don't open screen
step2: Open Tlist via F9
step3: Open you want to see functino via Ctrl+]
If you want to open new window to see this function, you can type Ctrl+w+]
step4: Return your main window Ctrl+t
Or, you can close your new winodw which see this function, you can type Ctrl+w+q

@You can change your window size by Ctrl+w+"+" or Ctrl+w+"-"

2011年4月19日 星期二

git tags

#git tag HEAD
#git push --tags origin

android
#repo forall -pv -c git tag HEAD
#repo forall -pv -c git push --tags

learning bash script

http://www.mgt.ncu.edu.tw/~dino/script/

http://www.twbsd.org/cht/book/ch24.htm

http://www.freeos.com/guides/lsst/

7za

http://www.dotnetperls.com/7-zip-examples

# 7za a -t7z test.7z ./test

2011年4月12日 星期二

create lib/modules

su -
/system/bb/dmesg -n1
/system/bb/ash
export PATH=/system/bb:$PATH; mount -oremount,rw /; mkdir -p /lib/modules/`uname -r`;

2011年4月11日 星期一

iperf udp

UDP throughput test
RX :
- DUT :iperf -s -u -i1 &
- PC : iperf.exe -c -b50M -t60 -i1 &
TX :
- PC : iperf.exe –s –u –i1 &
- DUT : iperf –c -b50M –t60 –i1 &