Main Content

Source Code in Polyspace Platform User Interface

This topic focuses on the Polyspace® Platform user interface. To learn about the equivalent pane in the Polyspace desktop user interface, see Source Code in Polyspace Desktop User Interface.

The Source pane shows the source code with the defects colored in red and the corresponding line number marked by Defect icon in Source Code pane..

File open in source code with defect in red and marked by red circle icon

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:

Context menu when selecting a text string in the Source Code pane

For example, if you right-click the variable j, you can use the following options to examine and navigate through your code:

  • Search For "j" in Current Source — List occurrences of the string within the current source file on the Code Search pane.

  • Search For "j" in All Source Files — List occurrences of the string within the source files on the Code Search pane.

  • Search For All References — List all references in the Code 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 j. 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 Cause — If you select a defect, the option Go To Cause can show. Selecting this option relocates the Source Code pane to the line of code Polyspace has identified as a probable cause of the defect.

  • 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 a macro icon Macro M icon. to identify source code lines with macros.

Unexpanded macro in the Source Code pane.

Select the icon to display the contents of macros on that line in a box.

Expanded macro in the Source Code pane.

To display the normal source code again, click the arrow icon that replaces the macro icon.

To display or hide the content of all macros:

  1. Right-click anywhere on the source.

  2. From the context menu, select either Expand All Macros or Collapse All Macros.

Note

  1. The Result Details pane also allows you to view the contents of a macro if the check you select lies within a macro.

  2. You cannot expand OSEK API macros in the Source pane.

Manage Multiple Files in Source Code Pane

You can view multiple source files in the Source pane.

Right-click on a file name in the Source Code pane toolbar. From the context menu, you can:

  • Close - Close the currently selected source file. You can also use the χ button to close tabs.

  • Close All Except <filename> - Close all source files except the currently selected file.

  • Close All - Close all source files.

  • Sub-Tile - Split the Source window vertically or horizontally to display the selected source file alongside another file. Select the option Single to revert the Source Code pane back to a one tile view.