--- freem/src/xecline.c 2025/04/29 18:46:17 1.18 +++ freem/src/xecline.c 2025/04/30 14:41:03 1.19 @@ -1,5 +1,5 @@ /* - * $Id: xecline.c,v 1.18 2025/04/29 18:46:17 snw Exp $ + * $Id: xecline.c,v 1.19 2025/04/30 14:41:03 snw Exp $ * freem interpreter proper * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: xecline.c,v $ + * Revision 1.19 2025/04/30 14:41:03 snw + * Further debugger work + * * Revision 1.18 2025/04/29 18:46:17 snw * Begin work on interactive debugger * @@ -244,7 +247,7 @@ int xecline(int typ) next_line: /* entry point for next command line */ if (debug_mode) { - debug_mode = debugger (); + debug_mode = debugger (DEBENTRY_LINE, codptr); } job_set_status (pid, JSTAT_INTERPRETER); @@ -294,6 +297,10 @@ next_line: /* entry point for n codptr = code; next_cmnd: /* continue line entry point */ + if (debug_mode) { + debug_mode = debugger (DEBENTRY_CMD, codptr); + } + if (sigint_in_for) goto for_quit; if (forsw && (forpost[forx][0] != '\0')) { @@ -2616,7 +2623,6 @@ quit0: printf ("CHECK 03 (Stack PUSH)\r\n"); #endif - if (++nstx > NESTLEVLS) { nstx--; merr_raise (STKOV); @@ -2642,7 +2648,7 @@ quit0: nestn[nstx] = 0; /* no overring of routine */ nestr[nstx] = roucur - rouptr; /* save roucur: only for $V(26) needed */ ztrap[nstx][0] = EOL; - + forsw = TRUE; ftyp = 0; /* no args is FOREVER */ @@ -6744,8 +6750,7 @@ syn_evt_loop_bottom: if (ch != ',' && merr () == OK) { merr_raise (SPACER); } - else if ((ierr <= OK) || (debug_mode == TRUE)) { - if (debug_mode) goto direct_mode; + else if (ierr <= OK) { if (*++codptr != SP && *codptr != EOL) goto again; merr_raise (ARGLIST); @@ -6787,6 +6792,7 @@ err: } } + if (merr () > OK ) { char er_buf[ERRLEN]; @@ -6796,6 +6802,15 @@ err: stcpy (er_buf, errmes[merr ()]); stcnv_m2c (er_buf); + + /* + if (usermode == 1 && ztrap[nstx][0] == EOL && etrap[0] == '\0') { + debug_mode = TRUE; + debugger (DEBENTRY_ERROR, codptr); + } + */ + + #if !defined(MSDOS) logprintf (FM_LOG_DEBUG, "xecline: interpreter error %d [%s]", ierr, er_buf); #endif @@ -7168,6 +7183,7 @@ restart: free (t_nsn); + } @@ -7229,9 +7245,6 @@ restore: goto next_cmnd; } - else { - if (debug_mode) goto direct_mode; - } if (libcall == TRUE) { /* library mode: don't go to direct mode, just return */ return merr ();