LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to NOT debug a certain module

I have an encryption library "ICE" that I am using. When I compile my
program for debugging and run it , it takes a long time for the
ice_intialize() initialization function to return. In the tens of minutes.
But when I compile and run the release version, the initialization function
returns in 20 to 30 seconds, which is OK. I am trying to debug the rest of
my program. I thought that I could exclude the ice.c file from the build and
instead use the ice.niobj file, but that doesn't work. How can I debug the
rest of the program without sticking "probes" into the very slow, memory intensive,
initialization function of ICE?

-Rich
0 Kudos
Message 1 of 3
(3,176 Views)
Try doing the following:

1) Open the ICE.C module and issue the "Create Object File" command you find in the "Options" menu. This creates the ICE.OBJ file.

2) From the Project Window exclude from build ICE.C and add ICE.OBJ.

P.S. In order to further reduce the initialization time, if you can you may compile ICE.C with an optimizing compiler (Visual C++ or Borland C++ for example), and use the ICE.OBJ created in this way instead of the OBJ file generated by CVI.
Remembrr to install the correct compatibility option!!

Giova
Message 2 of 3
(3,176 Views)
Giovanni is right on the money with this one.

Even though CVI creates object files for each of the source files in the project to speed up the build of your exe in some cases (where there are minor changes between builds) you are not supposed to include these .niobj (non-debuggable) or .nidobj (debuggable) files in your project.

The best method to speed up build time and make sure that you are not creating any debugging overhead in your project is to create a .obj out of the source instead.

Here are the instructions and guidelines for this topic straight from the LabWindows/CVI Programmer's Reference Manual:

Creating Object Files in LabWindows/CVI

To create an object file in LabWindows/CVI, open a source (.c) file and select
Options»Create Object File command in the
Source window. In LabWindows/CVI, you can choose to create an object file for only the currently selected compiler or to create object files for all five compatible external compilers.

Note: Do not set the default calling convention to __stdcall if you want to create a static object for all five compatible external compilers.

Note: LabWindows/CVI automatically creates object files each time it compiles a source file in the project. These object files have either a.niobj or .nidobj file extension,
depending on whether they are compiled with debugging. LabWindows/CVI uses these
files to speed up the building of executables, DLLs, and static libraries. They cannot be added to a LabWindows/CVI project, used in an external compiler, or loaded using the LoadExeternalModule function in the Utility Library.

To view the LabWindows/CVI Programmer's Reference Manual online go to http://www.ni.com/pdf/manuals/320685e.pdf

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 3 of 3
(3,176 Views)