问题
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