Mapping Between LLVM IR and x86 Instructions

依然范特西╮ 提交于 2021-02-08 06:36:43

问题


Is there an easy way to map to LLVM instructions from their associated assembly instructions in the output binary? Given an instruction in an x86 binary, I would like to be able to determine with which LLVM IR instruction it is associated.

One possibility would be to compile the binary with debug symbols turned on and then associate the instructions based off of source code line, but that seems like a hack and is prone to having a many-to-many mapping between x86 and LLVM IR when ideally it would be a many-to-one mapping.


回答1:


It looks like the LLVM -debug-ir does exactly what I want:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073020.html



来源:https://stackoverflow.com/questions/25244304/mapping-between-llvm-ir-and-x86-instructions

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