[Skiboot] [PATCH] external/mambo: Add di command to decode instructions

Balbir Singh bsingharora at gmail.com
Tue Apr 24 16:47:41 AEST 2018


On Mon, Apr 23, 2018 at 4:41 PM, Michael Neuling <mikey at neuling.org> wrote:
> 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 at neuling.org>
> ---
>  external/mambo/mambo_utils.tcl | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/external/mambo/mambo_utils.tcl b/external/mambo/mambo_utils.tcl
> index 54b367c47c..b503acbfd4 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"
> +    }
> +}
> +

Doesn't disasm_mem mysim $location $count achieve the same thing?

Balbir Singh


More information about the Skiboot mailing list