National Instruments 320685D-01 Drums User Manual


 
Chapter 1 LabWindows/CVI Compiler
LabWindows/CVI Programmer Reference Manual 1-8
©
National Instruments Corporation
Debugging Levels
You can compile the source modules in your application to include debugging information. If
you do so, you can use breakpoints and view or modify variables and expressions while your
program is suspended. You set the debugging level by selecting Options»Run Options in the
Project window. Refer to the Run Options section in Chapter 3, Project Window, of the
LabWindows/CVI User Manual for information on debugging levels.
User Protection
User protection detects invalid program behavior that LabWindows/CVI cannot otherwise
detect during compilation. LabWindows/CVI reports such invalid program behavior as user
protection errors. When you set the debugging level to Standard or Extended,
LabWindows/CVI maintains extra information for arrays, structures, and pointers, and uses
the information at run time to determine the validity of addresses.
Two groups of user protection errors exist based upon two characteristics: severity level and
error category. In each case, the ANSI C standard states that programs with these errors have
undefined behavior. The two severity levels are as follows:
Non-Fatal errors include expressions that are likely to cause problems, but do not
directly affect program execution. Examples include bad pointer arithmetic, attempts to
free pointers more than once, and comparisons of pointers to different array objects. The
expression is invalid and its behavior is undefined, but execution can continue.
Fatal errors include expressions that LabWindows/CVI cannot execute without causing
major problems, such as causing a general protection fault. For example, dereferencing
an invalid pointer value is a fatal error.
Error categories include pointer protection, dynamic memory protection, library protection,
and general protection errors. Each of these categories includes subgroups as described in the
following sections.
Array Indexing and Pointer Protection Errors
The pointer protection errors catch invalid operations with pointers and arrays. In this section,
these errors are grouped by the type of expression that causes the error or the type of invalid
pointer involved.
Pointer Arithmetic (Non-Fatal)
Pointer arithmetic expressions involve a pointer sub-expression and an integer
sub-expression. LabWindows/CVI generates an error when the pointer sub-expression is
00ProRef.book : 06chap01.fm Page 8 Monday, March 9, 1998 3:23 PM