Why does the Eclipse debugger open up random classes when debugging

Why does the Eclipse debugger open up random classes when debugging?

I’m new to Java and use Eclipse.

When using the debugger’s step into button, it will sometimes open up a new class with loads of code and comments. It will then start stepping through a few lines of the new class it opened and then jump back to my class.

Sometimes it opens up more than one class and takes 20 steps to jump back to my code.

Can someone give me a simplified explanation why this happens and what the new class it opened is for?

——

Step into – An action to take in the debugger. If the line does not contain a function it behaves the same as “step over” but if it does the debugger will enter the called function and continue line-by-line debugging there.

Step over – An action to take in the debugger that will step over a given line. If the line contains a function the function will be executed and the result returned without debugging each line.

So what is happening in your case is debugger is going through function’s implementation from the framework or library that you used, which is invoked in your code.

As mentioned in the comments used step over instead of step into, so the debugger will not go through those framework or library source code.

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注