version 1.18, 2007/12/31 18:40:23
|
version 1.26, 2012/12/31 15:25:18
|
Line 1
|
Line 1
|
\ Simple debugging aids |
\ Simple debugging aids |
|
|
\ Copyright (C) 1995,1997,1999,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1997,1999,2002,2003,2004,2005,2006,2007,2009,2011,2012 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 49 defer .debugline ( nfile nline -- ) \ gf
|
Line 49 defer .debugline ( nfile nline -- ) \ gf
|
printdebugdata |
printdebugdata |
cr ; |
cr ; |
|
|
|
[IFUNDEF] debug-fid |
|
stderr value debug-fid ( -- fid ) |
|
\G (value) Debugging output prints to this file |
|
[THEN] |
|
|
' (.debugline) IS .debugline |
' (.debugline) IS .debugline |
|
|
: .debugline-stderr ( nfile nline -- ) |
: .debugline-directed ( nfile nline -- ) |
['] .debugline stderr outfile-execute ; |
action-of type action-of emit { oldtype oldemit } |
|
try |
|
['] (type) is type ['] (emit) is emit |
|
['] .debugline debug-fid outfile-execute |
|
0 |
|
restore |
|
oldemit is emit oldtype is type |
|
endtry |
|
throw ; |
|
|
:noname ( -- ) |
:noname ( -- ) |
current-sourcepos .debugline-stderr ; |
current-sourcepos .debugline-directed ; |
:noname ( compilation -- ; run-time -- ) |
:noname ( compilation -- ; run-time -- ) |
compile-sourcepos POSTPONE .debugline-stderr ; |
compile-sourcepos POSTPONE .debugline-directed ; |
interpret/compile: ~~ ( -- ) \ gforth tilde-tilde |
interpret/compile: ~~ ( -- ) \ gforth tilde-tilde |
\G Prints the source code location of the @code{~~} and the stack |
\G Prints the source code location of the @code{~~} and the stack |
\G contents with @code{.debugline}. |
\G contents with @code{.debugline}. |
|
|
|
:noname ( -- ) stderr to debug-fid defers 'cold ; IS 'cold |