Source Code in Polyspace Desktop User Interface
This topic focuses on the Polyspace® desktop user interface. To learn about the equivalent pane in the Polyspace Access™ web interface, see Source Code in Polyspace Access Web Interface (Polyspace Access).
The Source pane shows the source code with the defects colored in red and the corresponding line number marked by .
Placing your cursor over a result displays a tooltip that provides range information for variables, operands, function parameters, and return values.
Examine Source Code
On the Source pane, if you right-click a text string, the context menu provides options to examine your code:
For example, if you right-click the variable i
, you can use the
following options to examine and navigate through your code:
Search "j" in Current Source — List occurrences of the string within the current source file on the Search pane.
Search "j" in All Source Files — List occurrences of the string within the source files on the Search pane.
Search For All References — List all references in the Search pane. The software supports this feature for global and local variables, functions, types, and classes.
Go To Definition — Go to the line of code that contains the definition of
i
. The software supports this feature for global and local variables, functions, types, and classes. If a definition is not available to Polyspace, selecting the option takes you to the declaration.Go To Line — Open the Go to line dialog box. If you specify a line number and click Enter, the software displays the specified line of code.
Expand All Macros or Collapse All Macros — Display or hide the content of macros in current source file.
Expand Macros
You can view the contents of source code macros in the source code view. A code information bar displays icons that identify source code lines with macros.
When you click a line with this icon, the software displays the contents of macros on that line in a box.
To display the normal source code again, click the line away from the box, for example, on the icon.
To display or hide the content of all macros:
Right-click anywhere on the source.
From the context menu, select either Expand All Macros or Collapse All Macros.
Note
The Result Details pane also allows you to view the contents of a macro if the check you select lies within a macro.
You cannot expand OSEK API macros in the Source pane.
Manage Multiple Files in Source Pane
You can view multiple source files in the Source pane.
Right-click on the Source pane toolbar.
From the Source pane context menu, you can:
Close - Close the currently selected source file. You can also use the χ button to close tabs.
Close Others - Close all source files except the currently selected file.
Close All - Close all source files.
Next - Display the next view.
Previous - Display the previous view.
New Horizontal Group - Split the Source window horizontally to display the selected source file below another file.
New Vertical Group - Split the Source window vertically to display the selected source file side-by-side with another file.
Floating - Display the current source file in a new window, outside the Source pane.
View Code Block
On the Source pane, to highlight a block of code, click either its opening or closing brace. If the brace itself is highlighted, click the brace twice.