C and C++ SoftBench User's Guide
Using SoftBench Debugger
Loading or Rerunning an Executable Program
Chapter 7 169
• If you start SoftBench Debugger from the command line (which
means it has no access to the project data), or if you load an
executable that is not part of the current project, you may need to list
the source directories explicitly by choosing "File: Add Source
Directories…".
Debugging Executables in a Project
When you start SoftBench Debugger from the main SoftBench window,
the debugger benefits from the knowledge SoftBench has about the
executable. SoftBench may provide information like the local workspace
root, the source directories of the files in the project, and the execution
properties for the target. The type of information SoftBench provides to
SoftBench Debugger depends on how the executable was built. When you
use project build, SoftBench knows where to find the source code.
When you use external build, you can successfully build your project
using your Makefile or build script, without telling SoftBench where to
find all the source files.
Adding Source Directories for External Builds
If you run into source location problems with a target from a project
using external build, you can choose: "File: Add Source
Directories…" in SoftBench Debugger. When you need to add source
directories you can specify the source directories in two ways:
• Explicitly list the directories where source can be found.
• List mappings that map the old file location into a new location. For
example, assume the executable file was created under the home
directory of another user, fred. All source and include files existed in
a directory tree under /users/fred. Now you have copied fred's
directory tree under your home directory, /users/myname. You could
specify each directory in the directory tree where files can be found,
but it is simpler to define a mapping: /users/fred=/users/myname.
Now each reference to /users/fred/
dir
maps to
/users/myname/
dir
.
To specify alternate directories:
1. Choose "File: Add Source Directories…".
2. Type the directory names or mappings in the input box of the "Add
Source Directory" dialog box. See Figure 7-4. Or use the … button
to browse the directories.