[Skiboot] [PATCH 3/3] mambo_utils: add ascii output to hexdump

Oliver O'Halloran oohall at gmail.com
Fri Dec 2 16:39:00 AEDT 2016


Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 external/mambo/mambo_utils.tcl | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/external/mambo/mambo_utils.tcl b/external/mambo/mambo_utils.tcl
index 879db92528a8..d8825bc3cefb 100644
--- a/external/mambo/mambo_utils.tcl
+++ b/external/mambo/mambo_utils.tcl
@@ -155,7 +155,18 @@ proc hexdump { location count }    {
         set val2 [format "%08x" [mysim memory display $val 4]]
         set val [expr $i + (4 * 3)]
         set val3 [format "%08x" [mysim memory display $val 4]]
-        set ascii "(none)"
+
+        set ascii ""
+	for { set j 0 } { $j < 16 } { incr j } {
+		set byte [get_char [expr $i + $j]]
+		if { $byte < 0x20 || $byte >= 127} {
+			set c "."
+		} else {
+			set c [format %c $byte]
+		}
+	        set ascii [string cat "$ascii" "$c"]
+	}
+
         set loc [format "0x%016x" $i]
         puts "$loc: $val0 $val1 $val2 $val3 $ascii"
     }
-- 
2.5.5



More information about the Skiboot mailing list