home *** CD-ROM | disk | FTP | other *** search
- MODULE 'exec/ports'
- MODULE 'exec/nodes'
- MODULE 'dos/dos'
-
- MODULE 'sendrexx'
-
- -> VERY smple debugger for executables created by yaec.
- -> DBUG switch must be on!
- -> uses GoldEd to show lines in sources.
- -> there is no sendrexx module for yaec yet, so this have to
- -> be compiled with Wouters EC for now.
-
- OBJECT msg OF mn
- debugtask
- sourcename
- line
- ENDOBJECT
-
- RAISE "PORT" IF CreateMsgPort() = NIL,
- "LIB" IF OpenLibrary() = NIL
-
- PROC main() HANDLE
- DEF mp:PTR TO mp
- DEF wsigs
- DEF mpsig
- DEF rsigs
- DEF msg:PTR TO msg
- DEF exit=FALSE
- DEF instr[50]:STRING
- DEF port
- DEF toline=NIL
-
- rexxsysbase := OpenLibrary('rexxsyslib.library', 36)
-
- /* yaec executables fetches this port at startup */
- mp := CreateMsgPort()
- mp.ln.name := 'edbug'
- mp.ln.pri := 0
- AddPort(mp)
-
- mpsig := Shl(1, mp.sigbit)
- wsigs := mpsig OR SIGBREAKF_CTRL_C
-
- port := FindPort('GOLDED.1')
- StringF(instr, 'ged \s.eeh', arg)
- SystemTagList(instr, NIL)
- IF port = NIL THEN Delay(200)
- SystemTagList('RUN t:exe', NIL)
-
- REPEAT
- rsigs := Wait(wsigs) -> wait for debugged task(s) to give us control
- IF rsigs AND mpsig
- msg := GetMsg(mp)
- IF msg
- IF msg.sourcename THEN PrintF('source : \s, ', msg.sourcename)
- PrintF('line : \d\n', msg.line)
- StringF(instr, '''PC LINE \d HIGHLIGHT''', msg.line)
- ->rx_SendMsg('GOLDED.1', '''LOCK CURRENT RELEASE=4''', NIL)
- rx_SendMsg('GOLDED.1', instr, NIL)
- ->rx_SendMsg('GOLDED.1', '''UNLOCK''', NIL)
- IF msg.line >= (toline-1) THEN toline := NIL
- IF toline = NIL
- ReadStr(stdout, instr)
- toline := Val(instr)
- ENDIF
- /* let debugged task continiue execution */
- Signal(msg.debugtask, SIGBREAKF_CTRL_F)
- ENDIF
- ENDIF
- IF rsigs AND SIGBREAKF_CTRL_C THEN exit := TRUE
- UNTIL exit
-
- EXCEPT DO
-
- IF exception THEN PrintF('error!!\n')
-
- IF rexxsysbase THEN CloseLibrary(rexxsysbase)
-
- IF mp THEN RemPort(mp)
-
- IF mp THEN DeleteMsgPort(mp)
-
- ENDPROC
-
-