;       SCCSID = @(#)debinit.inc	6.1 90/11/17
;***	DEBINIT.INC
;
;	This file contains the debugger's initialization
;	structure.  This include file can be be used by the
;	routine that initializes the debugger (by calling
;	"Debug_Entry").
;
;	SCCSID = @(#)debinit.inc	13.5 89/05/15
;
;	Definition of the packet used in debug initialization.	A pointer
;	to this structure is passed to Debug_Entry.  This structure is also
;	used by the rest of the debugger to access the local copy of the
;	initialization data kept in debdata.asm. Note that the "RealVectorSet"
;	and "ProtVectorSet" are bit fields of the interrupt vectors or
;	idt entries grabbed by the debugger. Bit 0 set would mean to grab
;	int 0, Bit 1 grab int 1, etc.
;

DebugInit	struc
	CSseg		dw	0	; Real mode code segment
	DSseg		dw	0	; Real mode data segment
	CSsel		dw	0	; Prot mode code selector (initialized)
	DSsel		dw	0	; Prot mode data selector (initialized)
	GDTalias	dw	0	; Prot mode GDT r/w alias
	?GDTaddr	dq	0	; GDT Base & Limit
	?ProtIDTaddr	dq	0	; Prot mode IDT base & limit
	?RealIDTaddr	dq	0	; Real mode IDT base & limit
	InitFlag	dw	0	; Initialization flags
	BreakChar	db	0	; Init break character, 0 = always brk
			db	0	; Pad to word
	ProtTicInt	dw	0	; Prot mode tic timer interrupt number
	RealTicInt	dw	0	; Real mode tic timer interrupt number
	RealVectorSet	dw	0	; Real mode int vectors set by debugger
	ProtVectorSet	dw	0	; Prot mode int vectors set by debugger
	ProtVectorHard	dw	0	; Prot vecs to be intercepted at ring 0
	DebCallOutPtr	dw	0	; Debugger callout routines near ptr
	DebppteSpare	dd	0	; Linear address of spare PTE
	DebptelinSpare	dd	0	; Linear address the PTE addresses
DebugInit	ends

GDTaddr		equ	(FWORDPTR ?GDTaddr)
ProtIDTaddr	equ	(FWORDPTR ?ProtIDTaddr)
RealIDTaddr	equ	(FWORDPTR ?RealIDTaddr)

;  These are the "InitFlag" definitions

INIT_NOBRKFLAG	equ	0000000000000001b ; If set, don't break into debugger
INIT_REALFLAG	equ	0000000000000010b ; If set, initialize for real mode
INIT_PROTFLAG	equ	0000000000000100b ; If set, initialize for protected
INIT_CTRLCFLAG	equ	0000000000001000b ; If set, init ctrl-c to debugger
INIT_CPU386	equ	0000000000010000b ; If set, CPU is a 386
INIT_NOVECSET	equ	0000000000100000b ; If set, don't set the int vectors
INIT_ENV386	equ	0000000001000000b ; If set, environment is 386 (v1.3)
INIT_DISLWR	equ	0000000010000000b ; If set, disassembly in lower case
INIT_NOREGTERSE	equ	0000000100000000b ; If set, dump full register set

;  These are the "RealVectorSet/ProtVectorSet/ProtVectorHard" definitions

V0	equ	0001h		; Divide error exception
V1	equ	0002h		; Single step
V2	equ	0004h		; NMI
V3	equ	0008h		; Debugger break point interrupt
V4	equ	0010h		; INT0 detect overflow
V5	equ	0020h		; Bound range exceeded
V6	equ	0040h		; Invalid opcode exception
V7	equ	0080h		; Process extension not available
V8	equ	0100h		; Double fault
V9	equ	0200h		; Process extension segment overrun
VA	equ	0400h		; Invalid task state segment
VB	equ	0800h		; Segment not present fault
VC	equ	1000h		; Stack segment overrun or not present
VD	equ	2000h		; General protection fault
VE	equ	4000h		; Page fault

;*  Debugger System Achor Segment

DebSAS	struc
	DSAS_Name		db	5 dup (?)
	DSAS_Ver		db	?
	DSAS_HookRM		dd	?
	DSAS_HookPM		dd	?
	DSAS_DebData		dw	?
	DSAS_RegSA		dw	?
	DSAS_MemCache		dw	?
	DSAS_DefType		dw	?
	DSAS_pTXT		dw	?
	DSAS_Retf		dw	?
	DSAS_Debug_Entry	dw	?
	DSAS_Debug_Entry32	dw	?
	DSAS_Debug_Break	dw	?
	DSAS_Debug_Exit		dw	?
	DSAS_Debug_Sym		dw	?
	DSAS_Debug_Sym32	dw	?
	DSAS_Debug_Trap		dw	?
	DSAS_Debug_Trap32	dw	?
	DSAS_Debug_CtrlC	dw	?
	DSAS_Debug_CtrlC32	dw	?
	DSAS_EnterDebugRETF	dw	?
	DSAS_EnterDebugIRET	dw	?
	DSAS_ExitDebug		dw	?
	DSAS_DoCommand		dw	?
	DSAS_CheckCtrlC		dw	?
	DSAS_CmdBreak		dw	?
	DSAS_command		dw	?
	DSAS_ChkBPaddr		dw	?
	DSAS_ParseString	dw	?
	DSAS_ScanP		dw	?
	DSAS_SkipB		dw	?
	DSAS_GetChr		dw	?
	DSAS_GetChrI		dw	?
	DSAS_IsSeparator	dw	?
	DSAS_PeekChr		dw	?
	DSAS_EvalRange		dw	?
	DSAS_EvalAddr		dw	?
	DSAS_EvalExpr		dw	?
	DSAS_GetSymbolBuf	dw	?
	DSAS_GetSymbolVal	dw	?
	DSAS_OutAddrS		dw	?
	DSAS_inbuf		dw	?
	DSAS_rprbuf		dw	?
	DSAS_putchar		dw	?
	DSAS_waitchr		dw	?
	DSAS_inchr		dw	?
	DSAS_ungetc		dw	?
	DSAS_FillAddr		dw	?
	DSAS_PutByte		dw	?
	DSAS_PutBuff		dw	?
	DSAS_GetCache		dw	?
	DSAS_GetByte		dw	?
	DSAS_GetBuff		dw	?
	DSAS_AddrToPhy		dw	?
	DSAS_AddrToLin		dw	?
	DSAS_PrintMemErr	dw	?
	DSAS_CompareAddr	dw	?
	DSAS_GetAddrType	dw	?
	DSAS_GetCurrTask	dw	?
	DSAS_OpInterpret	dw	?
	DSAS_ErrBreak		dw	?
	DSAS_RCmdBreak		dw	?
	DSAS_perr		dw	?
	DSAS_perror		dw	?
	DSAS_pTXTstart		dw	?
	DSAS_CheckAddr		dw	?
DebSAS	ends

DSAS_VERSION	equ	3		; DSAS structure's version number
