The Virtual Debugger is a powerful new tool in Understand, designed to help you step through your code sequentially, identify issues, and better comprehend the flow of your program.
With the Virtual Debugger, you can:
- Analyze decision points: Step through if-else statements, switch statements, and other decision points to see which branches are taken and why.
- Identify issues with function calls: Examine input parameters, return values, and the behavior of called functions.
- Understand loop behavior: See how loops iterate, update variables, and evaluate conditions.
- Simplify complex code: Break down complex code into manageable pieces and understand the overall flow.
Accessing the Virtual Debugger
There are three options for accessing the Virtual Debugger:
- Right-click context menu: Right-click on a function entity and select "Virtual Debugger" from the context menu.
- Shortcut: Use the shortcut Ctrl + Shift + B with a function entity selected.
- Toolbar icon: Click on the new bug icon in the toolbar.
Navigating the Virtual Debugger
You can navigate the Virtual Debugger using your keyboard:
- Up Arrow: Previous statement
- Down Arrow: Next statement
- Right Arrow: Enter block
- Return/Enter: Enter selected function
- Esc: Exit current function
A green arrow indicator will show you what line you are on in the source code at any given point. If you are at a function call that can be entered, another small green indicator will appear underneath the accessible function.
Watch this video to see the Virtual Debugger in action: