diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/sdktools/masm/asmdebug.h | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/sdktools/masm/asmdebug.h')
-rw-r--r-- | private/sdktools/masm/asmdebug.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/private/sdktools/masm/asmdebug.h b/private/sdktools/masm/asmdebug.h new file mode 100644 index 000000000..a2630f364 --- /dev/null +++ b/private/sdktools/masm/asmdebug.h @@ -0,0 +1,82 @@ +/* asmdebug.h -- include file for microsoft 80x86 assembler +** +** microsoft (r) macro assembler +** copyright (c) microsoft corp 1986. all rights reserved +** +** randy nevin +*/ + +/*** Output debugging information + * Ross Garmoe + * Copyright Microsoft Corporation, 1983 + * September 27, 9 1983 + * + * This package was developed using concepts originally developed by + * Mark Zibokowski for the C version of the z editor. + * + * The following set of macros output debugging information to the + * debugging file 'd_df'. Output of debugging information is controlled + * by compile time conditionals and flags set by execution time switches. + * If the symbol DEBUG is defined at compile time, the macros are + * compiled to generate debugging information. If DEBUG is not defined, + * then the macros are not compiled. At execution time, the value of + * the variable 'd_debug' is compared with the value of the defined symbol + * DEBFLAG and if any bits match, debugging information is written. + * If debugging information is to be written, the information level + * specified in the macro is checked against the level specified at run + * time and information is written only if the compile level is less than + * the level specified at run time. + * + * The macros are used as follows: + * + * Define the global variables 'd_debug', 'd_dlevel', 'd_indent' and 'd_sindent' + * as integers and 'd_df' as a pointer to FILE. In the argument processing + * routine set the value of 'd_debug' and 'd_dlevel' and open the trace output + * file and point to it with the variable 'd_df'. 'd_debug' , 'd_dlevel' and + * 'd_indent' must be intialized to zero. + * + * In any file of the program which is to produce debugging output, + * include this file 'debug.h' and define the selection symbol DEBFLAG. + * + * #include debug.h + * #define DEBFLAG value + * + * Then for any function which is to produce debug output include the + * following sets of macro calls. + * + * At fuction entry: + * + * INDEBUG; + * DEBOUT (level, ( fprintf argument string )); + * + * At all function exits: + * + * DEBOUT (level, ( fprintf argument string )); + * OUTDEBUG; + * + * At other points of interest: + * + * DEBOUT (level, ( fprintf argument string )); + * + * Note: For the entry and exit points, the DEBOUT ((...)); string + * is optional. The INDEBUG and OUTDEBUG macros control the + * indentation of the debug output to show the nesting levels of + * function calls + * Note: The fprintf argument string is of the form: + * d_df, "format", arg1, arg2,..., argn + */ + +#ifdef DEBUG +# define INDEBUG if(d_debug&DEBFLAG)d_indent++ +# define DEBOUT(l,z) if(d_debug&DEBFLAG&&l<=d_dlevel)\ + {for(d_sindent=d_indent;d_sindent;d_sindent--)fprintf(d_df," ");\ + fprintf z ;}else +# define OUTDEBUG if(d_debug&DEBFLAG)d_indent-- + extern long d_debug, d_dlevel, d_indent; /* debugging flags */ + extern long d_sindent; /* indentation printing temporary */ + extern FILE *d_df; /* pointer to debug output file */ +#else +# define INDEBUG +# define DEBOUT(l,z) +# define OUTDEBUG +#endif |