0

Somewhere in my program is a infinit loop. I start the programm and it does not stop. Since I have no idea where the issue is, I can not use breakpoints.

Is there a way to start debugging manually after a given time in Netbeans? Then the curser should be inside the invalid while loop.

3
  • Put a breakpoint at the start of your program and hold down step over until it's obvious where it's being repeated? Commented Feb 27, 2019 at 16:20
  • 1
    I'm not following your argument: "Since I have no idea where the issue is, I can not use breakpoints". That's precisely when using breakpoints could be helpful. Why can't you simply add multiple breakpoints to progressively locate the code causing the issue, removing the irrelevant breakpoints as you test? Even if your code calls hundreds of methods and has hundreds of loops it shouldn't take many iterations to isolate the cause of the problem. Commented Feb 28, 2019 at 3:38
  • I solved the issue by using breakpoints and doing nested intervals as you said. Howver, in Visual Studio (C++) you can simply hit break, and the debugger stops at the current position. I just wondered, if this functionality is also present in Netbeans. Would probably saved 30 min of my time. Commented Feb 28, 2019 at 7:56

1 Answer 1

1

When you start your program in debugging mode you can hit any time "Debug/Pause" and see under "Window/Debugging/Call Stack" where your program currently is. Another idea would be to use the profiler to see which method uses more time than expected.

Sign up to request clarification or add additional context in comments.

1 Comment

The call stack and profiler are two very good ideas. Not perfect, but good to get quick overview where the problem might be.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.