用cscope檢視和搜尋程式碼
1.安裝cscope.
2.在原始碼對應得檔案加下建立一個shell指令碼
#!/bin/bash
# generate cscope files list
echo "Generate file list to be indexed..."
find . -name "*.cpp" -print > cscope.files
find . -name "*.[ch]" -print >> cscope.files
find . -name "*.cc" -print >> cscope.files
cscope -b -q -k
3.執行指令碼,會建立資料庫4.在控制檯 輸入 cscope,回車後會出現下面的介面,其中在Find this text string:中輸入關鍵詞會把所有包含這個詞的檔案全部找出來,在Find this file:輸入檔名會把該檔案找到
Find this C symbol:
Find this global definition:
Find functions called by this function:
Find functions calling this function:
Find this text string:
Change this text string:
Find this egrep pattern:
Find this file:
Find files #including this file:
Find assignments to this symbol: