Debugging in WinForth 
Author Message
 Debugging in WinForth

Hi folks,

i have a problem when debugging under WinForth.
My Platform is Win95, the forth version is Winforth 3.5
inc. Update 01.  
Starting the De{*filter*} first time seems to be alright.
But after some changes of the source text there are the
wrong words highlighted in WinView.
Is there any way to work around this?

Thanks in advance.

Norbert



Fri, 25 Feb 2000 03:00:00 GMT  
 Debugging in WinForth

Quote:

> Hi folks,

> i have a problem when debugging under WinForth.
> My Platform is Win95, the forth version is Winforth 3.5
> inc. Update 01.
> Starting the De{*filter*} first time seems to be alright.
> But after some changes of the source text there are the
> wrong words highlighted in WinView.
> Is there any way to work around this?

Win32Forth uses source pointers that are saved when the code being
compiled is loaded.  If you subsequently edit the source file, and
haven't
reloaded the code (to cause the pointer save file to be rebuilt) then
it will highlight the wrong things.  You must recompile after an edit
is performed, for highlighting to work properly.  Also, be sure to save
your changes in the file being edited, or reloading it won't load what
is shown in
the editor, since all editing is done in memory, and doesn't get written

to disk until you save the file.  A load of a file from Win32Forth loads

whatever was last written into the specified file.

Tom Zimmer



Sat, 26 Feb 2000 03:00:00 GMT  
 Debugging in WinForth

Quote:
Norbert Hoppe  writes:
> Hi folks,

> i have a problem when debugging under WinForth.
> My Platform is Win95, the forth version is Winforth 3.5
> inc. Update 01.  
> Starting the De{*filter*} first time seems to be alright.
> But after some changes of the source text there are the
> wrong words highlighted in WinView.
> Is there any way to work around this?

> Thanks in advance.

>Norbert

Tom Zimmer has answered this clearly. But I should note that
MARKER, as used in the example below, is a useful debugging aid.
As noted further on, it works a lot better than FORGET in WinForth
v. 3.5.

\ Finite state machine compiler
\ ANS compatible version
\ Uses TOOLSET EXT (MARKER)

marker -fsm     \ say "-fsm" to clear all this out

: |     '  ,  ;
     : WIDE   0 ;

     : FSM:   ( width 0 -- )      CREATE   ,  ,   ;
        \ make header and store state and width in 1st 2 cells

     : ;FSM   DOES>                 ( col# adr -- )

               *  +                 ( -- x col#+width*state )
               2*  2 +  CELLS       ( -- x relative offset )

               DUP >R               ( -- x offset-to-action )
               PERFORM              ( -- x' )
               R> CELL+             ( -- x' offset-to-update )
               PERFORM              ( -- x' state')
               R> !   ;             ( x' )  \ update state

: 0!    0 swap !  ;     \ a word that ought to be STANDARD
                        \ and may be, for all I know!

: reset   \ state-smart reset for fsm's; set state = 0
          '  >body                  \ get dfa

          if    postpone literal postpone 0!
          else  0!  then  ;   immediate

0 CONSTANT >0   1 CONSTANT >1   2 CONSTANT >2
3 CONSTANT >3   4 CONSTANT >4   5 CONSTANT >5

\ Test example:  September 10th, 1997 - 0:18
\ 4 wide fsm: test | + | >0 | - | >1 | * | >2 | / | >3  ;fsm ok
\ reset test  4 6 0 test . 10  ok
\ reset test  4 6 1 test . -2  ok
\ reset test  4 6 2 test . 24  ok
\ reset test  24 6 2 test . 144  ok
\ reset test  24 6 3 test . 4  ok
\ : test1   reset test  24 8 1 test . ;  ok
\ test1 16  ok

While debugging I tried FORGET and found I kept getting messages
that I was redefining stuff, when I reloaded. But MARKER worked
just fine--all I had to say was "-fsm" and the previous compile
evaporated.

--
Julian V. Noble



Sun, 27 Feb 2000 03:00:00 GMT  
 Debugging in WinForth



Quote:
> marker -fsm        \ say "-fsm" to clear all this out

In Win32Forth, you can say anew -fsm which will automatically forget
everything after -fsm if -fsm is defined. Otherwise it defines it.

Quote:
> : 0!    0 swap !  ;        \ a word that ought to be STANDARD
>                    \ and may be, for all I know!

This is called off all the Forths I have. On sets a variable to -1.

I have had problems with the highlighted word not following the debugging
word even when I haven't edited the source. Maybe it's because I use the
optimizer.

phma



Mon, 28 Feb 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. WinForth

2. WinForth, where are you???

3. FS: LMI WinForth Pro (price 2 /)

4. Calling WinForth from a profane language

5. Evolution of WinForth?

6. Creating Dll's in Winforth

7. WinForth Windows GUI?

8. winforth and ini files?

9. WINFORTH, WINLIB.F and COMMCTRL.DLL under NT4

10. WinFORTH

11. LMI WINFORTH Question

12. WinForth Questions

 

 
Powered by phpBB® Forum Software