Assembly Instruction Stepping

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’:

Instruction Stepping Mode: Assembly level stepping

Instruction Stepping Mode: Assembly level stepping

With this button enabled, I’m stepping on assembly instructions in the Eclipse/CodeWarrior Disassembly view:

Assembly Level Stepping in Disassembly View

Assembly Level Stepping in Disassembly View

The Disassembly View has a button to ‘Show Source’:

Show Source in Disassembly View

Show Source in Disassembly View

With this I have a ‘mixed’ or ‘interleaved’ view showing both the assembly and source lines :-):

Source in Disassembly View (Interleaved/Mixed)

Source in Disassembly View (Interleaved/Mixed)

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:

Show Functions

Show Functions

This I can configure in the Preferences:

Disassembly View Preferences

Disassembly View Preferences

Here I can enable ‘Show functions offset’:

Show Functions with Offset

Show Functions with 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)):

Move to Line

Move to Line

💡 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.

Summary

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 🙂

1 thought on “Assembly Instruction Stepping

  1. Pingback: Stepping Backwards while Debugging: Move To Line | MCU on Eclipse

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.