[PATCH, rs6000, v3][PR gdb/27525] displaced stepping across addpcis/lnia.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Mon, 12 Apr 2021 18:35:54 +0000 (13:35 -0500)
committerWill Schmidt <will_schmidt@vnet.ibm.com>
Mon, 12 Apr 2021 18:35:54 +0000 (13:35 -0500)
commite3d528d7e6a6b863d30aaecf74adf8c78286f84c
treeec7b64bf5893b1bad1aec556ae7754896a47cdc6
parent82d9b2804751252a31342ab5a501ef6c96f4548a
[PATCH, rs6000, v3][PR gdb/27525] displaced stepping across addpcis/lnia.

  This addresses PR gdb/27525.     The lnia and other variations
of the addpcis instruction write the value of the NIA into a target register.
If we are single-stepping across a breakpoint, the instruction is executed
from a displaced location, and thusly the written value of the PC/NIA
will be incorrect.   The changes here will measure the displacement
offset, and adjust the target register value to compensate.

YYYY-MM-DD  Will Schmidt  <will_schmidt@vnet.ibm.com>

gdb/ChangeLog:

        * rs6000-tdep.c (ppc_displaced_step_fixup): Update to handle
        the addpcis/lnia instruction.

gdb/testsuite/ChangeLog:

        * gdb.arch/powerpc-addpcis.exp: Testcase harness to
        exercise single-stepping over subpcis,lnia,addpcis instructions
        with displacement.
        * gdb.arch/powerpc-addpcis.s: Testcase with stream
        of addpcis/lnia/subpcis instructions.
        * gdb.arch/powerpc-lnia.exp: Testcase harness to exercise
        single-stepping over lnia instructions with displacement.
        * gdb.arch/powerpc-lnia.s: Testcase with stream of
        lnia instructions.
gdb/ChangeLog
gdb/rs6000-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/powerpc-addpcis.exp [new file with mode: 0644]
gdb/testsuite/gdb.arch/powerpc-addpcis.s [new file with mode: 0644]
gdb/testsuite/gdb.arch/powerpc-lnia.exp [new file with mode: 0644]
gdb/testsuite/gdb.arch/powerpc-lnia.s [new file with mode: 0644]