ODK Build Environment
Dialog Box Resource File Editor
See Chapter 3 “Dialog Box Resource File Editor” on page 65 for a detailed description of this utility.
Debugging ODK Applications
The debugging procedure to follow depends on whether or not you have created a Microsoft Visual C++ (MSVC) project.
Procedure 1: Debugging a Microsoft Visual C++ Project
-
Start Microsoft Visual C++.
-
Open your Netbiz application project workspace.
-
Configure MSVC to stop at exceptions.
3.1 In MSVC, choose Debug > Exceptions…
*Result:* The Exceptions… dialog box appears.3.2 Select all exceptions in the table and select the Stop Always radio button. 3.3 Click Change. Click OK.
-
Make sure you’re using libraries with debugging information.
4.1 In MSVC, choose Build > Set Active Configuration… 4.2 Select the Debug configuration.
-
Start debugging. In MSVC, press F5 to start your application in debug mode.
-
In MSVC, set breakpoints.
- Press F9 to add a breakpoint. Press F9 again to remove the breakpoint.
- Press Alt+F9 to see all breakpoints, conditional breakpoints, and other advanced options.
Procedure 2: Debugging a Netbiz Application That Is Not an MSVC Project
-
Verify that preferences are set as shown in the following table.
Table 2: Preference Settings for Debugging
Preference Windows Linux comp_flags_devel /Od /Zi¹-gbind_shobj_flags_devel /DEBUG“”Note 1: O is the uppercase letter “O”
If you have just set the preferences listed in Table 2, rebuild your libraries with these new settings, as follows.
1.1 Enter the following command to produce 32-bit code:
```text op_mko -m <ets source file> -type ets -m32 -gui ``` where the source file name is of the form `<ets source file>.ets.c`. The resulting output file name is of this form: Windows: `<ets source file>.gui32.i0.ets.obj` Linux: `<ets source file>.gui32.i1.ets.o`1.2 Enter the following command:
```text op_mkso -type ets -f <object files> -m <lib name> ``` where: `<object files>` are files containing code to be used in the library. They are the output from `op_mko` in the preceding step. Include full extensions in the file names. `<lib name>` is the name of the library that will be generated by `op_mkso`. The name is of the form: Windows: `my_library.gui32.i0.ets.dll` Linux: `my_library.gui32.i1.ets.so` -
Start debugging (Windows only).
2.1 Set the netbiz preference
handle_exceptionto FALSE. This allows the debugger to catch exceptions. 2.2 Start your application (generally, by running Netbiz). 2.3 Wait for the Obtaining License To Run progress bar to complete in the Netbiz application.You must wait for all licensing checks to complete before attaching to the process because Riverbed applications run a licensing check and then spawn off the actual application. This means that the application process has a different process ID from the licensing check process.2.4 Start MSVC.
- Close any open workspace. - Choose Build > Start Debug > Attach to Process… Select your application from the list of processes and click OK.2.5 In MSVC, set breakpoints.
- Select File > Open and open the source file within which to set breakpoints. - Press F9 to add a breakpoint. Press F9 again to remove the breakpoint. - Press Alt+F9 to see all breakpoints, conditional breakpoints, and other advanced options. -
Start debugging (Linux only).
3.1 Start your application (generally, by running Netbiz). 3.2 Wait for the Obtaining License To Run progress bar to complete.
**Note:** You must wait for all licensing checks to complete before attaching the process because Riverbed applications run a licensing check and then spawn off the actual application. This means that the application process has a different process ID from the licensing check process.3.3 Find the process ID (PID) of the application (type
psat the command line). 3.4 Start your debugger and attach the process. You might type something like this:```text ddd <install_dir>/18.6/sys/pc_intel_linux/bin/netbiz -<PID> & ``` If you compiled the ets files with `gcc` or `g++`, type this: ```text ddd <install_dir>/18.6/sys/pc_intel_linux/bin/netbiz -<PID> -gdb & ``` If you compiled the ets files with `cc`, type this: ```text ddd <install_dir>/18.6/sys/pc_intel_linux/bin/netbiz -<PID> -dbx & ``` -
Use your debugger-of-choice to set breakpoints.