Download - Freescale Semiconductor

Transcript
Chapter 7 Debugging Embedded Linux Software
Click File System. The Open dialog box appears.
Navigate to the location of the exec-1.elf file in your project directory.
Select the exec-1.elf file name.
Click Open. The host-side location of exec-1.elf appears in the Additional
Executable File text box.
g. Select the Load Symbols checkbox.
h. Select the Download to Device checkbox. The Specify the remote download
path field is activated.
c.
d.
e.
f.
NOTE
If you do not want to download the selected file on the
target platform, do not select the Download to Device
checkbox.
i. Type /tmp in the Remote download path text box. The shared library will be
downloaded to this location when you debug or run the executable file.
j. Click OK. The settings are saved.
24. Click Apply to save the settings made to the launch configuration.
25. Set breakpoints in the child and parent processes.
a. Double-click the fork.c file name in the CodeWarrior Projects view.
b. Set a breakpoint in the code of the child process at this line: x=0;
c. Set a breakpoint in the code of the parent process.
d. Close the fork.c file.
26. Select Run > Debug.
The debugger window appears and the Fork project starts debugging. As a result, the
Fork.elf and libfork2clone.a files are downloaded on the target system.
27. Step over the code until you reach the line of code that calls the fork() system call:
pid = fork ();
When the fork() system call is called, the child process debugger window appears.
You can now perform normal debugging operations in this window.
28. Step over the code in the child process debugger window a couple of times.
29. Next, step over the code in the parent process debugger window a couple of times.
NOTE
The console window of the parent process is shared by the
child process.
30.
31.
32.
33.
Terminate the debug session.
Clear previously set breakpoints.
Select Run > Debug for Exec project.
Set a breakpoint in the Exec.c file on the line containing the execv() function call.
CodeWarrior Development Studio for Power Architecture Processors Targeting Manual, Rev. 10.5.0,
06/2015
Freescale Semiconductor, Inc.
261