After that, the program is suspended, allowing you to examine its current state, control its further execution, and test various scenarios at runtime.
tip
If you accidentally closed the Debug tool window, select View | Tool Windows | Debug from the main menu or press Alt05 to reopen it.
tip
To view the tab labels, in the top-right corner of Debug tool window, click the Layout Settings icon () and select Show Tab Labels.
Examine frames
The state of the program is represented by frames. When the program is suspended, the current frame stack is displayed on the Frames tab of the Debug tool window.
Examining frames helps you understand why particular parameters were passed to a PL/SQL object and what the state of the caller was at the time of calling.
Copy stack to clipboard
To copy the call stack , right-click anywhere on the Frames tab and select Copy Stack.
Evaluate expressions
DataGrip lets you evaluate expressions during a debugging session to obtain additional details about the program state or test various execution scenarios at runtime.
The feature is also available in query consoles outside the debug mode.
note
When evaluating expressions, be mindful of variable scope and lifetime. All expressions are evaluated in the context of the current execution point.
This feature only works if the program was suspended after hitting a breakpoint.
If there are breakpoints inside methods called within the expression, they will be ignored.
Evaluate a simple expression in the editor
To quickly evaluate an expression, point at it in the editor. Note that method calls cannot be evaluated this way.
Point at the expression you want to evaluate. The result of the expression appears in a tooltip.
To view child elements of the resulting object, click or press CtrlF1.
If you find value tooltips distracting, you can increase the delay or disable them altogether. To do this, in the Settings dialog (CtrlAlt0S) , go to Build, Execution, Deployment | Debugger | Data Views and set the Show value tooltip and Value tooltip delay options according to your preference.
Watches
tip
If you are looking for information on field watchpoints, refer to the Breakpoints topic.
If you want to keep track of some variable or the result of a more complex expression, set up a watch for this variable or expression. This is useful when you need to evaluate something that is not regularly displayed on the list of variables, or to pin some instance variable thus eliminating the need to expand the tree after each step.
Watches are evaluated in the context of the selected frame. Watches cannot be evaluated when they are out of context or when they fail to compile. If this is the case, the watch is marked with the error icon .
By default, watches are shown together with variables in the Variables pane. To hide/reveal the Watches pane, use the Separate watches option in the Layout Settings menu.
Add a watch
Click New Watch on the Variables tab.
Enter the variable or expression to be evaluated. In expressions, you can evaluate method calls, lambdas declare variables, and so on, as long as this is in the local context.
tip
If the variable or expression that you want to track is already in front of you (for example, in the code editor), you can select and drag it to the Variables pane. For variables in the current context, you can also right-click them in the Variables pane and select Add to Watches from the context menu.
After you have added a variable/expression to Watches, it stays there and is evaluated for each step, providing you with the result in the current context.
Edit a watch
Right-click the desired watch and select Edit.
Copy a watch
Select the watch you want to copy.
Click Duplicate Watch on the Variables/Watches tab or press Ctrl0D.
Change the order of watches
For convenience, you can change the order in which the watches appear on the Variables/Watches pane.
Use the Move Watch Up/Move Watch Down buttons on the Variables/Watches pane or Ctrl0↑ and Ctrl0↓ keyboard shortcuts.
Delete a watch
To remove a single watch, right-click it and select Remove Watch. Alternatively, select the watch and press Delete on the Variables/Watches pane.
To remove all watches, right-click anywhere on the Variables/Watches pane and select Remove All Watches.
Watches allow for the same actions as variables do. For example, you can view them in a dedicated dialog.
Watches are a part of your project. This means you can stop and rerun the debugging session without risk of losing them.
Execution point
Return to the current execution point
Examining the program state involves navigating in code, and you often need to return to the place where your program is suspended.
Do one of the following:
In the main menu, go to Run | Debugging Actions | Show Execution Point.
Press AltF10.
Click on the stepping toolbar of the Debug tool window.
The current execution point is indicated with a blue line. The code at this line has not been executed yet.
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions. Learn more.
With your consent, JetBrains may also use cookies and your IP address to collect individual statistics and provide you with personalized offers and ads subject to the Privacy Notice and the Terms of Use. JetBrains may use third-party services for this purpose. You can adjust or withdraw your consent at any time by visiting the Opt-Out page.