Diff for /gforth/debug.fs between versions 1.15 and 1.23

version 1.15, 2000/05/12 07:55:41 version 1.23, 2003/03/22 10:04:06
Line 1 Line 1
 \ DEBUG.FS     Debugger                                12jun93jaw  \ DEBUG.FS     Debugger                                12jun93jaw
   
 \ Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,2000,2003 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 16 Line 16
   
 \ You should have received a copy of the GNU General Public License  \ You should have received a copy of the GNU General Public License
 \ along with this program; if not, write to the Free Software  \ along with this program; if not, write to the Free Software
 \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
   
   require see.fs
   
 decimal  decimal
   
Line 97  CREATE DT 0 , 0 , Line 99  CREATE DT 0 , 0 ,
   
 VARIABLE Body  VARIABLE Body
   
 : NestXT        ( xt -- true | body false )  : nestXT-checkSpecial ( xt -- xt2 | cfa xt2 ) 
                 \ special deal for create does> words    dup >does-code IF
                 \ leaves body address on the stack      \ if nest into a does> we must leave
                 dup >does-code IF dup >body swap THEN      \ the body address on stack as does> does...
       dup >body swap EXIT
                 DebugMode c-pass ! C-Output off    THEN
                 xt-see C-Output on    dup ['] EXECUTE = IF   
                 c-pass @ DebugMode = dup      \ xt to EXECUTE is next stack item...
                 IF      ." Cannot debug" cr      drop EXIT 
                 THEN ;             THEN
     dup ['] PERFORM = IF
       \ xt to EXECUTE is addressed by next stack item
       drop @ EXIT 
     THEN
     BEGIN
       dup >code-address dodefer: =
       WHILE
         \ load xt of DEFERed word
         cr ." nesting defered..." 
         >body @    
     REPEAT ;
   
   : nestXT ( xt -- true | body false )
   \G return true if we are not able to debug this, 
   \G body and false otherwise
     nestXT-checkSpecial 
     \ scan code with xt-see
     DebugMode c-pass ! C-Output off
     xt-see C-Output on
     c-pass @ DebugMode = dup
     IF      cr ." Cannot debug!!"
     THEN ;
   
 VARIABLE Nesting  VARIABLE Nesting
   
Line 115  VARIABLE Unnest Line 139  VARIABLE Unnest
 : D-KEY         ( -- flag )  : D-KEY         ( -- flag )
         BEGIN          BEGIN
                 Unnest @ IF 0 ELSE key THEN                  Unnest @ IF 0 ELSE key THEN
                 CASE    [char] n OF     dbg-ip @ @ NestXT EXIT ENDOF                  CASE    [char] n OF     dbg-ip @ @ nestXT EXIT ENDOF
                         [char] s OF     Leave-D                          [char] s OF     Leave-D
                                         -128 THROW ENDOF                                          -128 THROW ENDOF
                         [char] a OF     Leave-D                          [char] a OF     Leave-D
Line 159  VARIABLE Unnest Line 183  VARIABLE Unnest
     ' NestXT IF EXIT THEN (debug) Leave-D ;      ' NestXT IF EXIT THEN (debug) Leave-D ;
   
 : break:, ( -- )  : break:, ( -- )
   lastxt postpone literal ;    latestxt postpone literal ;
   
 : (break:)  : (break:)
     r> ['] (_debug) >body >r ;      r> ['] (_debug) >body >r ;

Removed from v.1.15  
changed lines
  Added in v.1.23


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>