;========================================================================== ; ; File: Debug.a ; ; Contains: Some useful macros for debugging ; ; Written by: Paul Wolf ; ; Copyright: © 1990-1993 by Apple Computer, Inc., all rights reserved. ; ; Change History (most recent first): ; ; 11/22/93 pdw Added useINITDebugger default to on. ; 11/22/93 pdw Rolling in from . ; 11/10/93 pdw Added ERR_RECORD_ON. ; 11/8/93 pdw Better definitions for ROM build. ; 11/7/93 pdw Turned off all recording except call recording (SCSIDispatch and ; SCSIAtomic and callbacks). ; 10/28/93 pdw New defines. ; 10/29/93 DCB roll-in. ; 10/28/93 pdw New defines. ; 10/14/93 pdw Debug.a ; 10/12/93 pdw Added support for Synchronous data transfers, rewrote State ; Machine, message handling etc. ; 9/9/93 pdw Lots of little changes. Name changes, temporary cache_bug ; stuff. ; 8/13/93 pdw Added RecordRCMD macro. ; 7/17/93 pdw Don't remember. ; 7/8/93 pdw Adding StopRecordOnFull. ; 6/29/93 pdw Minor stuff. ; 5/26/93 PW Adding symbol forAMD. ; 5/25/93 DCB Rollin from Ludwig. (The next item below) ; 5/21/93 PW Moved definition of Include_Debugger_Names up to before its ; first use. Added DebugStr in addition to IfDebugStr. ; 5/5/93 PW Converted names to meanies-friendly names. Updated with latest ; from Ludwig stuff. ; 5/1/93 PW Put in RECORD_rCMD and forC96Init definitions (should only be in ; Debug.a now). ; 4/30/93 DCB Changing default RECORD_ON to 0 for final Candidate ; 3/26/93 PW Added RECORD_ON definition here since this seems like an ; appropriate place for it. ; 10/8/92 PW Added GROSS_CHECK default rule. Added IF...ENDIF around ; DebugStr. ; 10/5/92 PW Made DebugStr macro use pascal strings. ; 7/27/92 PW Initial check-in. ; ;========================================================================== ; pdw ;————————————————————————————— ; DefaultTo ;————————————————————————————— MACRO DefaultTo &SymbolToDefine, &value ;————————————————————————————— IF (&TYPE(&SymbolToDefine) = 'UNDEFINED') THEN &SymbolToDefine: EQU &value ENDIF ENDM ; DefaultTo STACK_RECORD_ON, 0 ; The idea here is to put the values that you want the final ROM built with here and ; to specify (on your build line or in the .IttInit makefile) any values other than ; these defaults. IF (&TYPE('DEBUGGING') = 'UNDEFINED') THEN DEBUGGING: EQU 0 ENDIF IF (&TYPE('RECORD_NONCACHABLE') = 'UNDEFINED') THEN RECORD_NONCACHABLE: EQU 0 ENDIF IF (&TYPE('TAPE_LENGTH') = 'UNDEFINED') THEN TAPE_LENGTH: EQU 1024 ENDIF IF (&TYPE('RECORD_ON') = 'UNDEFINED') THEN RECORD_ON: EQU 0 ENDIF IF (&TYPE('STACK_RECORD_ON') = 'UNDEFINED') THEN STACK_RECORD_ON: EQU 0 ENDIF IF (&TYPE('CALL_RECORD_ON') = 'UNDEFINED') THEN CALL_RECORD_ON: EQU 1 ENDIF IF (&TYPE('ERR_RECORD_ON') = 'UNDEFINED') THEN ERR_RECORD_ON: EQU 1 ENDIF IF (&TYPE('RECORD_rCMD') = 'UNDEFINED') THEN RECORD_rCMD: EQU 0 ENDIF IF (&TYPE('StopRecordOnFull') = 'UNDEFINED') THEN StopRecordOnFull: EQU 0 ENDIF IF (&TYPE('forAMD') = 'UNDEFINED') THEN forAMD: EQU 0 ENDIF IF (&TYPE('noSCSIInts') = 'UNDEFINED') THEN noSCSIInts: EQU 0 ENDIF IF (&TYPE('PARITY_ENABLED') = 'UNDEFINED') THEN PARITY_ENABLED: EQU 0 ENDIF IF (&TYPE('GROSS_CHECK') = 'UNDEFINED') THEN GROSS_CHECK: EQU 0 ENDIF IF (&TYPE('forC96Init') = 'UNDEFINED') THEN forC96Init: EQU 0 ENDIF IF (&TYPE('useINITDebugger') = 'UNDEFINED') THEN useINITDebugger: EQU 1 ENDIF IF (&TYPE('GPHYSICAL') = 'UNDEFINED') THEN GPHYSICAL: EQU 1 ENDIF IF (&TYPE('INDEXED_IS_FASTER') = 'UNDEFINED') THEN INDEXED_IS_FASTER: EQU 1 ENDIF IF (&TYPE('PAGE_SIZE') = 'UNDEFINED') THEN PAGE_SIZE: EQU 8192 ENDIF IF (&TYPE('Include_Debugger_Names') = 'UNDEFINED') THEN Include_Debugger_Names: EQU 1 ENDIF ; pdw ; ———————— Macros: ——————————————————————————————————————————————— ;————————————————————————————— ; DebugStr ;————————————————————————————— MACRO DebugStr &PString ;————————————————————————————— STRING PASCAL ; pea #&PString _debugstr STRING ASIS ; ENDM ;————————————————————————————— ; IfDebugStr ;————————————————————————————— MACRO IfDebugStr &PString ;————————————————————————————— STRING PASCAL ; IF DEBUGGING THEN ; pea #&PString _debugstr ELSE nop ENDIF STRING ASIS ; ENDM ;————————————————————————————— ; NAME ;————————————————————————————— MACRO NAME &PString ;————————————————————————————— STRING PASCAL IF Include_Debugger_Names THEN dc.b $80, &PString dc.w $0000 STRING ASIS ENDIF ENDM ;————————————————————————————— ; RTSNAME ;————————————————————————————— MACRO RTSNAME &PString ;————————————————————————————— STRING PASCAL IF Include_Debugger_Names THEN rts dc.b $80, &PString dc.w $0000 STRING ASIS ENDIF ENDM ;————————————————————————————— ; BraNAME ;————————————————————————————— MACRO BraNAME &PString ;————————————————————————————— STRING PASCAL IF Include_Debugger_Names THEN bra.s @bra99 rts dc.b $80, &PString dc.w $0000 @bra99 STRING ASIS ENDIF ENDM ;————————————————————————————— ; RecCmd ;————————————————————————————— MACRO RecCmd &CmdCode,&FileLetter,&EventNumber ; in quotes ;————————————————————————————— IF RECORD_ON and RECORD_rCMD THEN pea 'rCMD' ; move.w #(&FileLetter<<8)+&EventNumber, -(sp) move.w #&CmdCode, -(sp) bsr RecordEvent addq.l #8, sp ENDIF ENDM