• Jordan Niethe's avatar
    powerpc/xmon: Improve dumping prefixed instructions · 8b98afc1
    Jordan Niethe authored
    Currently prefixed instructions are dumped as two separate word
    instructions. Use mread_instr() so that prefixed instructions are read
    as such and update the incrementor in the loop to take this into
    account.
    
    'dump_func' is print_insn_powerpc() which comes from ppc-dis.c which is
    taken from binutils. When this is updated prefixed instructions will be
    disassembled.
    
    Currently dumping prefixed instructions looks like this:
    0:mon> di c000000000094168
    c000000000094168  0x06000000    .long 0x6000000
    c00000000009416c  0x392a0003    addi    r9,r10,3
    c000000000094170  0x913f0028    stw     r9,40(r31)
    c000000000094174  0xe93f002a    lwa     r9,40(r31)
    c000000000094178  0x7d234b78    mr      r3,r9
    c00000000009417c  0x383f0040    addi    r1,r31,64
    c000000000094180  0xebe1fff8    ld      r31,-8(r1)
    c000000000094184  0x4e800020    blr
    c000000000094188  0x60000000    nop
     ...
    c000000000094190  0x3c4c0121    addis   r2,r12,289
    c000000000094194  0x38429670    addi    r2,r2,-27024
    c000000000094198  0x7c0802a6    mflr    r0
    c00000000009419c  0x60000000    nop
    c0000000000941a0  0xe9240100    ld      r9,256(r4)
    c0000000000941a4  0x39400001    li      r10,1
    
    After this it looks like:
    0:mon> di c000000000094168
    c000000000094168  0x06000000 0x392a0003 .long 0x392a000306000000
    c000000000094170  0x913f0028    stw     r9,40(r31)
    c000000000094174  0xe93f002a    lwa     r9,40(r31)
    c000000000094178  0x7d234b78    mr      r3,r9
    c00000000009417c  0x383f0040    addi    r1,r31,64
    c000000000094180  0xebe1fff8    ld      r31,-8(r1)
    c000000000094184  0x4e800020    blr
    c000000000094188  0x60000000    nop
     ...
    c000000000094190  0x3c4c0121    addis   r2,r12,289
    c000000000094194  0x38429570    addi    r2,r2,-27280
    c000000000094198  0x7c0802a6    mflr    r0
    c00000000009419c  0x60000000    nop
    c0000000000941a0  0xe9240100    ld      r9,256(r4)
    c0000000000941a4  0x39400001    li      r10,1
    c0000000000941a8  0x3d02000b    addis   r8,r2,11
    Signed-off-by: default avatarJordan Niethe <jniethe5@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20200602052728.18227-2-jniethe5@gmail.com
    8b98afc1
xmon.c 90.6 KB