ppc: recognize all program traps
authorJan Vrany <jan.vrany@labware.com>
Wed, 8 Dec 2021 10:46:49 +0000 (10:46 +0000)
committerJan Vrany <jan.vrany@labware.com>
Wed, 8 Dec 2021 10:46:49 +0000 (10:46 +0000)
commit2bd64d21094f9527c9a6019f668c16ca897b2631
tree8cc6fda87a0ccdc6011237b1ce30876661a5698f
parent44f3c3c212f9b568a6b3cff0444b6750e3d8680f
ppc: recognize all program traps

Permanent program breakpoints (ones inserted into the code) other than
the one GDB uses for POWER (0x7fe00008) did not result in stop but
caused GDB to loop infinitely.

This was because GDB did not recognize trap instructions other than
"trap". For example, "tw 12, 4, 4" was not be recognized, causing GDB
to loop forever.

This commit fixes this by providing POWER specific hook
(gdbarch_program_breakpoint_here_p) recognizing all tw, twi, td and tdi
instructions.

Tested on Linux on PowerPC e500 and on QEMU PPC64le.
gdb/rs6000-tdep.c
gdb/testsuite/gdb.arch/powerpc-trap.exp [new file with mode: 0644]
gdb/testsuite/gdb.arch/powerpc-trap.s [new file with mode: 0644]
gdb/testsuite/gdb.arch/powerpc64-trap.s [new file with mode: 0644]