Admin Production ni-theme
Current Publication

Debugging DLLs

LabWindows/CVI

Debugging DLLs

In the LabWindows/CVI development environment, you can debug only those DLLs that you create in LabWindows/CVI. Other development environments cannot debug DLLs you create in LabWindows/CVI.

When you build a debuggable DLL, LabWindows/CVI includes debug code in the DLL. The amount of debugging information included in the DLL depends on the value of the Debugging level option in the Build Options dialog box. LabWindows/CVI must be able to find the location of the source files for the DLL to debug the DLL.

You can debug a DLL two ways. You can run a LabWindows/CVI executable project that calls the DLL, or you can open the DLL project and run an external process that uses the DLL.

Running a Program in LabWindows/CVI

To debug a DLL that a LabWindows/CVI executable calls, load the executable project and then select Run»Debug xxx.exe, where xxx.exe is the filename of the executable. The executable loads the DLL, which also includes the debug information.

LabWindows/CVI honors breakpoints you set in DLL source files. You also can set watch expressions for a debuggable DLL. You can debug multiple DLLs called from the same project. LabWindows/CVI handles each DLL in the same manner.

Running an External Process

To debug a DLL that an external process uses, load the DLL project into LabWindows/CVI. Select Run»Specify Executable and Command Line and enter the pathname of the external process in the Specify Executable and Command Line dialog box. You also can use the Specify Executable and Command Line dialog box to enter command line arguments and a working directory for the external process. LabWindows/CVI stores the external process pathname, command line arguments, and working directory in the workspace.

After you specify the pathname of an external process, the Run»Debug Project menu item changes to Debug xxx.exe, where xxx.exe is the filename of the external process. When you select the Debug xxx.exe command, LabWindows/CVI starts the external process and attaches to it for debugging. LabWindows/CVI honors any breakpoints you set in the source files for the DLL. If the external process loads other debuggable DLLs, you can debug these DLLs also.