$ ss$_CSI[0,8] = 155 $ ss$_ESC[0,8] = 27 $ ss$_c_off = ss$_CSI + "?25l" $ ss$_c_on = ss$_CSI + "?25h" $ ss$_EL = ss$_CSI + "K" $ ss$_d = "''ss$_ESC'(0q''ss$_ESC'(B" $ ss$_b = ss$_CSI+"1m" $ ss$_n = ss$_CSI+"0m" $ ss$_lst_area = "''ss$_CSI'2;18r''ss$_CSI'9;1H " $ ss$_wtc_area = "''ss$_CSI'24;24r''ss$_CSI'24;1H''ss$_CSI'0K" $ ss$_frame = "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq" $ ss$_say = "write sys$output" $ ss$_say "" $ ss$_say ss$_b, "DCL DEBUGGER - © 1990,1991 by Jan Holzer, 2005 by Ferry Bolhar", ss$_n $ ss$_err_unrent = "%SS-W-UNRENT, Unrecognized entry - ignored. Re-enter" $ ss$_err_notfnd = "%SS-I-NOTFND, Search string not found" $ ss$_err_brniif = "%SS-W-BRNIIF, Branching from within an IF structure" $ ss$_err_nogosb = "%SS-W-NOGOSB, No GOSUB/CALL call to return to" $ ss$_err_lnbeof = "%SS-W-LNBEOF, Line is beyond the end of file - ignored" $ ss$_err_nocmdl = "%SS-W-NOCMDL, No command on line - ignored" $ ss$_err_lbnfnd = "%SS-W-LBNFND, Label not found - ignored" $ ss$_err_notope = "%SS-F-NOTOPE, Cannot open " $ ss$_err_iniope = "%SS-F-INIOPE, Cannot open initialization file " $ ss$_fil_nam = f$parse(p1,".COM",,, "SYNTAX_ONLY")-";" $ if ss$_fil_nam .eqs. "" then goto FILE_NG $ ss$_rld = "F" $ ss$_p1 = p2 $ ss$_p2 = p3 $ ss$_p3 = p4 $ ss$_p4 = p5 $ ss$_p5 = p6 $ ss$_p6 = p7 $ ss$_p7 = p8 $ DO_RELOAD: $ ss$_dclstat = 1 $ ss$_inexit = 0 $ ss$_exitstat = 1 $ ss$_ini_nam = f$trnlnm("DCLDBG$INIT") $ ! $ if ss$_ini_nam .nes. "" $ then $ ss$_ini_fil = f$parse(ss$_ini_nam, "SYS$LOGIN:.COM") - ";" $ if ss$_ini_fil .eqs. "" $ then $ ss$_ini_fil = ss$_ini_nam $ goto INI_NG $ endif $ ss$_old_state = f$environment("KEY_STATE") $ set key/nolog/state=ss$_state $ open/read/error=INI_NG ss$_ini_file 'ss$_ini_fil' $ READ_LOOP1: $ read/end=END_LOOP1/error=INI_NG ss$_ini_file ss$_ini_ln 'ss$_ini_ln' $ goto READ_LOOP1 $ END_LOOP1: $ close ss$_ini_file $ endif $ ! $ open/read/error=FILE_NG ss$_com_file 'ss$_fil_nam' $ if $severity .ne. 1 then goto FILE_NG $ p1 = ss$_p1 $ p2 = ss$_p2 $ p3 = ss$_p3 $ p4 = ss$_p4 $ p5 = ss$_p5 $ p6 = ss$_p6 $ p7 = ss$_p7 $ on error then continue $ on control_y then goto EXIT $ ss$_say "Loading ",ss$_fil_nam," ..." $ ss$_ln_no = 0 $ READ_LOOP: $ read/end=RUN_IT/error=FILE_NG ss$_com_file ss$_cmd_ln $ ss$_ln_no = ss$_ln_no + 1 $ ss$_ln'ss$_ln_no' = ss$_cmd_ln $ ss$_cmd_ln = f$edit(ss$_cmd_ln, "LOWERCASE,UNCOMMENT,COMPRESS,TRIM") $ ss$_sub_lbl="F" $ if f$locate("subroutine", ss$_cmd_ln) .lt. f$length(ss$_cmd_ln) $ then $ ss$_sub_lbl="T" $ goto SUB_LABEL $ endif $ if f$locate(":", ss$_cmd_ln) .ne. f$length(ss$_cmd_ln) - 1 then goto READ_LOOP $ if f$locate("$", ss$_cmd_ln) .ne. 0 then goto READ_LOOP $ ss$_frst_blnk=f$loca(" ", ss$_cmd_ln) $ if ss$_frst_blnk .ne. f$length(ss$_cmd_ln) .and. ss$_frst_blnk .ne. 1 then goto READ_LOOP $ if f$element(2, " ", ss$_cmd_ln) .nes. " " then goto READ_LOOP $ SUB_LABEL: $ ss$_cmd_ln = f$edit(ss$_cmd_ln, "COLLAPSE") $ if ss$_sub_lbl $ then ss$_lbl=f$extract(1, f$locate(":", ss$_cmd_ln) - 1, ss$_cmd_ln) $ else ss$_lbl=f$extract(1, f$length(ss$_cmd_ln) - 2, ss$_cmd_ln) $ endif $ ss$_lbl_is_'ss$_lbl' = ss$_ln_no $ ss$_ln_'ss$_ln_no'_is_label = "T" $ goto READ_LOOP $ ! $ RUN_IT: $ close ss$_com_file $ ss$_mx_lns = ss$_ln_no $ gosub GET_NOR_SCR $ ss$_last_ln = ss$_ln_no $ ss$_ln_no = 0 $ ss$_$_cmd = "F" $ ss$_call_lvl = 0 $ ss$_gosub_lvl = 0 $ ss$_ret_call_ln'ss$_call_lvl' = 0 $ ss$_ret_gosub_ln'ss$_gosub_lvl' = 0 $ ss$_prv_ln = -17 $ ss$_brk_pt = "F" $ ss$_brk_line = 0 $ ss$_oldbrk_line = 0 $ ss$_if_lvl = 0 $ ss$_skp_lvl = 0 $ ss$_skp_to = "F" $ ss$_ctrl_y = "F" $ ss$_run = "F" $ ss$_cnt = 0 $ ss$_srch = "F" $ ss$_in_cll = "F" $ ss$_srch_endsub = "F" $ ss$_wtc = "F" $ if .not. ss$_rld then ss$_say ss$_CSI, "2J", ss$_CSI, "0;0H", ss$_CSI, "?7l" $ set terminal/nowrap $ ss$_rld = "F" $ NEXT_CMD: $ gosub GET_NEXT_CMD $ if .not. ss$_skp_to then goto SEARCH_TEST $ gosub TRAP_BRANCHES $ goto NEXT_CMD $ SEARCH_TEST: $ if .not. ss$_srch then goto AROUND_IT $ if f$locate(ss$_srch_str,ss$_cmd) .eq. f$length(ss$_cmd) then goto NEXT_CMD $ ss$_srch = "F" $ AROUND_IT: $ if .not. ss$_run then gosub DISPLAY_CMD $ if ss$_brk_pt .and. ss$_cmd_ln_no .eq. ss$_brk_line .or. ss$_ctrl_y then goto BREAK $ if f$type(ss$_ln_'ss$_ln_no'_is_label) .nes. "" then goto NEXT_CMD $ if ss$_run .or. ss$_cnt .gt. 0 then goto DO_IT $ ! $ INQUIRE: $ inquire/nopunctation ss$_rsp "''ss$_prompt'" $ ss$_typ = f$edit(f$extract(0, 1, ss$_rsp), "UPCASE") $ if ss$_typ .eqs. "" then goto DO_IT $ if ss$_typ .eqs. "S" then goto NEXT_CMD $ if ss$_typ .eqs. "$" then goto CMD_IN $ if f$type(ss$_rsp) .eqs. "INTEGER" then goto DO_N $ if ss$_typ .eqs. "G" then goto GO $ if ss$_typ .eqs. "J" then goto JUMP $ if ss$_typ .eqs. "P" then goto PRINT_LINE $ if ss$_typ .eqs. "V" then goto VIEW_BR $ if ss$_typ .eqs. "E" then goto EXAMINE $ if ss$_typ .eqs. "U" then goto STEP_UP $ if ss$_typ .eqs. "D" then goto STEP_DOWN $ if ss$_typ .eqs. "R" then goto REPAINT $ if ss$_typ .eqs. "F" then goto FIND_STRING $ if ss$_typ .eqs. "B" then goto SET_BREAK_PT $ if ss$_typ .eqs. "C" then goto CLEAR_BREAK_PT $ if ss$_typ .eqs. "L" then goto RELOAD $ if ss$_typ .eqs. "W" then goto WATCH $ if ss$_typ .eqs. "Q" .or. ss$_typ .eqs. "X" then goto EXIT $ if ss$_typ .eqs. "H" .or. ss$_typ .eqs. "?" then goto HELP $ ss$_say ss$_err_unrent $ goto INQUIRE $ ! $ DO_IT: $ gosub TRAP_BRANCHES $ 'ss$_cmd' $ if .not. ss$_inexit $ then ss$_dclstat = $status $ else $ ss$_dclstat = ss$_exitstat $ ss$_inexit = 0 $ endif $ if ss$_cnt .gt. 0 then ss$_cnt=ss$_cnt - 1 $ if .not. ss$_run .and. ss$_wtc then gosu DO_WATCH $ goto NEXT_CMD $ ! $ DO_N: $ ss$_cnt = f$integer(ss$_rsp) $ if ss$_cnt .gt. 0 then goto DO_IT $ ss$_say ss$_err_unrent $ goto INQUIRE $ ! $ CMD_IN: $ ss$_save_cmd = ss$_cmd $ ss$_cmd = f$extract(1, f$length(ss$_rsp) - 1, ss$_rsp) $ ss$_cmd = f$edit(ss$_cmd, "LOWERCASE,UNCOMMENT,TRIM") $ gosub TRAP_BRANCHES $ ss$_$_cmd = "T" $ ss$_brnch = "F" $ 'ss$_cmd' $ if .not. ss$_inexit $ then ss$_dclstat = $status $ else ss$_inexit = 0 $ endif $ if ss$_wtc then gosu DO_WATCH $ ss$_$_cmd = "F" $ if ss$_brnch then goto NEXT_CMD $ ss$_cmd = ss$_save_cmd $ goto INQUIRE $ ! $ VIEW_BR: $ if ss$_brk_pt $ then ss$_say f$fao("Breakpoint set at %!SW", ss$_brk_line) $ else ss$_say "No breakpoint set" $ endif $ goto INQUIRE $ ! $ JUMP: $ ss$_oldbrk_line = 0 $ if ss$_brk_pt then ss$_oldbrk_line = ss$_brk_line $ ss$_brk_pt = "T" $ ss$_brk_line = ss$_ln_no + 1 $ ! $ GO: $ ss$_run = "T" $ ss$_say ss$_go_output $ goto DO_IT $ ! $ STEP_UP: $ ss$_offset = f$element(1, " ", ss$_rsp) $ if ss$_offset .eq. 0 then ss$_offset = 1 $ ss$_ln_no = ss$_ln_no - f$integer(ss$_offset) - 1 $ if ss$_ln_no .lt. 1 then ss$_ln_no = 0 $ goto NEXT_CMD $ ! $ STEP_DOWN: $ ss$_offset = f$element(1, " ", ss$_rsp) $ if ss$_offset .eq. 0 then ss$_offset = 1 $ ss$_ln_no = ss$_ln_no + f$inte(ss$_offset) - 1 $ if ss$_ln_no .gt. ss$_last_ln then ss$_ln_no = ss$_last_ln - 1 $ goto NEXT_CMD $ ! $ REPAINT: $ gosub DO_REPAINT $ goto INQUIRE $ ! $ FIND_STRING: $ ss$_srch_str = f$edit(f$element(1, " ", ss$_rsp), "LOWERCASE,TRIM") $ ss$_srch = "T" $ ss$_srch_line = ss$_cmd_ln_no $ goto NEXT_CMD $ ! $ PRINT_LINE: $ ss$_loc_prm = f$element(1, " ", ss$_rsp) $ gosub GET_LINE_NO $ if ss$_lbl_ln_no .eq. 0 then goto INQUIRE $ ss$_say f$string(ss$_lbl_ln_no) + ": " + ss$_ln'ss$_lbl_ln_no' $ goto INQUIRE $ ! $ SET_BREAK_PT: $ ss$_loc_prm=f$element(1, " ", ss$_rsp) $ gosub GET_LINE_NO $ if ss$_lbl_ln_no .eq. 0 then goto INQUIRE $ ss$_brk_pt = "T" $ ss$_brk_line = ss$_lbl_ln_no $ goto INQUIRE $ ! $ CLEAR_BREAK_PT: $ ss$_brk_pt = "F" $ goto INQUIRE $ ! $ BREAK: $ ss$_run = "F" $ ss$_ctrl_y = "F" $ ss$_cnt = 0 $ if ss$_oldbrk_line .ne. 0 $ then ss$_brk_line = ss$_oldbrk_line $ else ss$_brk_pt = "F" $ endif $ if f$type(ss$_ln_'ss$_ln_no'_is_label) .nes. "" then goto NEXT_CMD $ goto REPAINT $ ! $ END: $ if .not. ss$_srch then goto EXIT $ ss$_say ss$_err_notfnd $ ss$_ln_no=ss$_srch_line - 1 $ ss$_srch = "F" $ goto NEXT_CMD $ ! $ EXIT: $ ss$_say ss$_c_off, ss$_CSI, "1;24r", ss$_CSI, "24;1H", ss$_c_on $ set terminal/wrap $ set control=(y,t) $ if f$type(ss$_old_state) .nes. "" then set key/nolog/stat='ss$_old_state' $ exit 'ss$_exitstat' $ ! $ HELP: $ ss$_say " ''ss$_b'Enter/CR''ss$_n' (step), ''ss$_b's''ss$_n'kip it, "+ - "''ss$_b'u''ss$_n'p [], ''ss$_b'd''ss$_n'own [], "+ - "''ss$_b'$''ss$_n', ''ss$_b'''ss$_n' (n steps)" $ ss$_say " e''ss$_b'x''ss$_n'it, ''ss$_b'q''ss$_n'uit, "+ - "''ss$_b'g''ss$_n'o, ''ss$_b'e''ss$_n'xamine , "+ - "''ss$_b'b''ss$_n'reak %/