If I put a breakpoint somewhere in the code, it is pausing when the program is about to read that line of code.
Sometimes while the program is running, I want to pause it. I do not know which line of code it is reading currently. Is it possible to pause the execution whereever it is, as if a breakpoint exists there?
TL;DR Right click in the area where you'd normally set breakpoints, select “never pause here” and you can prevent the debugger from stopping on exceptions or debugger statements.
You can press the Pause button in the debug toolbar (or hit ^⌘Y/Alt+Ctrl+Break or choose "Debug|Pause from the menu). Your application can hit a Breakpoint you have set. Your application can raise an Exception, either explicitly from your own code, or in an API your code called.
The easiest way to pause or “break” execution to inspect a line of code is to use a breakpoint, a tool that allows you to run your code up to a specified line before stopping. Breakpoints are an essential aspect of debugging, which is the process of detecting and removing errors and bugs from your code.
In user mode, this command stops the process and its threads, enabling you to regain control of the debugger. In kernel mode, this command breaks into the target computer. You can also use this command while the debugger is active.
Is it possible to pause the execution whereever it is, as if a breakpoint exists there?
Yes, when debugging, these are your options:
Using the GUI, click on the highlighted pause icon:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With