We can add and remove breakpoints any time during the debug session or before it. For example, you can add specific conditions when the breakpoint will be hit. You can additionally configure how the breakpoint works if you right-click on it. If you click on a breakpoint again, it will be removed. (Here’s the content of the file on this screenshot) Let’s put a breakpoint on a line in which our demo app handles the GET request: click next to the line number in the editor, and you will see a red circle, a breakpoint. With the breakpoints, we can pause the app when a specific line of code is executed and then look at the application state: what variables are now available and what their values are. Now we want to see what’s going on in our app at a specific point. We can double-click on the file to see its content in the editor. The Scripts tab lists all the files loaded into the currently running process. The Console tab shows the messages logged by the app as well as error messages, but we can also use it to evaluate expressions. The Debug tab with Frames and Variables view as well as the stepping icons on top will be activated when the app is stopped on a breakpoint (we’ll talk about it in a moment). On the left side of it, there are the icons for stopping and re-running our configuration. We can now see a new Debug tool window at the bottom of the IDE – it’s a control panel for everything related to debugging. This creates a temporary configuration that, if you want to reuse it, you can save later in the Edit configurations dialog (temporary configs are greyed out). Instead, we could have right-clicked on the JavaScript file in the project view or the editor and selected Debug or pressed Ctrl-Shift-D or Ctrl-Shift-F9 on Windows and Linux. In our case, we could have actually started a debugger without creating a configuration beforehand. Many configurations will do the same, but some other will instead attach the debugger to the already running app. Our Node.js configuration will run the file we’ve specified in it in a debug mode. Once we have our configuration ready, select it in the drop-down list and hit the green debug icon (the one with the bug on it). idea/runConfigurations folder to the version control. If you want to share your configuration with your team, check the Share checkbox in the configuration and then commit the. idea folder in the root of your project so that you can reuse them next time you open this project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |