Command line processing in LLVM
Updated in 2023-05.
There are two libraries for processing command line options in LLVM.
llvm/Support/ComandLine.h
See https://llvm.org/docs/CommandLine.html for documentation.
Global variables (mostly llvm::cl::opt<type>, some
llvm::cl::list<type>) are most common to represent
command-line options. The llvm::cl::opt constructor
registers this command line option in a global registry. The program
calls llvm::cl::ParseCommandLineOptions(argc, argv, ...) in
main to parse the command line options. opt
supports various integer types, bool,
std::string, etc. Defining some specialization can support
support custom class/enum types.
gcov與LLVM中的實現
打算以後不定期寫一點LLVM的學習(開發)筆記。寫作上不想過多花時間(加語文水平所限...),所以字句不作過多斟酌。
gcov
https://gcc.gnu.org/onlinedocs/gcc/Gcov.html
_Optimally Profiling and Tracing Programs_描述了一個edge-frequency/edge-placement problem。 選擇control-flow graph的一些邊,加上監控代碼,推導所有邊的執行次數。 gcov是一種實現。
在gcov的模型中,一個源文件包含若干函數,一個函數包含若干基本塊,一個基本塊佔據若干行,這些信息保存在.gcno文件中。
Instrument程序,在基本塊間轉移時記錄邊的執行次數,程序退出時爲每個translation
unit輸出一個.gcda文件。
.gcda文件可以累計多次程序執行的計數。
-fpatchable-function-entry=N[,M]
The Linux kernel uses many GCC options to support ftrace.
2019年總結——工具鏈的一年
2017年10月第一次给LLVM提交patch,到2019年底已经贡献两年多了。今年800 commits,灌水很多,挑出一些值得一提的。
C++ language server ccls一周年
2018年4月1日我寫了ccls: a fork of the C++ language server cquery,宣告ccls誕生。如今一週年,有必要記錄下這一年的點點滴滴。
Real World CTF 2018 rwext5命題報告
史上最强国际顶尖战队集结5大洲、15个国家地区、20支战队。近5年共计获得150次CTF全球冠军。100名最强CTF选手,48小时不间断赛制。12月1-2日,中国郑州、长亭科技,首届Real World国际CTF网络安全大赛,线下总决赛,大幕开启!
我也好想去鄭州啊😭
In November, I created a forensics/reversing challenge "rwext5" for Real World CTF 2018 Finals.
2018-09-09 ccls最近更新
加了一些initialization options,參見https://github.com/MaskRay/ccls/tree/master/src/config.h。