diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2016-12-02 16:39:00 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-12-23 16:16:27 +1100 |
commit | f38ed2656a5f9983948b79ccf5e1d344035bf531 (patch) | |
tree | 36a46191dd4dc654a35e20c18b9f393b02f49586 /external | |
parent | dec17027dd3b65eee93782156ab76094c6b6b592 (diff) | |
download | skiboot-f38ed2656a5f9983948b79ccf5e1d344035bf531.zip skiboot-f38ed2656a5f9983948b79ccf5e1d344035bf531.tar.gz skiboot-f38ed2656a5f9983948b79ccf5e1d344035bf531.tar.bz2 |
mambo_utils: add ascii output to hexdump
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/mambo/mambo_utils.tcl | 13 |
1 files changed, 12 insertions, 1 deletions
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" } |