From f38ed2656a5f9983948b79ccf5e1d344035bf531 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Fri, 2 Dec 2016 16:39:00 +1100 Subject: mambo_utils: add ascii output to hexdump Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- 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 879db92..d8825bc 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" } -- cgit v1.1