Author: wmb Date: 2008-10-05 22:00:04 +0200 (Sun, 05 Oct 2008) New Revision: 982
Modified: forth/lib/rstrace.fth Log: Ftrace - fix ftrace brokenness resulting from a recent improvement to the rstrace return stack display decoding.
Modified: forth/lib/rstrace.fth =================================================================== --- forth/lib/rstrace.fth 2008-10-05 20:00:00 UTC (rev 981) +++ forth/lib/rstrace.fth 2008-10-05 20:00:04 UTC (rev 982) @@ -43,7 +43,16 @@ then ( rs-adr n ) 9 u.r ; -: .traceline ( rs-adr -- rs-adr' ) +: .traceline ( ipaddr -- ) + push-hex + dup reasonable-ip? + if dup .last-executed ip>token .caller else 9 u.r then cr + pop-base +; +\ Heuristic display of return stack items, recognizing Forth word nesting, +\ catch frames, and do loop frames. +\ For later: It would also be nice to recognize input stream nesting frames. +: rtraceline ( rs-adr -- rs-adr' ) push-hex ( rs-adr ) @+ ( rs-adr' ip ) dup reasonable-ip? if ( rs-adr ip ) @@ -59,7 +68,7 @@ ; : (rstrace ( end-adr start-adr -- ) begin 2dup u> while ( end-adr adr ) - .traceline ( end-adr adr' ) + rtraceline ( end-adr adr' ) exit? if 2drop exit then ( end-adr adr ) repeat ( end-adr adr ) 2drop
openfirmware@openfirmware.info