diff options
author | Michael Neuling <mikey@neuling.org> | 2018-04-23 16:41:17 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-04-24 00:11:50 -0500 |
commit | 1bcd6d84ec8061e3593bfca50e2a1f81006b16c0 (patch) | |
tree | 661644d7336f376f030ce98342600984cff99a64 /external/mambo/mambo_utils.tcl | |
parent | c31cb73d8edb6e8cd227dfe45f85459e6a8ef572 (diff) | |
download | talos-skiboot-1bcd6d84ec8061e3593bfca50e2a1f81006b16c0.tar.gz talos-skiboot-1bcd6d84ec8061e3593bfca50e2a1f81006b16c0.zip |
external/mambo: Add di command to decode instructions
By default you get 16 instructions but you can specify the number you
want. ie
systemsim % di 0x100 4
0x0000000000000100: Enc:0xA64BB17D : mtspr HSPRG1,r13
0x0000000000000104: Enc:0xA64AB07D : mfspr r13,HSPRG0
0x0000000000000108: Enc:0xF0092DF9 : std r9,0x9F0(r13)
0x000000000000010C: Enc:0xA6E2207D : mfspr r9,PPR
Using di since it's what xmon uses.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'external/mambo/mambo_utils.tcl')
-rw-r--r-- | external/mambo/mambo_utils.tcl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/external/mambo/mambo_utils.tcl b/external/mambo/mambo_utils.tcl index 54b367c4..b503acbf 100644 --- a/external/mambo/mambo_utils.tcl +++ b/external/mambo/mambo_utils.tcl @@ -158,6 +158,17 @@ proc ex { ea { size 8 } } { puts "$pa : $val" } +proc di { location { count 16 } } { + set addr [expr $location & 0xfffffffffffffff0] + set top [expr $addr + ($count * 4)] + for { set i $addr } { $i < $top } { incr i 4 } { + set pc_laddr [mysim cpu 0 util itranslate $i] + set inst [mysim cpu 0 memory display $pc_laddr 4] + set disasm [mysim cpu 0 util ppc_disasm $inst $i] + puts "$pc_laddr: Enc:$inst : $disasm" + } +} + proc hexdump { location count } { set addr [expr $location & 0xfffffffffffffff0] set top [expr $addr + ($count * 15)] |