Search code examples
javadebuggingintellij-idea

What is the difference between "Step Into" and "Force Step Into" in the IntelliJ IDEA debugger?


What is the difference between step into and force step into in debugging?


Solution

  • From my own observation using the IntelliJ debugger over the years, if you try to step into a method call on a given line of code, the following will happen:

    • if the code being called be your own code, then the debugger will step into that method
    • if the code being called be some third party library, then the debugger will ignore your request, and instead step over that line

    By telling IntelliJ to force step into a line, in the case of a third party method, it will then try to find source code for that method. If it can't find source code, then it might show you an auto generated stub based on the byte code/library. But, there may not be any code shown, or if there is, it would be IntelliJ's best guess based on byte code.