48 3. IOS SOFTWARE DEVELOPMENT TOOLS
• Begin by acquiring the C code to be used for this lab.
• Open the folder containing the project.
• Double click on the file with the extension .xcodeproj.
• Navigate to the C code in the Project Navigator.
e app can be built by going to Product -> Build.
After the project is successfully built, debug points can be placed inside the C code. e
debug points can be placed by clicking on the column next to the line to be debugged or by
pressing CMD + . A blue arrow appears (see Figure L2.1) that points toward the line to be
debugged.
Figure L2.1: Debug point.
e Xcode debugger allows one to:
• pause the execution at a particular line of code,
• know the value of the variable at that particular instant of execution, and
• navigate from function call to function execution as it is executed.
e recent Xcode version at the time of this writing includes the LLDB debugger, which
allows one to view data in an array with a pointer by typing the following command in the debug
console after the debug point is encountered:
memory read -t [Data Type of the array] -c [Number of elements]
`[Name of the array]'
For example, memory read -t float -c12 `buffer'
When this command executes, the output appears, as shown in Figure L2.2.
L2.1 LAB EXERCISE
Debug the broken C code named Lab2BrokenFilter using the Xcode debugger. is code is
supposed to filter out the higher frequency (3600 Hz) sinusoidal signal of a test signal made up