Top/Prog/TagSystem

目次

Rtags

環境構築

# apt-get install clang libclang-dev cmake
$ git clone --recursive https://github.com/Andersbakken/rtags
$ cd rtags
$ git submodule init
$ git submodule update
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

参考リンク

cscope

tag の生成

cscope で SymLink になっているファイルが扱えない問題について

xcscope.el

シンボルを探す

keydescriptionremark
C-c s sシンボルを指定して探す(定義・呼び出し箇所等の一覧をリストアップする)
C-c s C指定したシンボルの呼び出し箇所をリストアップ
C-c s G指定したシンボルの定義(宣言ではなく)、またはそれに関する定義をリストアップする
C-c s n次のシンボルへ Jump
C-c s p前のシンボルへ Jump

xcscope のキーバインド一覧(xcscope.el ver.1.0)

;; * Keybindings:
;;
;; All keybindings use the "C-c s" prefix, but are usable only while
;; editing a source file, or in the cscope results buffer:
;;
;;      C-c s s         Find symbol.
;;      C-c s =         Find assignments to this symbol
;;      C-c s d         Find global definition.
;;      C-c s g         Find global definition (alternate binding).
;;      C-c s G         Find global definition without prompting.
;;      C-c s c         Find functions calling a function.
;;      C-c s C         Find called functions (list functions called
;;                      from a function).
;;      C-c s t         Find text string.
;;      C-c s e         Find egrep pattern.
;;      C-c s f         Find a file.
;;      C-c s i         Find files #including a file.
;;
;; These pertain to navigation through the search results:
;;
;;      C-c s b         Display *cscope* buffer.
;;      C-c s B         Auto display *cscope* buffer toggle.
;;      C-c s n         Next symbol.
;;      C-c s N         Next file.
;;      C-c s p         Previous symbol.
;;      C-c s P         Previous file.
;;      C-c s u         Pop mark.
;;
;; These pertain to setting and unsetting the variable,
;; `cscope-initial-directory', (location searched for the cscope database
;;  directory):
;;
;;      C-c s a         Set initial directory.
;;      C-c s A         Unset initial directory.
;;
;; These pertain to cscope database maintenance:
;;
;;      C-c s L         Create list of files to index.
;;      C-c s I         Create list and index.
;;      C-c s E         Edit list of files to index.
;;      C-c s W         Locate this buffer's cscope directory
;;                      ("W" --> "where").
;;      C-c s S         Locate this buffer's cscope directory.
;;                      (alternate binding: "S" --> "show").
;;      C-c s T         Locate this buffer's cscope directory.
;;                      (alternate binding: "T" --> "tell").
;;      C-c s D         Dired this buffer's directory.
;;

xcscope のキーバインドが正しく動作しない場合

参考リンク

acscope.el

導入

tagの生成

参考リンク

参考リンク

id-utils

導入

emacs の設定

DB の生成

symbol の検索

gtags / global の利用

tag の生成

$ gtags [options] [path]
$ gtags -f <files>
$ gtags -v

emacs の設定

vi での設定

  1. vimのプラグインを ~/.vim/plugin にコピー
    $ mkdir ${HOME}/.vim/plugin
    $ cp /usr/share/doc/global/examples/gtags.vim.gz ${HOME}/.vim/plugin
    $ cd ${HOME}/.vim/plugin
    $ gunzip gtags.vim.gz
  2. /.vimrc にgtagsの設定を追加

    map <C-h> :Gtags -f %<CR>
    map <C-j> :GtagsCursor<CR>
    map <C-n> :cn<CR>
    map <C-p> :cp<CR>

操作

bindingdescription
C-hそのソースの関数を表示
C-nリストのカーソルを下に移動
C-pリストのカーソルを上に移動
C-j現在の関数の中にジャンプ
C-oジャンプする前の位置に戻る

参考リンク

etags (ctags for Emacs)の利用

tag の生成

emacs に TAGS ファイルを読みこませる

M-x: tags-reset-tags-tables 一旦リセットする
M-x: visit-tags-table 明示的に TAGS ファイルを読み込む

ctags-exuberant

TAGS file の生成

$ ctags-exuberant -e -R [path]

emacs から TAGS の生成を行えるようにする

参考リンク

ebrowse (ebrowse for Emacs)の利用

Links

SilentBob

tag の生成

$ bob --make-ctags
$ bob --cfiles
$ bob -L cfiles --call-tags

参考リンク

各システムでの解析速度


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS