chiark / gitweb /
dump debug area in ascii too
authorian <ian>
Sun, 27 Apr 2008 22:53:52 +0000 (22:53 +0000)
committerian <ian>
Sun, 27 Apr 2008 22:53:52 +0000 (22:53 +0000)
detpic/crashread

index ce7b86e1f3e9d5fc7303929eeb08170056500685..301a84a2b7bf6f01f6c1e81106ab1f58021f1869 100755 (executable)
@@ -432,9 +432,11 @@ addendlast symbolsbylockind(program) 0x8000 (end)
 
 set stkptr {panic: psave_stkptr}
 set stack {panic: panic_stack}
+set debug1 {misc: debug}
+set debug0 {{} (debugp)}
 
 reset_show
-foreach ss [list $stkptr $stack] { set ccontents($ss) {} }
+foreach ss [list $stkptr $stack $debug0 $debug1] { set ccontents($ss) {} }
 
 while {$sectionnum < [llength $sections]} {
     # So what happens at this address ?
@@ -505,6 +507,35 @@ foreach v {stkptr stack} {
 }
 
 endline
+
+p "---------- =Debug buffer= ----------\n"
+
+set debug "$ccontents($debug0)$ccontents($debug1)"
+
+for {set ibase 0} {$ibase < [string length $debug]} {set ibase $i} {
+    for {set ch 0} {$ch<2} {incr ch} {
+       for {set i $ibase} \
+           {$i < [string length $debug] && \
+                $i<$ibase+32} \
+           {incr i 2} \
+       {
+           set hn [string range $debug $i [expr {$i+1}]]
+           if {!$ch} {
+               set p $hn
+           } else {
+               set v [expr "0x$hn"]
+               if {$v>=32 && $v<127} {
+                   set p [format " %c" $v]
+               } else {
+                   set p ..
+               }
+           }
+           puts -nonewline " $p"
+       }
+       puts -nonewline "\n"
+    }
+}
+
 p "---------- =Execution Stack= ----------\n"
 set stkptr [expr "0x$stkptr & $stackdepth"]