标签:style io ar os 使用 java for sp strong
$more /your/gtags/path/FAQ
|
$cd ~/code/kernel/
$gtags -v
|
/home/user/ | |-ROOT/ <- the root of source tree (GTAGS,GRTAGS,...) | |- README ..... +---------------+ | |The function of| | +---------------+ |- DIR1/ | | | |- fileA.c ..... +---------------+ | | |main(){ | | | | func1();| | | | func2();| | | |} | | | +---------------+ | | | |- fileB.c ..... +---------------+ | |func1(){ ... } | | +---------------+ |- DIR2/ | |- fileC.c ..... +---------------+ |#ifdef X | |func2(){ i++; }| |#else | |func2(){ i--; }| |#endif | |func3(){ | | func1();| |} | +---------------+ |
$ cd /home/user/ROOT $ global func1 DIR1/fileB.c # func1() is defined in fileB.c $ cd DIR1 $ global func1 fileB.c # relative path from DIR1 $ cd ../DIR2 $ global func1 ../DIR1/fileB.c # relative path from DIR2 |
$ global -r func2 ../DIR1/fileA.c # func2() is referred from fileA.c |
$ cd /home/user/ROOT $ global ‘func[1-3]‘ DIR1/fileB.c # func1, func2 and func3 are matched DIR2/fileC.c |
$ global func2 DIR2/fileC.c $ global -x func2 func2 2 DIR2/fileC.c func2(){ i++; } func2 4 DIR2/fileC.c func2(){ i--; } |
$ global -a func1 /home/user/ROOT/DIR1/fileB.c |
$ global -xs X X 1 DIR2/fileC.c #ifdef X |
$ global -xg ‘#ifdef‘ #ifdef 1 DIR2/fileC.c #ifdef X |
$ pwd /develop/src/mh # this is a source project $ gtags $ ls G*TAGS GRTAGS GTAGS $ global mhl uip/mhlsbr.c # mhl() is found $ global strlen # strlen() is not found $ (cd /usr/src/lib; gtags) # library source $ (cd /usr/src/sys; gtags) # kernel source $ export GTAGSLIBPATH=/usr/src/lib:/usr/src/sys $ global strlen ../../../usr/src/lib/libc/string/strlen.c # found in library $ global access ../../../usr/src/sys/kern/vfs_syscalls.c # found in kernel $ ln -s /usr/src/lib . $ ln -s /usr/src/sys . $ gtags $ global strlen lib/libc/string/strlen.c $ global access sys/kern/vfs_syscalls.c |
$ global -c kmem # maybe k..k.. kmem..
kmem_alloc
kmem_alloc_pageable
kmem_alloc_wait
kmem_free
kmem_free_wakeup
kmem_init
kmem_malloc
kmem_suballoc # This is what I need!
$ global kmem_suballoc
../vm/vm_kern.c
$ funcs()
> {
> local cur
> cur=${COMP_WORDS[COMP_CWORD]}
> COMPREPLY=(`global -c $cur`)
> }
$ complete -F funcs global
$ global kmem_<TAB><TAB>
kmem_alloc kmem_alloc_wait kmem_init
kmem_alloc_nofault kmem_free kmem_malloc
kmem_alloc_pageable kmem_free_wakeup kmem_suballoc
$ global kmem_s<TAB>
$ global kmem_suballoc
../vm/vm_kern.c
|
$HOME/.emacs +------------------------------------------------------ |(setq load-path (cons "/home/owner/global" load-path)) |(autoload ‘gtags-mode "gtags" "" t) (global-set-key (kbd "M-<f1>") ‘gtags-find-file) (global-set-key (kbd "M-<f2>") ‘gtags-find-tag) (global-set-key (kbd "M-<f3>") ‘gtags-find-rtag) (global-set-key (kbd "M-<f4>") ‘gtags-find-symbol) (global-set-key (kbd "M-<f5>") ‘gtags-find-with-grep) |
在浏览器中显示当前屏幕 跳转到输入的文件处 通过grep命令搜索 在tag文件中搜索引用 在tag文件中搜索符号 在tag文件中搜索定义 从当前表达式获得tag名并跳转 以当前位置作为tag跳转 在另一个窗口中打开tag跳转 搜索文件并查询 tag名字补全 开启gtags mode 显示当前文件的tag 从栈中移动到上一个点 从tag列表中选择一个tag 选择一个tag 通过某个事件选择tag 在其他window中选择tag 访问tag文件根目录 |
gtags-display-browser
gtags-find-file
gtags-find-pattern
gtags-find-rtag
gtags-find-symbol
gtags-find-tag
gtags-find-tag-by-event
gtags-find-tag-from-here
gtags-find-tag-other-window
gtags-find-with-grep
gtags-find-with-idutils
gtags-make-complete-list
gtags-mode
gtags-parse-file
gtags-pop-stack
gtags-select-mode
gtags-select-tag
gtags-select-tag-by-event
gtags-select-tag-other-window
gtags-visit-rootdir
|
标签:style io ar os 使用 java for sp strong
原文地址:http://www.cnblogs.com/elvalad/p/4069656.html