/*
 *
 * debug  Version 0.0  28NOV83
 *
 * This is the master script for building the `debug' session file.
 *
 */

/*
 * TNIX/Unix/VMS Version
 * Keyshell Version Number 1
 */

/*
 * Include files used.
 */

#ifdef _TNIX
#include <defines>
#endif

#if (_micro == _68000uP)
#include <config68k>
#include <debug68k>
#else
#if (_micro == _8086uP || _micro == _8087uP)
#include <config86>
#include <debug86>
#else
#if (_micro == _9900uP)
#include <config99>
#include <debug99>
#else
#if (_micro == _Z8001uP || _micro == _Z8002uP)
#include <configz8k>
#include <debugz8k>
#else
#include <config>
#include <debug>
#endif
#endif
#endif
#endif

#ifdef _pprom
#include <pprom>
#endif

#ifdef _hlldebug
#if (_hlldebug > 1)
#include <hlldbug>
#endif
#endif

#ifdef _pdb
#include <pascaldebug>
#endif

#ifdef _cdb
#include <cdebug>
#endif

#ifdef _tta
#ifndef _TNIX
#include "tta"
#endif
#endif

#ifdef _ddl
#ifndef _TNIX
#include "ddl"
#endif
#endif

#ifndef _TNIX
dbug
#else
main
#endif

{
>
>\kconfigure\e - Configure the 8540 hardware.
>
>\kasm debug\e - Use the 8540 for debugging programs and hardware.
>
>\ktta debug\e - Trigger Trace Analyzer.
>
>\khll debug\e - High Level Langauge debugging.
>
>\kddl debug\e - Digital Design Lab.
>
>\kprom prog\e - Prom Programmer.
>
>\kdone\e - Leave the \kdebug\e tree and return to the ColorKey+ top level.
>

msg (^Debug - top level);

f1;configure; [config];
f2;asm debug; [debug];

f3;tta debug;
#ifdef _tta
#ifndef _TNIX
	[tta];
#else
	{
	msg (^Loading in the TTA script.),
	sly (history off), 
	sly (newexp keynotes _kdir/tta.n),
	sly (unsave _kdir/tta.s),
	break;
	};
#endif
#else
	{
>
>ColorKey+ is not currently setup with keys for the TTA.
>To add them, run \usetksh\n and build a new custom configuration if 
>TTA is available at your site. 
>
	msg (^Displaying message.), sly (history off), sly (shiftkey 4),
	sly (history on), msg, break;
	};
#endif

f4;hll debug;
#ifdef _hlldebug
#if (_hlldebug > 1)
	[hlldbug];
#else
#ifdef _pdb
	[pascaldebug];
#else
#ifdef _cdb
	[cdebug];
#endif
#endif
#endif
#else
	{
>
>ColorKey+ is not currently setup with keys for HLL Debugging.
>To add them, run \usetksh\n and build a new custom configuration if 
>HLL Debugging is available at your site. 
>
	msg (^Displaying message.), sly (history off), sly (shiftkey 4),
	sly (history on), msg, break;
	};
#endif

f5;ddl debug;
#ifdef _ddl
#ifndef _TNIX
	[ddl];
#else
	{
	msg (^Loading in the DDL script.),
	sly (history off), 
	sly (newexp keynotes _kdir/ddl.n),
	sly (unsave _kdir/ddl.s),
	break;
	};
#endif
#else
	{
>
>ColorKey+ is not currently setup with keys for the Digital Design Lab.
>To add them, run \usetksh\n and build a new custom configuration if 
>the Digital Design Lab is available at your site. 
>
	msg (^Displaying message.), sly (history off), sly (shiftkey 4),
	sly (history on), msg, break;
	};
#endif
f6;prom prog;
#ifdef _pprom
	[pprom];
#else
	{
>
>ColorKey+ is not currently setup with keys for the PROM Programmer.
>To add them, run \usetksh\n and build a new custom configuration if 
>the PROM Programmer is available at your site. 
>
	msg (^Displaying message.), sly (history off), sly (shiftkey 4),
	sly (history on), msg, break;
	};
#endif

f8;done; 
#ifndef _TNIX
	break;
#else
	{
	cmd, msg (^Returning to ColorKey+ top level.),
	sly (history off),
	sly (newexp keynotes _kdir/main.n),
	sly (unsave _kdir/main.s),
	break;
	};
#endif
}
