DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC759 "Piccoline"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC759 "Piccoline"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦252090938⟧ TextFile

    Length: 5612 (0x15ec)
    Types: TextFile
    Names: »GEMTRACE.DOC«

Derivation

└─⟦53ffa2da0⟧ Bits:30003931/GEM_Develop_disk_1_KOPI_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
    └─⟦this⟧ »GEMTRACE.DOC« 

TextFile

on CompuServe in the Digital Research SIG or 
EASYPLEX MAIL by leaving a message for 76244,211 or by telephone 
at (613) 592-4609.




                            GEMTRACE 1.0
                            ============

GEMTRACE is a debugging trace facility for use with GEM Applications
and Desk Accessories written in 'C'. GEMTRACE requires both Monochrome
and Color monitors at the same time. It maintains a trace display on
the Monochrome screen at the same time that GEM applications and Desk
accessories are shown on the Color screen.

Installation
===========
First include the following 'C' procedure somewhere inside the target
application or accessory that is to be traced.

   --------------------- start of TRACE procedure -------------------

/*-----------------------------*/
/*     trace			*/
/*-----------------------------*/
VOID
trace(title)
WORD	title;
æ
	t_title(title);		/* This call will initialise GEMTRACE */
				/* and pass the ident string from the */
				/* original TRACE call.               */

	t_disply("contrlÆ0Å",contrlÆ0Å);	/* There follows a    */
	t_disply("contrlÆ1Å",contrlÆ1Å);	/* series of calls to */
	t_disply("contrlÆ2Å",contrlÆ2Å);	/* T_DISPLY with the  */
	t_disply("contrlÆ3Å",contrlÆ3Å);	/* names of variables */
	t_disply("contrlÆ4Å",contrlÆ4Å);	/* that the user may  */
	t_disply("contrlÆ5Å",contrlÆ5Å);        /* wish to monitor.   */
	t_disply("contrlÆ6Å",contrlÆ6Å);
	t_disply("contrlÆ7Å",contrlÆ7Å);	
	t_disply("contrlÆ8Å",contrlÆ8Å);
	t_disply("contrlÆ9Å",contrlÆ9Å);
	t_disply("contrlÆ10Å",contrlÆ10Å);
	t_disply("gl_wchar",gl_wchar);
	t_disply("gl_hchar",gl_hchar);
	t_disply("gl_wbox",gl_wbox);
	t_disply("gl_hbox",gl_hbox);
	t_disply("gem_handle",gem_handle);
	t_disply("vdi_handle",vdi_handle);
	t_disply("gl_apid",gl_apid);
	t_disply("gl_rmsgÆ0Å",gl_rmsgÆ0Å);
	t_disply("gl_rmsgÆ1Å",gl_rmsgÆ1Å);
	t_disply("gl_rmsgÆ2Å",gl_rmsgÆ2Å);
	t_disply("gl_rmsgÆ3Å",gl_rmsgÆ3Å);
	t_disply("gl_rmsgÆ4Å",gl_rmsgÆ4Å);
	t_disply("gl_itemhello",gl_itemhello);
	t_disply("gl_xfull",gl_xfull);
	t_disply("gl_yfull",gl_yfull);
	t_disply("gl_wfull",gl_wfull);
	t_disply("gl_hfull",gl_hfull);
	t_disply("ev_which",ev_which);
	t_disply("hello_whndl",hello_whndl);
	t_disply("type_size",type_size);

	t_menu();		/* This last call is used to mark the */
				/* end of the above list of calls and */
				/* to present a menu on the display.  */
å

   --------------------- end of TRACE procedure ------------------

Next, insert several strategicaly placed and suitably named calls to
'trace' within the program. For example, the above was designed for
the HELLO.C program and the following is part of the procedure called
'hello' in the same program with a few trace calls inserted just to
show how it is done:-


   ------------------ start of HELLO.C fragment --------------------

/*-----------------------------*/
/*	hello			*/
/*-----------------------------*/
hello()
æ
	BOOLEAN	done;

	/**/					/* loop handling user	*/
	/**/					/*   input until done	*/
		trace("hello");			/*       GEMTRACE       */
	done = FALSE;				/*   since DESKACC	*/
	while( !done )				/*  then forever        */ 
	æ
		trace("in WHILE loop");		/*       GEMTRACE       */
		ev_which = evnt_mesag(ad_rmsg);	/*   wait for message	*/
		trace("after event_mesag");	/*       GEMTRACE       */

		wind_update(BEG_UPDATE);	/* begin window update	*/
		trace("after wind_update");	/*       GEMTRACE       */
		done = hndl_mesag();		/* handle event message	*/
		wind_update(END_UPDATE);	/* end window update	*/
		done = FALSE;	/* never exit loop for desk accessory	*/
	å
å

   -------------------- end of HELLO.C fragment --------------------

In the above example, there are probably too many calls to TRACE in
such a short and simple fragment of code. Another idea is to include
just one call to TRACE at the start of every procedure (like the
trace("hello"); in the example) and maybe add a few others near some
code that seems to be going astray.

The file GEMTRACE.OBJ has the three public entry points that are
required to support the display and menu. It should be included in the
LINK filename sequence when the application or accessory .EXE file is
created.

Now install the target application or accessory and execute. The menu
that appears offers five choises:-

  Next    Continue program execution and halt at the next TRACE call.

  Run     Run through the TRACE calls without halting. Recapture control 
          with shift key.

  Off     Turn off the trace display. Recapture control with shift key.

  All     Print all listed variables, then continue until next TRACE call.

  Delta   Print all changed variables, then continue until next TRACE call.

If you select the 'Run' option, the menu is removed and program
execution continues without pausing. To regain control of the GEMTRACE
Menu, hold down one of the case shift keys until the next TRACE call
is executed.  The Menu will then reappear.

Graeme Scott. Ottawa, Canada.

«eof»