Category : C Source Code
Archive   : CLMDEBUG.ZIP
Filename : DRIVER.C

 
Output of file : DRIVER.C contained in archive : CLMDEBUG.ZIP
/* Illustrate use of symbolic debugger */
/* From the article "Bugs Nevermore!" by Thomas D. Webb */
/* appearing in the February 1986 issue of Computer Language */

/* To invoke the debugger, use the inkey() function and prompt the */
/* user to hit the function key F10. The program then single steps */
/* through the preprocessor T?(---) statments, which display */
/* variable values on a separate video page. Enter an F10 to turn the */
/* debugger off. Reinvoke with an inkey() call and F10 again */


#include "stdio.h"
#include "debug.h"
/* -------------------------------------*/
func2()
{
int small_number;
long big_number;
TS("Enter func2", "------------------");
for (small_number = 0, big_number =0L; small_number < 5; small_number++)
{
big_number += small_number * 10;
TI("small_number: " , small_number);
TL("big_number:", big_number);
}
TS( "Exit func2", " ^^^^^^^^^^^^^^^^^^^^ ");

}
func1()
{
char a = 'A';
int j = 123;
int *j_ptr = &j;
long k = 456789;
float f = 12.987;
static char string[] = "hello world";
TS ("enter func1", "--------------");
TC ("Character test", a);
TI ("integer test", j);
TL ("long test", k);
TU ("unsigned test", j_ptr);
TF ("float test", f);
TD ("double test", 123456.789012);
TS ("string test", string);
TS ("exit func1", "^^^^^^^^^^^^^^^^^^^^");
}

main ()
{
printf("Debug driver version 02 start \n");
printf("Press F10 to start trace\n");
inkey();
func1();
func2();
printf("Debug driver end\n");
}


  3 Responses to “Category : C Source Code
Archive   : CLMDEBUG.ZIP
Filename : DRIVER.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/