Changeset 3129


Ignore:
Timestamp:
Aug 3, 2012, 11:23:39 PM (3 years ago)
Author:
wmb
Message:

Debugger - added longer stack display to visual mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • forth/lib/debug.fth

    r3128 r3129  
    127127d# 45 constant stack-column
    128128\ 0 0 2value result-loc
     1290 0 2value full-stack-xy
    1291300 value result-line
    1301310 value result-col
    131132: to-stack-location  ( -- )  stack-column stack-line at-xy  kill-line  ;
     133: show-full-stack  ( -- )
     134   full-stack-xy at-xy kill-line
     135   depth 0<  if  ." Stack Underflow"   exit  then  \ Don't clear stack here
     136   depth 0=  if  ." Empty"  exit  then
     137   depth 7 >  if  ." .. "  then
     138   depth  depth 7 - 0 max  ?do  depth i - 1- pick n.  loop
     139;
    132140: show-partial-stack  ( -- )
     141   show-full-stack
     142
    133143   to-stack-location
    134144
     
    136146   depth 0<  if  ." Stack Underflow" sp0 @ sp!  exit  then
    137147   depth 0=  if  ." Empty"  exit  then
    138    depth 4 >  if  ." .. "  then
    139    depth  depth 5 - 0 max  ?do  depth i - 1- pick n.  loop
     148   depth 3 >  if  ." .. "  then
     149   depth  depth 4 - 0 max  ?do  depth i - 1- pick n.  loop
    140150;
    141151
     
    192202   ." Callers: "  rp0 @ the-rp na1+ rslist kill-line cr
    193203   d# 40 rmargin !
     204   ." Stack: " #out @ #line @ to full-stack-xy  cr  \ For stack
    194205   the-ip debug-see
    195206   cr
Note: See TracChangeset for help on using the changeset viewer.