I have a compiled program which I want to know if a certain line exist in it. Is there a way, using my source code, I could determine that?
Tony commented on my message so I’ll add some info:
- I’m using the g++ compiler.
- I’m compiling the code on Linux(Scientific)/Unix machine
- I only use standard library (nothing downloaded from the web)
- The desired line is either multiplication by a number (in a subfunction of a while group) or printing a line in a specific case (if statement)
I need this becouse I’m running several MD simulations and sometimes I find my self in a situation where I’m not sure of the conditions.
objdump is a utility that can be used as a disassembler to view executable in assembly form.
Use this command to disassemble a binary,
Important to note though that disassemblers make use of the symbolic debugging information present in object files(ELF), So that information should be present in your object files. Also, constants & comments in source code will not be a part of the disassembled output.