本文介绍了LLVM仪器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我正在用LLVM做一些研究.

Recently, I am doing some research with LLVM.

首先,我想向工具.bc文件写入一个通行证.

At first, I want to write a pass to instrument .bc file.

因此,它将记录我的.bc文件基本块的执行路径.

Thus, it will record the execution path of the basic block of my .bc file.

然后,我想将此.bc文件命名为.exe文件.请给我您的建议,如果您有一些使用LLVM的示例,请告诉我.

Then, I want to term this .bc file into .exe file. Please give me your suggestions and if you have some examples for instrumentation of LLVM, please show me.

推荐答案

LLVM已经内置了许多检测工具.在源代码树的lib/Transforms/Instrumentation目录中查看.

LLVM already comes with a number of instrumentation tools built-in. Take a look in the lib/Transforms/Instrumentation directory in the source tree.

最著名的通行证之一是 Address Sanitizer ,这是一种基于工具的内存错误探测器(有点像Valgrind,但速度要快得多). Address Sanitizer具有运行时组件+插入工具的LLVM传递;通行证居住在lib/Transforms/Instrumentation/AddressSanitizer.cpp中.在此页上 .

One of the best known passes is Address Sanitizer, an instrumentation-based memory error detector (kinda like Valgrind, but significantly faster). Address Sanitizer has a runtime component + a LLVM pass that inserts instrumentation; the pass lives in lib/Transforms/Instrumentation/AddressSanitizer.cpp. There's some description of how it works on this page.

这篇关于LLVM仪器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 05:12