Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.13 $; site uiucdcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!uiucdcs!liberte From: liberte@uiucdcs.UUCP Newsgroups: net.lang.forth Subject: Re: Re: single-stepping in Forth - (nf) Message-ID: <30900008@uiucdcs.UUCP> Date: Tue, 8-May-84 16:05:00 EDT Article-I.D.: uiucdcs.30900008 Posted: Tue May 8 16:05:00 1984 Date-Received: Wed, 9-May-84 23:44:25 EDT References: <241@uwvax.UUCP> Lines: 47 Nf-ID: #R:uwvax:-24100:uiucdcs:30900008:000:2039 Nf-From: uiucdcs!liberte May 8 15:05:00 1984 #R:uwvax:-24100:uiucdcs:30900008:000:2039 uiucdcs!liberte May 8 15:05:00 1984 Although the single stepping methods suggested by Dave Anderson may be helpful, particularly in bringing up a new system, neither of them do what I had in mind, as stated. They are both "global" stepping, in that they would step through everything (except code words). What I wanted was "local" stepping that would step through just the words I choose. To do this by changing (modifying the compiled code of) either the inner interpreter (;S, I believe) or the docol word, one would also have to have a table of words that are being stepped through and the stepper would have to continuously determine whether it is supposed to step through the current word. Blechkt! The alternative is, as I suggested, to change just the CFA of those words which you wish to step through and have the stepper control the interpreting of those words. Then the inner interpreter would always return to the stepper as each subword finished. A schematic of the stepper follows. : step ( instead of docol for stepped words ) magic words to initialize begin load next subword address display name of subword prompt for command if step then execute subword ( return here ) more magic words again ; Another approach is to have the stepper change the subword address following the next subword to reference the stepper again so that after the next subword returns, the stepper is activated again. This would act like a series of breakpoints. The problem here, as with breakpoints, is that the address replaced by the stepper address must be saved and restored, probably on the return stack. Another more serious problem is that finding that address depends on what the next subword does. Literals stored in the code would have to be jumped over correctly. This is an argument for keeping literals in a separate place, as in Smalltalk, another threaded interpreted language of more appropriate design. Daniel LaLiberte, U of Illinois, Urbana-Champaign, Computer Science {moderation in all things - including moderation}