4 * Ullrich von Bassewitz, 08.08.1998
20 /*****************************************************************************/
21 /* Function forwards */
22 /*****************************************************************************/
26 /* Forwards for handler functions */
27 static char AsmHandler (void);
28 static char RegHandler (void);
29 static char StackHandler (void);
30 static char CStackHandler (void);
31 static char DumpHandler (void);
32 static char HelpHandler (void);
34 /* Forwards for other functions */
35 static void DisplayPrompt (char* s);
36 static void SingleStep (char StepInto);
37 static void RedrawStatic (char Frame);
38 static void Redraw (char Frame);
39 static char GetKeyUpdate (void);
43 /*****************************************************************************/
45 /*****************************************************************************/
49 /* Color definitions */
50 #if defined(__PLUS4__) || defined(__C16__)
51 # define COLOR_BORDER (BCOLOR_DARKBLUE | CATTR_LUMA6)
52 # define COLOR_BACKGROUND COLOR_WHITE
53 # define COLOR_TEXTHIGH COLOR_BLACK
54 # define COLOR_TEXTLOW COLOR_GRAY1
55 # define COLOR_FRAMEHIGH COLOR_BLACK
56 # define COLOR_FRAMELOW COLOR_GRAY2
58 # if defined(COLOR_GRAY3)
59 # define COLOR_BORDER COLOR_BLACK
60 # define COLOR_BACKGROUND COLOR_BLACK
61 # define COLOR_TEXTHIGH COLOR_WHITE
62 # define COLOR_TEXTLOW COLOR_GRAY3
63 # define COLOR_FRAMEHIGH COLOR_WHITE
64 # define COLOR_FRAMELOW COLOR_GRAY3
66 # if defined(__APPLE2__)
67 # define COLOR_BORDER COLOR_BLACK
68 # define COLOR_BACKGROUND COLOR_BLACK
69 # define COLOR_TEXTHIGH COLOR_BLACK
70 # define COLOR_TEXTLOW COLOR_BLACK
71 # define COLOR_FRAMEHIGH COLOR_BLACK
72 # define COLOR_FRAMELOW COLOR_BLACK
74 # define COLOR_BORDER COLOR_BLACK
75 # define COLOR_BACKGROUND COLOR_BLACK
76 # define COLOR_TEXTHIGH COLOR_WHITE
77 # define COLOR_TEXTLOW COLOR_WHITE
78 # define COLOR_FRAMEHIGH COLOR_WHITE
79 # define COLOR_FRAMELOW COLOR_WHITE
84 # define COLOR_BLACK 0
87 # define COLOR_WHITE 1
90 /* Screen definitions */
91 #if defined(__CBM610__)
95 # define DUMP_BYTES 16
96 #elif defined(__APPLE2__) || defined(__ATARI__)
103 # define DUMP_BYTES 8
106 /* Replacement key definitions */
108 # define CH_DEL ('H' - 'A' + 1) /* Ctrl+H */
111 /* Replacement char definitions */
113 # define CH_ULCORNER '+'
116 # define CH_URCORNER '+'
119 # define CH_LLCORNER '+'
122 # define CH_LRCORNER '+'
137 # define CH_CROSS '+'
140 /* Defines for opcodes */
149 #define OPC_JMPIND 0x6C
158 /* Register values that are used also in the assembler stuff */
159 extern unsigned char DbgSP; /* Stack pointer */
160 extern unsigned DbgCS; /* C stack pointer */
161 extern unsigned DbgHI; /* High 16 bit of primary reg */
165 /* Descriptor for one text line */
172 /* Window descriptor */
174 unsigned char fd_tl; /* Top left char */
175 unsigned char fd_tr; /* Top right char */
176 unsigned char fd_bl; /* Bottom left char */
177 unsigned char fd_br; /* Bottom right char */
178 unsigned char fd_x1, fd_y1; /* Upper left corner */
179 unsigned char fd_x2, fd_y2; /* Lower right corner */
180 unsigned char fd_width, fd_height; /* Redundant but faster */
181 unsigned char fd_visible; /* Is the window currently visible? */
182 char (*fd_func) (void); /* Handler function */
183 unsigned char fd_textcount; /* Number of text lines to print */
184 TextDesc* fd_text; /* Static text in the window */
189 /* Texts for the windows */
190 static TextDesc RegText [] = {
200 static TextDesc HelpText [] = {
201 { 1, 0, "F1, ? Help" },
202 { 1, 1, "F2, t Toggle breakpoint" },
203 { 1, 2, "F3, u Run until subroutine returns" },
204 { 1, 3, "F4, h Run to cursor" },
205 { 1, 4, "F7, space Step into" },
206 { 1, 5, "F8, enter Step over" },
207 { 1, 6, "1-5 Select active window" },
208 { 1, 7, "+ Page down" },
209 { 1, 8, "- Page up" },
210 { 1, 9, "Cursor Move up/down" },
211 { 1, 10, "a/z Move up/down" },
212 { 1, 11, "c Continue" },
213 { 1, 12, "f Follow instruction" },
214 { 1, 13, "o Goto origin" },
215 { 1, 14, "p Use as new PC value" },
217 { 1, 16, "r Redraw screen" },
218 { 1, 17, "s Skip next instruction" },
223 static FrameDesc AsmFrame = {
224 CH_ULCORNER, CH_TTEE, CH_LTEE, CH_CROSS,
225 0, 0, MAX_X - 10, 15,
231 static FrameDesc RegFrame = {
232 CH_TTEE, CH_URCORNER, CH_LTEE, CH_RTEE,
233 MAX_X - 10, 0, MAX_X - 1, 9,
237 sizeof (RegText) / sizeof (RegText [0]), RegText
239 static FrameDesc StackFrame = {
240 CH_LTEE, CH_RTEE, CH_CROSS, CH_RTEE,
241 MAX_X - 10, 9, MAX_X - 1, 15,
247 static FrameDesc CStackFrame = {
248 CH_CROSS, CH_RTEE, CH_BTEE, CH_LRCORNER,
249 MAX_X - 10, 15, MAX_X - 1, MAX_Y - 1,
255 static FrameDesc DumpFrame = {
256 CH_LTEE, CH_CROSS, CH_LLCORNER, CH_BTEE,
257 0, 15, MAX_X - 10, MAX_Y-1,
258 MAX_X - 11, MAX_Y - 17,
263 static FrameDesc HelpFrame = {
264 CH_ULCORNER, CH_URCORNER, CH_LLCORNER, CH_LRCORNER,
265 0, 0, MAX_X - 1, MAX_Y-1,
266 MAX_X - 2, MAX_Y - 2,
269 sizeof (HelpText) / sizeof (HelpText [0]), HelpText
271 static FrameDesc* Frames [] = {
280 /* Number of active frame, -1 = none */
281 static int ActiveFrame = -1;
291 /* Other window data */
292 static unsigned AsmAddr; /* Start address of output */
293 static unsigned DumpAddr; /* Start address of output */
294 static unsigned CStackAddr; /* Start address of output */
295 static unsigned char StackAddr; /* Start address of output */
299 /* Prompt line data */
300 static char* ActivePrompt = 0; /* Last prompt line displayed */
301 static char PromptColor; /* Color behind prompt */
302 static char PromptLength; /* Length of current prompt string */
306 /* Values for the bk_use field of struct BreakPoint */
307 #define BRK_EMPTY 0x00
308 #define BRK_USER 0x01
311 /* Structure describing a breakpoint */
313 unsigned bk_addr; /* Address, 0 if unused */
314 unsigned char bk_opc; /* Opcode */
315 unsigned char bk_use; /* 1 if in use, 0 otherwise */
320 /* Temporary breakpoints - also accessed from the assembler source */
321 #define MAX_USERBREAKS 10
322 unsigned char DbgBreakCount = 0;
323 BreakPoint DbgBreaks [MAX_USERBREAKS+2];
327 /*****************************************************************************/
328 /* Forwards for functions in the assembler source */
329 /*****************************************************************************/
333 BreakPoint* DbgGetBreakSlot (void);
334 /* Search for a free breakpoint slot. Return a pointer to the slot or 0 */
336 BreakPoint* DbgIsBreak (unsigned Addr);
337 /* Check if there is a user breakpoint at the given address, if so, return
338 * a pointer to the slot, else return 0.
343 /*****************************************************************************/
344 /* Frame/window drawing code */
345 /*****************************************************************************/
349 static void DrawFrame (register FrameDesc* F, char Active)
350 /* Draw one window frame */
354 unsigned char tl, tr, bl, br;
355 unsigned char x1, y1, width;
356 unsigned char OldColor;
358 /* Determine the characters for the corners, set frame color */
360 OldColor = textcolor (COLOR_FRAMEHIGH);
366 OldColor = textcolor (COLOR_FRAMELOW);
373 /* Get the coordinates into locals for faster access */
379 cputcxy (x1, y1, tl);
384 cvlinexy (x1, ++y1, F->fd_height);
392 cvlinexy (F->fd_x2, y1, F->fd_height);
394 /* If the window has static text associated, print the text */
395 (void) textcolor (COLOR_TEXTLOW);
396 Count = F->fd_textcount;
399 cputsxy (x1 + T->x, y1 + T->y, T->text);
403 /* Set the old color */
404 (void) textcolor (OldColor);
409 static void DrawFrames (void)
410 /* Draw all frames */
415 /* Build the frame layout of the screen */
416 for (I = 0; I < sizeof (Frames) / sizeof (Frames [0]); ++I) {
426 static void ActivateFrame (int Num, unsigned char Clear)
427 /* Activate a new frame, deactivate the old one */
430 register FrameDesc* F;
432 if (ActiveFrame != Num) {
434 /* Deactivate the old one */
435 if (ActiveFrame >= 0) {
436 DrawFrame (Frames [ActiveFrame], 0);
439 /* Activate the new one */
440 if ((ActiveFrame = Num) >= 0) {
441 F = Frames [ActiveFrame];
442 /* Clear the frame if requested */
444 for (y = F->fd_y1+1; y < F->fd_y2; ++y) {
445 cclearxy (F->fd_x1+1, y, F->fd_width);
451 /* Redraw the current prompt line */
452 DisplayPrompt (ActivePrompt);
459 /*****************************************************************************/
461 /*****************************************************************************/
465 static void DisplayPrompt (char* s)
466 /* Display a prompt */
468 unsigned char OldColor;
470 /* Remember the current color */
471 OldColor = textcolor (COLOR_TEXTHIGH);
473 /* Clear the old prompt if there is one */
475 (void) textcolor (PromptColor);
476 chlinexy ((MAX_X - PromptLength) / 2, MAX_Y-1, PromptLength);
479 /* Get the new prompt data */
481 PromptColor = OldColor;
482 PromptLength = strlen (ActivePrompt);
484 /* Display the new prompt */
485 (void) textcolor (COLOR_TEXTHIGH);
486 cputsxy ((MAX_X - PromptLength) / 2, MAX_Y-1, ActivePrompt);
488 /* Restore the old color */
489 (void) textcolor (PromptColor);
494 static void HelpPrompt (void)
495 /* Display a prompt line mentioning the help key */
497 DisplayPrompt ("Press F1 for help");
502 static void AnyKeyPrompt (void)
504 DisplayPrompt ("Press any key to continue");
509 static char IsAbortKey (char C)
510 /* Return true if C is an abort key */
522 #if !defined(CH_ESC) && !defined(CH_STOP)
523 /* Avoid compiler warning about unused parameter */
531 static char Input (char* Prompt, char* Buf, unsigned char Count)
532 /* Read input from the user, return 1 on success, 0 if aborted */
535 unsigned char OldColor;
536 unsigned char OldCursor;
542 /* Clear the current prompt line */
543 cclearxy (0, MAX_Y-1, MAX_X);
545 /* Display the new prompt */
546 OldColor = textcolor (COLOR_TEXTHIGH);
547 cputsxy (0, MAX_Y-1, Prompt);
548 (void) textcolor (COLOR_TEXTLOW);
550 /* Remember where we are, enable the cursor */
552 OldCursor = cursor (1);
554 /* Get input and handle it */
558 if (isalnum (c) && i < Count) {
560 cputcxy (x1 + i, MAX_Y-1, c);
562 } else if (i > 0 && c == CH_DEL) {
564 cputcxy (x1 + i, MAX_Y-1, ' ');
565 gotoxy (x1 + i, MAX_Y-1);
566 } else if (c == '\n') {
569 } else if (IsAbortKey (c)) {
575 /* Reset settings, display old prompt line */
577 (void) textcolor (OldColor);
581 ActivateFrame (Frame, 0);
588 static char InputHex (char* Prompt, unsigned* Val)
589 /* Prompt for a hexadecimal value. Return 0 on failure. */
596 /* Read input from the user (4 digits max), check input */
597 if (Input (Prompt, Buf, sizeof (Buf)-1) && isxdigit (Buf [0])) {
599 /* Check the characters and convert to hex */
602 while ((C = *P) && isxdigit (C)) {
607 C = toupper (C) - ('A' - 10);
613 /* Assign the value */
629 static void ErrorPrompt (char* Msg)
630 /* Display an error message and wait for a key */
632 /* Save the current prompt */
633 char* OldPrompt = ActivePrompt;
635 /* Display the new one */
638 /* Wait for a key and discard it */
641 /* Restore the old prompt */
642 DisplayPrompt (OldPrompt);
647 static char InputGoto (unsigned* Addr)
648 /* Prompt "Goto" and read an address. Print an error and return 0 on failure. */
651 Ok = InputHex ("Goto: ", Addr);
653 ErrorPrompt ("Invalid input - press a key");
660 static void BreakInRomError (void)
661 /* Print an error message if we cannot set a breakpoint */
663 ErrorPrompt ("Cannot set breakpoint - press a key");
668 /*****************************************************************************/
669 /* Breakpoint handling */
670 /*****************************************************************************/
674 static void DbgSetTmpBreak (unsigned Addr)
675 /* Set a breakpoint */
677 BreakPoint* B = DbgGetBreakSlot ();
684 static void DbgToggleUserBreak (unsigned Addr)
685 /* Set a breakpoint */
687 register BreakPoint* B = DbgIsBreak (Addr);
690 /* We have a breakpoint, remove it */
691 B->bk_use = BRK_EMPTY;
694 /* We don't have a breakpoint, set one */
695 if (DbgBreakCount >= MAX_USERBREAKS) {
696 ErrorPrompt ("Too many breakpoints - press a key");
698 /* Test if we can set a breakpoint at that address */
699 if (!DbgIsRAM (Addr)) {
702 /* Set the breakpoint */
703 B = DbgGetBreakSlot ();
705 B->bk_use = BRK_USER;
714 static void DbgResetTmpBreaks (void)
715 /* Reset all temporary breakpoints */
718 BreakPoint* B = DbgBreaks;
720 for (i = 0; i < MAX_USERBREAKS; ++i) {
721 if (B->bk_use == BRK_TMP) {
722 B->bk_use = BRK_EMPTY;
730 static unsigned char DbgTmpBreaksOk (void)
731 /* Check if the temporary breakpoints can be set, if so, return 1, if not,
732 * reset them all and return 0.
736 BreakPoint* B = DbgBreaks;
737 for (i = 0; i < MAX_USERBREAKS; ++i) {
738 if (B->bk_use == BRK_TMP && !DbgIsRAM (B->bk_addr)) {
740 DbgResetTmpBreaks ();
750 /*****************************************************************************/
751 /* Assembler window stuff */
752 /*****************************************************************************/
756 static unsigned AsmBack (unsigned mem, unsigned char lines)
757 /* Go back in the assembler window the given number of lines (calculate
758 * new start address).
768 cur = mem - (lines * 3) - offs;
770 cur += DbgDisAsmLen (cur);
772 in = (in + 1) & 0x1F;
774 if (cur == mem || offs == 12) {
776 return adr [(in - lines - 1) & 0x1F];
778 /* The requested address is inside an instruction, go back
779 * one more byte and try again.
791 static unsigned UpdateAsm (void)
792 /* Update the assembler window starting at the given address */
797 unsigned char width = AsmFrame.fd_width;
798 unsigned char x = AsmFrame.fd_x1 + 1;
799 unsigned m = AsmBack (AsmAddr, 2);
801 for (y = AsmFrame.fd_y1+1; y < AsmFrame.fd_y2; ++y) {
802 len = DbgDisAsm (m, buf, width);
807 if (DbgIsBreak (m)) {
824 static unsigned AsmArg16 (void)
825 /* Return a 16 bit argument */
827 return *(unsigned*)(AsmAddr+1);
832 static void AsmFollow (void)
833 /* Follow the current instruction */
835 switch (*(unsigned char*) AsmAddr) {
839 AsmAddr = AsmArg16 ();
843 AsmAddr = *(unsigned*)AsmArg16 ();
854 AsmAddr = AsmAddr + 2 + *(signed char*)(AsmAddr+1);
858 AsmAddr = (*(unsigned*) (DbgSP + 0x101) + 1);
862 AsmAddr = *(unsigned*) (DbgSP + 0x102);
870 static void AsmHome (void)
871 /* Set the cursor to home position */
878 static void InitAsm (void)
879 /* Initialize the asm window */
887 static char AsmHandler (void)
888 /* Get characters and handle them */
895 /* Update the window contents */
898 /* Read and handle input */
899 switch (c = GetKeyUpdate ()) {
906 AsmAddr = AsmBack (AsmAddr, AsmFrame.fd_height);
913 DbgToggleUserBreak (AsmAddr);
921 InputGoto (&AsmAddr);
936 AsmAddr = AsmBack (AsmAddr, 1);
943 AsmAddr += DbgDisAsmLen (AsmAddr);
955 /*****************************************************************************/
956 /* Register window stuff */
957 /*****************************************************************************/
961 static unsigned UpdateReg (void)
962 /* Update the register window */
964 unsigned char x1 = RegFrame.fd_x1 + 5;
965 unsigned char x2 = x1 + 2;
966 unsigned char y = RegFrame.fd_y1;
968 /* Print the register contents */
969 gotoxy (x1, ++y); cputhex16 (brk_pc);
970 gotoxy (x2, ++y); cputhex8 (brk_sr);
971 gotoxy (x2, ++y); cputhex8 (brk_a);
972 gotoxy (x2, ++y); cputhex8 (brk_x);
973 gotoxy (x2, ++y); cputhex8 (brk_y);
974 gotoxy (x2, ++y); cputhex8 (DbgSP);
975 gotoxy (x1, ++y); cputhex16 (DbgCS);
976 gotoxy (x1, ++y); cputhex16 (DbgHI);
984 static void InitReg (void)
985 /* Initialize the register window */
992 static char RegHandler (void)
993 /* Get characters and handle them */
995 return GetKeyUpdate ();
1000 /*****************************************************************************/
1001 /* Stack window stuff */
1002 /*****************************************************************************/
1006 static unsigned UpdateStack (void)
1007 /* Update the stack window */
1009 unsigned char mem = StackAddr;
1010 unsigned char x1 = StackFrame.fd_x1 + 1;
1011 unsigned char x2 = x1 + 6;
1014 for (y = StackFrame.fd_y2-1; y > StackFrame.fd_y1; --y) {
1018 cputhex8 (* (unsigned char*) (mem + 0x100));
1026 static void StackHome (void)
1027 /* Set the cursor to home position */
1029 StackAddr = DbgSP + 1;
1034 static void InitStack (void)
1035 /* Initialize the stack window */
1043 static char StackHandler (void)
1044 /* Get characters and handle them */
1047 unsigned char BytesPerPage = StackFrame.fd_height;
1051 /* Read and handle input */
1052 switch (c = GetKeyUpdate ()) {
1055 StackAddr += BytesPerPage;
1059 StackAddr -= BytesPerPage;
1085 /* Update the window contents */
1092 /*****************************************************************************/
1093 /* C Stack window stuff */
1094 /*****************************************************************************/
1098 static unsigned UpdateCStack (void)
1099 /* Update the C stack window */
1101 unsigned mem = CStackAddr;
1102 unsigned char x = CStackFrame.fd_x1 + 5;
1105 for (y = CStackFrame.fd_y2-1; y > CStackFrame.fd_y1; --y) {
1107 cputhex16 (* (unsigned*)mem);
1110 cputsxy (CStackFrame.fd_x1+1, CStackFrame.fd_y2-1, "->");
1116 static void CStackHome (void)
1117 /* Set the cursor to home position */
1124 static void InitCStack (void)
1125 /* Initialize the C stack window */
1133 static char CStackHandler (void)
1134 /* Get characters and handle them */
1137 unsigned char BytesPerPage = CStackFrame.fd_height * 2;
1141 /* Read and handle input */
1142 switch (c = GetKeyUpdate ()) {
1145 CStackAddr += BytesPerPage;
1149 CStackAddr -= BytesPerPage;
1175 /* Update the window contents */
1182 /*****************************************************************************/
1183 /* Dump window stuff */
1184 /*****************************************************************************/
1188 static unsigned UpdateDump (void)
1189 /* Update the dump window */
1193 unsigned mem = DumpAddr;
1194 unsigned char x = DumpFrame.fd_x1 + 1;
1195 unsigned char* p = (unsigned char*) mem;
1197 for (y = DumpFrame.fd_y1+1; y < DumpFrame.fd_y2; ++y) {
1198 cputsxy (x, y, DbgMemDump (mem, Buf, DUMP_BYTES));
1206 static void DumpHome (void)
1207 /* Set the cursor to home position */
1214 static char DumpHandler (void)
1215 /* Get characters and handle them */
1218 unsigned BytesPerPage = DumpFrame.fd_height * 8;
1222 /* Read and handle input */
1223 switch (c = GetKeyUpdate ()) {
1226 DumpAddr += BytesPerPage;
1230 DumpAddr -= BytesPerPage;
1234 InputGoto (&DumpAddr);
1260 /* Update the window contents */
1267 /*****************************************************************************/
1268 /* Help window stuff */
1269 /*****************************************************************************/
1273 static char HelpHandler (void)
1274 /* Get characters and handle them */
1276 /* Activate the frame */
1277 int OldActive = ActiveFrame;
1278 ActivateFrame (WIN_HELP, 1);
1280 /* Say that we're waiting for a key */
1283 /* Get a character and discard it */
1286 /* Redraw the old stuff */
1289 /* Done, return no char */
1295 /*****************************************************************************/
1297 /*****************************************************************************/
1301 static unsigned GetArg16 (void)
1302 /* Read an argument */
1304 return *(unsigned*)(brk_pc+1);
1309 static unsigned GetStack16 (unsigned char Offs)
1310 /* Fetch a 16 bit value from stack top */
1312 return *(unsigned*)(DbgSP+Offs+0x101);
1317 static void SetRTSBreak (void)
1318 /* Set a breakpoint at the return target */
1320 DbgSetTmpBreak (GetStack16 (0) + 1);
1325 static void SingleStep (char StepInto)
1329 switch (*(unsigned char*) brk_pc) {
1332 /* Set breakpoint at target */
1333 DbgSetTmpBreak (GetArg16 ());
1337 /* Indirect jump, ignore CPU error when crossing page */
1338 DbgSetTmpBreak (*(unsigned*)GetArg16 ());
1349 /* Be sure not to set the breakpoint twice if this is a jump to
1350 * the following instruction.
1352 Offs = ((signed char*)brk_pc)[1];
1354 DbgSetTmpBreak (brk_pc + Offs + 2);
1359 /* Set a breakpoint at the return target */
1364 /* Set a breakpoint at the return target */
1365 DbgSetTmpBreak (GetStack16 (1));
1370 /* Set breakpoint at target */
1371 DbgSetTmpBreak (GetArg16 ());
1377 /* Place a breakpoint behind the instruction */
1378 DbgSetTmpBreak (brk_pc + DbgDisAsmLen (brk_pc));
1383 /*****************************************************************************/
1384 /* High level window handling */
1385 /*****************************************************************************/
1389 static void RedrawStatic (char Frame)
1390 /* Redraw static display stuff */
1392 /* Reset the active frame */
1395 /* Clear the screen hide the cursor */
1396 (void) bordercolor (COLOR_BORDER);
1397 (void) bgcolor (COLOR_BACKGROUND);
1401 /* Build the frame layout of the screen */
1402 (void) textcolor (COLOR_FRAMELOW);
1405 /* Draw the prompt line */
1408 /* Activate the active frame */
1409 ActivateFrame (Frame, 0);
1414 static void Redraw (char Frame)
1415 /* Redraw the display in case it's garbled */
1417 /* Redraw the static stuff */
1418 RedrawStatic (Frame);
1420 /* Init the window contents */
1430 static char GetKeyUpdate (void)
1431 /* Wait for a key updating the windows in the background */
1433 static unsigned char Win;
1435 /* While there are no keys... */
1457 Win = (Win + 1) & 0x03;
1461 /* We have a key - return it */
1467 /*****************************************************************************/
1468 /* Externally visible functions */
1469 /*****************************************************************************/
1473 void DbgEntry (void)
1474 /* Start up the debugger */
1476 static unsigned char FirstTime = 1;
1480 /* If this is the first call, setup the display */
1484 /* Draw the window, default active frame is ASM frame */
1485 RedrawStatic (WIN_ASM);
1493 /* Only initialize variables here, don't do a display update. The actual
1494 * display update will be done while waiting for user input.
1497 UpdateReg (); /* Must update this (static later) */
1501 /* Wait for user input */
1504 c = Frames [ActiveFrame]->fd_func ();
1512 ActivateFrame (c - '1', 0);
1526 /* Go until return */
1535 /* Go to cursor, only possible if cursor not at current PC */
1536 if (AsmAddr != brk_pc) {
1537 DbgSetTmpBreak (AsmAddr);
1547 if (DbgTmpBreaksOk ()) {
1548 /* Could set breakpoints */
1558 if (DbgTmpBreaksOk ()) {
1559 /* Could set breakpoints */
1570 /* Skip instruction */
1571 brk_pc += DbgDisAsmLen (brk_pc);
1577 Redraw (ActiveFrame);