Coccigrep 是一個 C 語言的語義 grep 工具,用于查找代碼中給定的結構定義的位置以及某個屬性、集合被引用的位置。該版本改進了搜索操作,并對每個 coccinelle 補丁增加了一個描述信息。
C語言的語義grep工具( coccigrep)示例
usage: coccigrep [-h] [-t TYPE] [-a ATTRIBUT]
[-o {set,callg,used,func,test,deref}] [-s SP] [-C CONTEXT]
[-A AFTER] [-B BEFORE] [-p NCPUS] [-c] [--cpp] [-V] [-E]
[-f {term,html}] [-v] [-L] [-l FILE_LIST] [--version]
[file [file ...]]
Semantic grep based on coccinelle
positional arguments:
file List of files
optional arguments:
-h, --help show this help message and exit
-t TYPE, --type TYPE C type where looking for
-a ATTRIBUT, --attribut ATTRIBUT
C attribut that is set
-o {set,callg,used,func,test,deref}, --operation {set,callg,used,func,test,deref}
Operation on structure
-s SP, --sp SP Semantic patch to use
-C CONTEXT, --context CONTEXT
Number of lines before and after context
-A AFTER, --after-context AFTER
Number of lines after context
-B BEFORE, --before-context BEFORE
Number of lines before context
-p NCPUS, --process NCPUS
Number of cpus to use
-c, --color colorize output (need pygments)
--cpp Activate coccinelle C++ support
-V, --vim vim output
-E, --emacs emacs output
-f {term,html}, --output-format {term,html}
colorize format for output
-v, --verbose verbose output (including coccinelle error)
-L, --list-operations
List available operations
-l FILE_LIST, --file-list FILE_LIST
File containing a list of files to search in
--version show program's version number and exit
- PC官方版
- 安卓官方手機版
- IOS官方手機版