LLVM instrumentation

a 夏天 提交于 2019-12-13 08:48:30

问题


Recently, I am doing some research with LLVM.

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

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

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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/21060434/llvm-instrumentation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!