|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * Debugger
5: *
6: * (c) 1995 Bernd Schmidt
7: *
8: */
9:
1.1.1.2 ! root 10: #ifndef UAE_DEBUG_H
! 11: #define UAE_DEBUG_H
! 12:
! 13: #include "uae/types.h"
! 14:
1.1 root 15: #ifdef DEBUGGER
16:
17: #define MAX_HIST 500
18: #define MAX_LINEWIDTH 100
19:
20: extern int debugging;
21: extern int memwatch_enabled;
22: extern int exception_debugging;
23: extern int debug_copper;
1.1.1.2 ! root 24: extern int debug_dma, debug_heatmap;
1.1 root 25: extern int debug_sprite_mask;
26: extern int debug_bpl_mask, debug_bpl_mask_one;
27: extern int debugger_active;
28: extern int debug_illegal;
29: extern uae_u64 debug_illegal_mask;
30:
31: extern void debug (void);
32: extern void debugger_change (int mode);
33: extern void activate_debugger (void);
34: extern void deactivate_debugger (void);
35: extern int notinrom (void);
36: extern const TCHAR *debuginfo (int);
37: extern void record_copper (uaecptr addr, uae_u16 word1, uae_u16 word2, int hpos, int vpos);
38: extern void record_copper_blitwait (uaecptr addr, int hpos, int vpos);
39: extern void record_copper_reset (void);
40: extern int mmu_init (int, uaecptr,uaecptr);
41: extern void mmu_do_hit (void);
42: extern void dump_aga_custom (void);
43: extern void memory_map_dump (void);
44: extern void debug_help (void);
45: extern uaecptr dumpmem2 (uaecptr addr, TCHAR *out, int osize);
46: extern void update_debug_info (void);
47: extern int instruction_breakpoint (TCHAR **c);
48: extern int debug_bankchange (int);
49: extern void log_dma_record (void);
50: extern void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize);
51: extern void mmu_disasm (uaecptr pc, int lines);
52: extern int debug_read_memory_16 (uaecptr addr);
53: extern int debug_peek_memory_16 (uaecptr addr);
54: extern int debug_read_memory_8 (uaecptr addr);
55: extern int debug_peek_memory_8 (uaecptr addr);
56: extern int debug_write_memory_16 (uaecptr addr, uae_u16 v);
57: extern int debug_write_memory_8 (uaecptr addr, uae_u8 v);
58: extern bool debug_enforcer(void);
59:
60: #define BREAKPOINT_TOTAL 20
1.1.1.2 ! root 61: #define BREAKPOINT_REG_Dx 0
! 62: #define BREAKPOINT_REG_Ax 8
! 63: #define BREAKPOINT_REG_PC 16
! 64: #define BREAKPOINT_REG_USP 17
! 65: #define BREAKPOINT_REG_MSP 18
! 66: #define BREAKPOINT_REG_ISP 19
! 67: #define BREAKPOINT_REG_VBR 20
! 68: #define BREAKPOINT_REG_SR 21
! 69: #define BREAKPOINT_REG_CCR 22
! 70: #define BREAKPOINT_REG_CACR 23
! 71: #define BREAKPOINT_REG_CAAR 24
! 72: #define BREAKPOINT_REG_SFC 25
! 73: #define BREAKPOINT_REG_DFC 26
! 74: #define BREAKPOINT_REG_TC 27
! 75: #define BREAKPOINT_REG_ITT0 28
! 76: #define BREAKPOINT_REG_ITT1 29
! 77: #define BREAKPOINT_REG_DTT0 30
! 78: #define BREAKPOINT_REG_DTT1 31
! 79: #define BREAKPOINT_REG_BUSC 32
! 80: #define BREAKPOINT_REG_PCR 33
! 81: #define BREAKPOINT_REG_END 34
! 82:
! 83: #define BREAKPOINT_CMP_EQUAL 0
! 84: #define BREAKPOINT_CMP_NEQUAL 1
! 85: #define BREAKPOINT_CMP_SMALLER_EQUAL 2
! 86: #define BREAKPOINT_CMP_LARGER_EQUAL 3
! 87: #define BREAKPOINT_CMP_SMALLER 2
! 88: #define BREAKPOINT_CMP_LARGER 3
! 89: #define BREAKPOINT_CMP_RANGE 4
! 90: #define BREAKPOINT_CMP_NRANGE 5
! 91:
1.1 root 92: struct breakpoint_node {
1.1.1.2 ! root 93: uae_u32 value1;
! 94: uae_u32 value2;
! 95: uae_u32 mask;
! 96: int type;
! 97: int oper;
1.1 root 98: int enabled;
99: };
100: extern struct breakpoint_node bpnodes[BREAKPOINT_TOTAL];
101:
1.1.1.2 ! root 102: #define MW_MASK_CPU_I 0x00000001
! 103: #define MW_MASK_CPU_D_R 0x00000002
! 104: #define MW_MASK_CPU_D_W 0x00000004
! 105: #define MW_MASK_BLITTER_A 0x00000008
! 106: #define MW_MASK_BLITTER_B 0x00000010
! 107: #define MW_MASK_BLITTER_C 0x00000020
! 108: #define MW_MASK_BLITTER_D_N 0x00000040
! 109: #define MW_MASK_BLITTER_D_L 0x00000080
! 110: #define MW_MASK_BLITTER_D_F 0x00000100
! 111: #define MW_MASK_COPPER 0x00000200
! 112: #define MW_MASK_DISK 0x00000400
! 113: #define MW_MASK_AUDIO_0 0x00000800
! 114: #define MW_MASK_AUDIO_1 0x00001000
! 115: #define MW_MASK_AUDIO_2 0x00002000
! 116: #define MW_MASK_AUDIO_3 0x00004000
! 117: #define MW_MASK_BPL_0 0x00008000
! 118: #define MW_MASK_BPL_1 0x00010000
! 119: #define MW_MASK_BPL_2 0x00020000
! 120: #define MW_MASK_BPL_3 0x00040000
! 121: #define MW_MASK_BPL_4 0x00080000
! 122: #define MW_MASK_BPL_5 0x00100000
! 123: #define MW_MASK_BPL_6 0x00200000
! 124: #define MW_MASK_BPL_7 0x00400000
! 125: #define MW_MASK_SPR_0 0x00800000
! 126: #define MW_MASK_SPR_1 0x01000000
! 127: #define MW_MASK_SPR_2 0x02000000
! 128: #define MW_MASK_SPR_3 0x04000000
! 129: #define MW_MASK_SPR_4 0x08000000
! 130: #define MW_MASK_SPR_5 0x10000000
! 131: #define MW_MASK_SPR_6 0x20000000
! 132: #define MW_MASK_SPR_7 0x40000000
! 133: #define MW_MASK_NONE 0x80000000
! 134: #define MW_MASK_ALL (MW_MASK_NONE - 1)
1.1 root 135:
136: #define MEMWATCH_TOTAL 20
137: struct memwatch_node {
138: uaecptr addr;
139: int size;
140: int rwi;
141: uae_u32 val, val_mask, access_mask;
142: int val_size, val_enabled;
143: int mustchange;
144: uae_u32 modval;
145: int modval_written;
146: int frozen;
147: uae_u32 reg;
148: uaecptr pc;
149: };
150: extern struct memwatch_node mwnodes[MEMWATCH_TOTAL];
151:
152: extern void memwatch_dump2 (TCHAR *buf, int bufsize, int num);
153:
154: uae_u16 debug_wgetpeekdma_chipram (uaecptr addr, uae_u32 v, uae_u32 mask, int reg);
155: uae_u16 debug_wputpeekdma_chipram (uaecptr addr, uae_u32 v, uae_u32 mask, int reg);
156: uae_u16 debug_wputpeekdma_chipset (uaecptr addr, uae_u32 v, uae_u32 mask, int reg);
157: void debug_lgetpeek (uaecptr addr, uae_u32 v);
158: void debug_wgetpeek (uaecptr addr, uae_u32 v);
159: void debug_bgetpeek (uaecptr addr, uae_u32 v);
160: void debug_bputpeek (uaecptr addr, uae_u32 v);
161: void debug_wputpeek (uaecptr addr, uae_u32 v);
162: void debug_lputpeek (uaecptr addr, uae_u32 v);
163:
164: uae_u32 get_byte_debug (uaecptr addr);
165: uae_u32 get_word_debug (uaecptr addr);
166: uae_u32 get_long_debug (uaecptr addr);
167: uae_u32 get_ilong_debug (uaecptr addr);
168: uae_u32 get_iword_debug (uaecptr addr);
169:
170:
171: enum debugtest_item { DEBUGTEST_BLITTER, DEBUGTEST_KEYBOARD, DEBUGTEST_FLOPPY, DEBUGTEST_MAX };
172: void debugtest (enum debugtest_item, const TCHAR *, ...);
173:
174: struct dma_rec
175: {
176: uae_u16 reg;
177: uae_u32 dat;
178: uae_u32 addr;
179: uae_u16 evt;
180: int type;
181: uae_s8 intlev;
182: };
183:
184: #define DMA_EVENT_BLITIRQ 1
185: #define DMA_EVENT_BLITNASTY 2
186: #define DMA_EVENT_BLITSTARTFINISH 4
187: #define DMA_EVENT_BPLFETCHUPDATE 8
188: #define DMA_EVENT_COPPERWAKE 16
189: #define DMA_EVENT_CPUIRQ 32
190: #define DMA_EVENT_INTREQ 64
191: #define DMA_EVENT_COPPERWANTED 128
1.1.1.2 ! root 192: #define DMA_EVENT_SPECIAL 256
1.1 root 193:
194: #define DMARECORD_REFRESH 1
1.1.1.2 ! root 195: #define DMARECORD_CPU_I 2
! 196: #define DMARECORD_CPU_D 3
! 197: #define DMARECORD_COPPER 4
! 198: #define DMARECORD_AUDIO 5
! 199: #define DMARECORD_BLITTER 6
! 200: #define DMARECORD_BLITTER_FILL 7
! 201: #define DMARECORD_BLITTER_LINE 8
! 202: #define DMARECORD_BITPLANE 9
! 203: #define DMARECORD_SPRITE 10
! 204: #define DMARECORD_DISK 11
! 205: #define DMARECORD_MAX 12
! 206:
! 207: extern struct dma_rec *record_dma(uae_u16 reg, uae_u16 dat, uae_u32 addr, int hpos, int vpos, int type);
! 208: extern void record_dma_reset(void);
! 209: extern void record_dma_event(int evt, int hpos, int vpos);
! 210: extern void debug_draw(uae_u8 *buf, int bpp, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors);
1.1 root 211:
212: #else
213:
214: STATIC_INLINE void activate_debugger (void) { };
215: #ifdef WINUAE_FOR_HATARI
1.1.1.2 ! root 216: #define MAX_LINEWIDTH 100
! 217:
1.1 root 218: uae_u32 get_byte_debug (uaecptr addr);
219: uae_u32 get_word_debug (uaecptr addr);
220: uae_u32 get_long_debug (uaecptr addr);
221: uae_u32 get_ilong_debug (uaecptr addr);
222: uae_u32 get_iword_debug (uaecptr addr);
223: extern void mmu_do_hit (void);
224: #endif
225:
1.1.1.2 ! root 226: #endif /* DEBUGGER */
! 227:
! 228: #endif /* UAE_DEBUG_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.