I would like to be able to compare the asm generated by visual studio and gcc for a particular function. For the sake of argument, lets say that we already know this function exists in both binaries.
What i would like to do is simply run a script that will extract the desired function disassembled (asm) from both binaries. I know how to examine the asm in Visual Studio and gdb respectivly, but i’m a little stumped how to do this in any kind of scriptable manner.
Any ideas or theories would help. Thanks!
Both compilers support a command line option which causes it to leave the generated assembly language as the result of compilation, instead of an object file. With
MSVC, use/Fa[file](and generates the.objtoo—tested with VS2008). Withgcc, the-Scommand line option leaves assembly output.While using the option can be done in the Visual Studio IDE, it seems like a scripted comparison would use a batch file, or other script command line interpreter to compile the files, extract the proper portion with
sedor whatever, and then do whatever comparison is needed.