Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a breakpoint halt all threads?

If I have two threads running concurrently in my program and put a breakpoint on one of them, will the other thread stop also halt when this breakpoint is hit, or will it continue executing regardless?

(I am writing in Java and using NetBeans)

like image 328
Eamonn McEvoy Avatar asked Nov 17 '11 21:11

Eamonn McEvoy


People also ask

Does breakpoint stop all threads?

When your program has multiple threads (see section Debugging programs with multiple threads), you can choose whether to set breakpoints on all threads, or on a particular thread. Whenever your program stops under GDB for any reason, all threads of execution stop, not just the current thread.

What is the point of a breakpoint?

In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.

Does breakpoint stop before or after line?

The breakpoint will stop your program just before it executes any of the code on that line. Set a breakpoint at line linenum in source file filename .

How do you trigger a breakpoint?

To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.


1 Answers

Breakpoints have an option how they should behave: to suspend a single thread or all threads

breakpoints

like image 108
szhem Avatar answered Sep 20 '22 15:09

szhem