Top/Prog/TagSystem/cscope

目次

cscope

tag の生成

cscope で SymLink になっているファイルを扱えるようにする(要コード修正・ビルド)

  1. cscsope の修正
    1. README.git の記述に従って autoconf を実行する
      $ autoreconf -i -s
    2. 生成された config.h.in を編集
      /* Define to 1 if you have the `lstat' function. */
      #undef HAVE_LSTAT   // この行を /* */ でコメントアウトする
    3. configure を実行
      $ ./configure
    4. global.h を修正
      /* This can happen on only vaguely Unix-ish platforms... */
      #ifndef HAVE_LSTAT
      #include <sys/stat.h>  # この include文が足りてないので追加する。
      # define	lstat(file,buf)	stat(file,buf)
      #endif
    5. ビルドする
      $ make
  2. cscope-indexer の修正
    • 修正前
      	find $DIR \( -type f -o -type l \)
    • 修正後
      	if [ "X$EXCLUDE"  = "X" ]
      	   then
      	       find -L $DIR \( -xtype f -o -xtype l \)
      	else
      	       find -L $DIR \( -xtype f -o -xtype l \) | grep -v $EXCLUDE
      	fi

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
C-c s tテキストを検索symbol や定義意外のテキスト全般はこれで検索する
C-c s fファイルを検索1つだけ見つかればそれを自動的に開く
C-c s iそのファイルを include している include 文を検索

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の生成

参考リンク

ソースからのビルド

参考リンク


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-03-27 (月) 00:52:56