Author: quozl Date: Wed Oct 17 09:05:36 2012 New Revision: 3372 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3372
Log: decompiler - for strings with embedded control characters, render the characters as #, to fix visual debugger rendering, http://dev.laptop.org/ticket/12104
Modified: forth/lib/decomp.fth
Modified: forth/lib/decomp.fth ============================================================================== --- forth/lib/decomp.fth Tue Oct 16 02:01:45 2012 (r3371) +++ forth/lib/decomp.fth Wed Oct 17 09:05:36 2012 (r3372) @@ -330,10 +330,21 @@ 2 pick count ( ip name$ $ ) 2swap ( ip $ name$ ) ; + +: type# ( $ -- ) \ render control characters as green # + bounds ?do + i c@ dup h# 20 < if + drop green-letters ." #" red-letters + else + emit + then + loop +; + : .string-tail ( $ name$ -- ) 2 pick over + 3 + ?line ( $ name$ ) \ Keep word and string on the same line cr". space ( $ ) - red-letters type ( ) + red-letters type# ( ) magenta-letters ( ) ." "" " ( ) cancel ( )