The Source view contains two columns with a gray background on the left that contain the
line number and bullets that represent executable code locations. The right side of the view
contains your source code.
The button with the green arrow scrolls the code browser to the location of the statement
or instruction that is to be executed next. You can find this button at the top left of the
Source view window.
Figure 2-19 Arrow button for scrolling code
Click on the left-most column in the Source code view to highlight
the corresponding addresses in the disassembly view. The highlighting
reveals the instructions the source statement maps to.
Highlighting is only available for source lines with a bullet.
The bullet indicates that the line is executable.
Double-click on a bullet to set a breakpoint on the source line. A filled red circle is
displayed next to the line to indicate that a breakpoint has been set.
The Source code view title bar has additional controls for:
Selecting a target line in the source using the Line: entry box.
Selecting a source file that has already been loaded using the File: drop
Opening the Debug Source Files dialog box.
Debug Source Files dialog box
The Debug Source Files dialog box lets you locate source files required for
debugging an application. To open the dialog box, click on the icon in the upper right
corner of the Source view.
Pathnames are displayed with slash (/) characters, even on
Windows. This does not affect operation.
Figure 2-21 Debug Source Files dialog box
The tabs switch between two different views that list the
properties for the source file:
This column contains a list of files referred to
by the debugged application. This column is not shown in Hierarchy view.
- Debug pathname
This column shows the path for the respective file
taken from the debug information of the application. This path might
be invalid as it refers to the original source file at compilation
time. The debug pathname can be absolute or relative to the executable.
- Actual pathname
This column contains the path Model Debugger actually
uses to locate the file. If the last column is empty or contains
an invalid path, the path can be set by double-clicking a row or
selecting a row and clicking Open File. The
File Open dialog box displays to enable selecting the source file.
After selecting the file, the file is opened in the debugger.
Click on Find File to display the Find source file dialog box and navigate
to the directory containing the source.
Figure 2-22 Find Source File dialog box
Click on Properties to display the File Properties dialog box for the
selected file. You can also use the Find File button on the File
Properties dialog box to locate the file.
Figure 2-23 Source File Properties dialog box
Model Debugger has an automatic mechanism to add replacement
paths that are invoked every time you are prompted to find a source
file. If the source file is found, an automatic source
path replacement is calculated.
This path might not always be correct, and there are situations
where you must manually edit source path replacements because the
automatic path is wrong for the specific context. You might, for
example, have a header file whose name is common between two different
compilers, and Model Debugger chooses the wrong one.
Click on Source Paths… to open the Source Path Replacements dialog
box. Use this dialog box to change the path, or priority of the paths, to the source files
for the application.
The source path replacements are stored in the Model Debugger
session file and not with user preferences.
Figure 2-24 Source Path Replacement dialog box
Existing source file replacements are displayed in the top part of the Source Path Replacement
dialog box. You can remove or reorder paths by highlighting an entry and clicking one of the
- Move Up
Move the selected path up one position in the list.
- Move Down
Move the selected path down one position in the
- Remove Entry
Delete the selected path from the list.
Debug Path and Actual Path have the same
meaning as in the Debug Source Files dialog box.
In the lower part of the Source Path Replacement dialog box,
you can add new source paths or modify existing ones. The additional
Provides a tree view that simplifies navigation
through the debug paths found in the debug information of the source
Click this button to select an path with a browser
rather than typing in the actual path directly.
- Apply Changes
Modify the selected entry using the changes entered.
- Insert as New Entry
Adds the new path to the source path replacement
Searching in source files
You can search for text in the active window by using the Find dialog box. The active window is
surrounded by a thin black frame. Click Find on the
Search menu to open the Find dialog box.
Figure 2-25 Find dialog box
Type the text to find in the box and click the Find Next or
Find Previous buttons to search upwards or downwards from the
current cursor position. Re-use previous search terms by clicking on the drop-down arrow on
the right of the text entry box.
The dialog box is modeless, so you can change views without
closing it. The mode is updated automatically.