Better Debugging with Eclipse: Step Into Selection

Some might say that Eclipse is too powerful and has too many features. But to me, the many small and somehow hidden gems can make a big difference in my daily life. One of these features is ‘Step Into Selection’ while debugging.

Very often I have a source line with nested function calls like this:

Nested Functions

Nested Function Calls

I would like to step into the outer function FAT1_CheckCardPresence(), but when I do a ‘step-into’, it will first step into the CLS1_GetStdio() function. So there I have to do a ‘step-out’, and if there are multiple inner (nested) function calls, this requires many ‘step-into’ and ‘step-out’ clicks and operations.

There is a feature to avoid that: Step Into Selection 🙂

I can select or click into the name and use the context menu ‘Step Into Selection’ :

Selection and Step Into Selection

Selection and Step Into Selection

Instead of the context menu, I can use the Run menu too:

Menu Run Step Into Selection

Menu Run Step Into Selection

Or an even better way: I have use CTRL+ALT and click with the mouse (hyperlink mode):

CTRL plus ALT Hyperlink Stepping Into Selection

CTRL plus ALT Hyperlink Stepping Into Selection

Summary

For nested function calls, I do not need to step-into all the nested functions: I can use ‘Step Into Selection’ feature instead. This saves me many steps and clicks every day :-).

Happy Stepping 🙂

Advertisements

5 thoughts on “Better Debugging with Eclipse: Step Into Selection

  1. It’s “better” to factor out the code into multiple lines, so it is (a) easier to understand, and (b) easier to debug. The code will very likely be optimised to the exact same output, so performance is not an issue.

    Like

    • Agreed, that’s sometimes an option. But that might not be economical if that code is not maintained by me. On the other side the tools have to deal with the coding style and should not force us to program for the tools.

      Like

    • That might depend if you have different shortcuts assigned (I’m referring to standard Kinetis Design Studio v3.0.0).
      CTRL alone enables ‘hyperlink’ mode, that means that it underlines the text, but if you click on it (with CTRL), then the *editor* jumps to that location. To have the *debugger* jumping (stepping into selection) that location, I have to use CTRL+ALT. I believe on your end it is the editor function you see (like F3, or ‘Open Declaration), but not ‘step into selection’?

      Like

      • Ah – OK – sorry. I just saw the hyperlink underlining with Ctrl but didn’t check what happened when I clicked on it during a debug session. And I’m using “standard” Eclipse/CDT (Luna) etc. so maybe that’s different to KDS.

        Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

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