Get the address of the program entry point and insert a breakpoint at this address.
One way to do this is to make information files that give you, for example, "Entry Point: 0x4045a4". Then do "break * 0x4045a4". After starting, the program will stop immediately.
Here you can use single step instructions (e.g. step or stepi).
You did not say which system you are trying to debug. If the code is in read-only memory, you may need to use hardware breakpoints (hbreak) if supported by this system.
source share