--- gforth/debugs.fs 2003/08/25 14:17:44 1.9 +++ gforth/debugs.fs 2006/12/31 13:39:12 1.15 @@ -1,6 +1,6 @@ \ Simple debugging aids -\ Copyright (C) 1995,1997,1999,2002,2003 Free Software Foundation, Inc. +\ Copyright (C) 1995,1997,1999,2002,2003,2004,2005,2006 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -39,6 +39,9 @@ require source.fs defer printdebugdata ( -- ) \ gforth print-debug-data ' .s IS printdebugdata defer .debugline ( nfile nline -- ) \ gforth print-debug-line +\G Print the source code location indicated by @var{nfile nline}, and +\G additional debugging information; the default @code{.debugline} +\G prints the additional information with @code{printdebugdata}. : (.debugline) ( nfile nline -- ) cr .sourcepos ." :" @@ -49,5 +52,14 @@ defer .debugline ( nfile nline -- ) \ gf ' (.debugline) IS .debugline -: ~~ ( compilation -- ; run-time -- ) \ gforth tilde-tilde - compile-sourcepos POSTPONE .debugline ; immediate +: .debugline-stderr ( nfile nline -- ) + stderr >outfile .debugline outfile< ; + +:noname ( -- ) + current-sourcepos .debugline-stderr ; +:noname ( compilation -- ; run-time -- ) + compile-sourcepos POSTPONE .debugline-stderr ; +interpret/compile: ~~ ( -- ) \ gforth tilde-tilde +\G Prints the source code location of the @code{~~} and the stack +\G contents with @code{.debugline}. +