Usually I debug and step on C and C++ level: means I step on C/C++ source lines. But sometimes a finer stepping detail is required. What I need is stepping on assembly level. For first time users of Eclipse, that might not be that obvious, so here is the hint:
In the Debug view toolbar (while debugging), there are the normal stepping commands like ‘step’, ‘step over’ or ‘step out’. All these stepping can be performed on assembly instruction level if I enable the ‘Instruction Stepping Mode’:
With this button enabled, I’m stepping on assembly instructions in the Eclipse/CodeWarrior Disassembly view:
The Disassembly View has a button to ‘Show Source’:
With this I have a ‘mixed’ or ‘interleaved’ view showing both the assembly and source lines :-):
If I’m scrolling through the assembly code, a very useful feature is to show the function name with offset information. That way I immediately see to which function the assembly code belongs to:
This I can configure in the Preferences:
Here I can enable ‘Show functions offset’:
Another useful thing is that I can move the current program counter (PC) to any assembly instruction I want. The only thing I need to keep in mind that I have to use the context menu on the *address* column on the left hand side (Eclipse does not support this on the assembly instruction (yet)):
💡 The ‘Move To Line’ is a nice trick if I want to repeat instructions or want to go back in my code sequence, or to try things without the need to change my code and to download it again.
Eclipse comes with powerful debugging capabilities down to the assembly level. Stepping on assembly level requires pressing a single button. And the ‘Move to Line’ feature is really powerful to try things on the assembly level without the need to recompile my code.
Happy Assembly Stepping 🙂