Debugging Externally Built Executable Files. NXP CodeWarrior Development Studio
Iklan
Iklan
Option
Connection Type
TAP address
Chapter 5 Working with Debugger
Table 5-27. Debug Target Settings page settings (continued)
Description
Specifies the interface to communicate with the hardware.
Enter the IP address of the selected TAP device.
5.14 Debugging Externally Built Executable Files
You can use the
Import a CodeWarrior Executable file wizard to debug an externally built executable file, that is, an executable (
.eld
) file that has no associated CodeWarrior project.
For example, you can debug a
.eld
file that was generated using a different IDE. The process of debugging an externally built executable file can be divided into the following tasks:
•
•
•
Specify the Source Lookup Path
•
5.14.1 Import an Executable File
First of all, you need to import the executable file that you want the CodeWarrior IDE to debug.
The IDE imports the executable file into a new project.
To import an externally built executable file, follow these steps:
1. From the CodeWarrior IDE menu bar, select File > Import.
The Import wizard appears.
2. Expand the CodeWarrior group.
3. Select CodeWarrior Executable Importer to import a StarCore
.eld
file.
4. Click Next.
The wizard name changes to Import a CodeWarrior Executable file and the
Import a CodeWarrior Executable file page appears.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
199
Debugging Externally Built Executable Files
5. In the Project name text box, enter the name of the project. This name identifies the project that the IDE creates for debugging (but not building) the executable file.
6. Clear the Use default location checkbox and click Browse to specify a different location for the new project. By default, the Use default location checkbox is selected.
7. Click Next.
The Import C/C++/Assembler Executable Files page appears.
8. Click Browse.
The Select file dialog box appears. Use the dialog box to navigate to the executable file that you want to debug.
9. Select the required file and click Open.
The Select file dialog box closes. The path to the executable file appears in the File
to import text box.
10. Check the Copy the selected file to current project folder checkbox to copy the executable file in the current workspace.
11. Click Next.
The Processor page appears.
12. Select the appropriate target processor from the StarCore Family list.
13. Click Next.
The Debug Target Settings page appears.
14. Select a debugger connection type for the execution of the specified executable file:
• Simulator: If you select this option, the program executes on a software simulator.
• Hardware: If you select this option, the program executes on the hardware available for the product.
15. Select the connection type you want to use, from the Debugger Connection Types group.
16. Select the board, you plan to use, from the Board drop-down list.
17. Select the launch configurations, that you want to include in your project and the corresponding connection configuration.
NOTE
For more information on remote systems, see CodeWarrior
Development Studio Common Features Guide
.
18. Click Finish.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
200 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
The CodeWarrior Executable Importer wizard creates a new project according to your specifications. You can access the project from the CodeWarrior Projects view in the IDE.
5.14.2 Edit the Launch Configuration
Using the tabs of the Debug Configurations dialog box, you can change the launch configuration settings that you specified while importing the
.eld
file.
To edit the launch configuration for your executable file, follow these steps:
1. Click the Debugger tab of the Debug Configurations dialog box.
The corresponding page appears.
2. Configure the debugger options as appropriate for your executable file.
For example, specify the appropriate target processor, any initialization files, and connection protocol.
5.14.3 Specify the Source Lookup Path
Source lookup path is specified in terms of the compilation path and the local file system path.
The CodeWarrior debugger uses both these paths to debug the executable file.
The compilation path is the path to the original project that built the executable file. If the original project is from an IDE on a different computer, you need to specify the compilation path in terms of the file system on that computer.
The local file system path is the path to the project that the CodeWarrior IDE creates to debug the executable file.
The CodeWarrior IDE supports automatic as well as manual path mapping.
In this section:
•
•
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
201
Debugging Externally Built Executable Files
5.14.3.1 Automatic Path Mapping
This section describes how to set automatic path mapping for your project.
The Automatic Path Mapping feature focuses on reducing as much as possible the manual steps required by the user to set up the path mapping settings to support source level debugging.
For automatic path mapping, use these steps:
1. In the CodeWarrior Projects view, expand Binaries folder.
2. Right-click the
*.eld
file and select Properties from the context menu that appears.
The Properties for <project>.eld dialog box appears.
3. Select Path Mappings from the list.
The Path Mappings page appears. The Path Mapping Configuration page displays every path mapping settings for the launch configurations associated with a project.
You can edit either a single set of settings for all launch configurations associated with a project or the settings for a given launch configuration by selecting the appropriate value from the launch configuration combo box.
Under each path mapping, the table displays a list of source files that exist in the binary executable that share the same source mapping prefix. In the Local Path column, a green ( ) is displayed if the file exists after being mapped by the destination path or a red ( ) if it does not. Also, the local path itself is displayed in red if it does not exist on the local file system.
A default folder named Files Not Mapped is created if the user explicitly removes existing mappings. All unmapped files that are not found on the file system are automatically shown under this folder.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
202 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
Figure 5-37. Automatic Path Mapping
The table below describes various options available in the Path Mappings page.
Options
Auto Correct
Add
Remove
Edit
Up
Down
Table 5-28. Automatic Path Mappings
Options
Description
The Auto Correct button automatically iterate through all the files not found on the file system and attempt to group them with their common prefix. This action often generates satisfactory results from the source files listed in the binaries so that the manual steps required by the user are kept at a minimum.
The Add button allows you to create a new Path Mapping entry. If any paths are selected, the dialog will be pre-initialized with their common prefix.
The Remove button allows you to remove any path mapping or default entry.
The Edit button allows you to change the values of the selected path mapping entry. Editing non-path mapping entry is not supported.
The Up button allows the user to reorder the entries by moving the selected entry up in the list. Note that path mappings need always to be grouped together, and as such moving up the top most path mapping will always move its siblings above the preceding entry as well.
The
Down button allows the user to reorder the entries by moving the selected entry down in the list. Note that path mappings need always to be
Table continues on the next page...
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
203
Debugging Externally Built Executable Files
Table 5-28. Automatic Path Mappings Options
(continued)
Options
Restore Defaults
Description
grouped together, and as such moving down the bottom most path mapping will always move its siblings below the following entry as well.
The Restore Defaults button resets the launch configuration path mappings settings to their previous values, including the library path mapping automatically generated by the APM plug-in.
NOTE
If you create a new path mappings manually from the source lookup path, the source files are automatically resorted to their most likely path mapping parent.
4. Click OK.
The Path Mappings dialog box closes.
5.14.3.2 Manual Path Mapping
This section describes how to set path mapping manually in your project.
To manually specify the source lookup path for the newly imported executable file, use these steps:
1. Click the Source tab of the Debug Configurations dialog box.
The corresponding page appears, as shown in the figure below.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
204 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
Figure 5-38. Debug Configurations - Source Page
Like Source tab, you can also use Edit Source Lookup Path dialog box to manually specify the source lookup path. To open the Edit Source Lookup Path dialog box, right-click in the Debug view and select Edit Source Lookup.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
205
Debugging Externally Built Executable Files
Figure 5-39. Edit Source Lookup Path Dialog Box
2. Click Add.
The Add Source dialog box appears.
3. Select Path Mapping (see the figure below).
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
206 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
Figure 5-40. Add Source Dialog Box
4. Click OK.
The Path Mappings dialog box appears (shown in the figure below).
5. In the Name text box, enter the name of the new path mapping.
The name you enter also appears in the Source Lookup Path list of the Source page.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
207
Debugging Externally Built Executable Files
Figure 5-41. Path Mappings Dialog Box
6. Click Add.
7. In the Compilation path text box, enter the path to the parent project of the executable file, relative to the computer that generated the file.
For example, the computer on which you debug the executable file is not the same computer that generated that executable file. On the computer that generated the executable file, the path to the parent project is
D:\workspace\originalproject
. Enter this path in the Compilation path text box.
Tip
You can use the IDE to discover the path to the parent project of the executable file, relative to the computer that generated the file. In the C/C++ Projects view of the C/C+
+ perspective, expand the project that contains the executable file that you want to debug. Next, expand the group that has the name of the executable file itself. A list of paths appears, relative to the computer that generated the file. Search this list for the names of source files used to build the executable file. The path to the parent project of one of these source files is the path you should enter in the
Compilation path text box.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
208 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
8. In the Local file system path text box, enter the path to the parent project of the executable file, relative to your computer. Alternatively, click the Browse button to specify the parent project.
Suppose the computer on which you debug the executable file is not the same computer that generated that executable file. On your current computer, the path to the parent project of the executable file is
C:\projects\thisproject
. Enter this path in the Local file system path text box.
9. Click OK.
The Path Mappings dialog box closes. The mapping information now appears under the path mapping shown in the Source Lookup Path list of the Source page.
10. If needed, change the order in which the IDE searches the paths.
The IDE searches the paths in the order shown in the Source Lookup Path list, stopping at the first match. To change this order, select a path, then click the Up or
Down button to change its position in the list.
11. Click Apply.
The IDE saves your changes.
5.14.4 Debug Executable File
You can use the CodeWarrior debugger to debug the externally built executable file.
To debug the executable file:
1. Select the project in the CodeWarrior Projects view.
2. Click the Debug button from the IDE toolbar.
The IDE switches to Debug perspective listing the debugging output.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
209
Debugging Externally Built Executable Files
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
210 Freescale Semiconductor, Inc.
Chapter 6
Target Initialization File
This chapter explains the target initialization file and lists an example.
The initialization file is a text file that contains commands that tell the debugger how to initialize your hardware after reset but before downloading code. Use the initialization file commands to write values to various registers, core registers, and memory locations.
To use an initialization file, you must check the Use Initialization File box and specify the name of your initialization file in the Debugger settings panel.
The target initialization files for the StarCore 3900FP DSP targets are available at:
Windows
<CWInstallDir>\SC\StarCore_Support\Initialization_Files\RegisterConfigFiles\
For example,
B4860_QDS_Init.tcl
.
NOTE
You can customize the contents of
B4860_QDS_Init.tcl
if needed.
For details about commands, see
.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
211
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
212 Freescale Semiconductor, Inc.
Chapter 7
Memory Configuration File
This chapter explains the memory configuration file, and lists an example.
The memory configuration file is a text file that contains commands that tell the compiler how to initialize the hardware memory after reset, but before downloading code. Use the memory configuration files to write values to various memory locations.
The memory configuration files are available at the following location:
<CWinstallDir>\SC\StarCore_Support\Initialization_Files\MemoryConfigFiles
The syntax for memory configuration is defined in each of memory configuration files available with the CodeWarrior layout. For example, you can refer to the
B4860_Memory_Example.mem
file at the mentioned location.
To specify memory configuration file for a target:
1. Open the Debug Configurations dialog box.
2. Click the Edit button in the Target settings area.
The Properties for <connection> dialog box appears.
3. Click the Edit button next to the Target field.
The Properties for <project> Target dialog box appears.
4. Select the target for which you want to specify the memory file from the Target type drop-down list.
5. Click the Memory tab.
6. Check the Memory configuration checkbox for the target or core(s) for which you want to specify the memory file.
7. Click the corresponding Memory configuration file column.
8. Locate and specify a valid memory configuration file using the Memory
Configuration File dialog box that appears on clicking the Ellipse button in the
Memory configuration file column.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
213
Figure 7-1. Specify Memory Configuration File
9. Click OK.
The specified memory configuration file appears in the Memory configuration file column.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
214 Freescale Semiconductor, Inc.
Unduh
Iklan