ppc: use "trap" ("tw, 31, 0, 0") as breakpoint instruction
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)
Power ISA 3.0 B spec [1], sections 3.3.11 "Fixed-Point Trap Instructions"
and section C.6 "Trap Mnemonics" specify "tw, 31, 0, 0" (encoded as
0x7fe00008) as canonical unconditional trap instruction.

This commit changes the breakpoint instruction used by GDB from
"tw 12, r2, r2" to unconditional "trap".

[1]: https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0

gdb/rs6000-tdep.c

index 87a494e0bb8cf481bc27ae1cfe0ae5646261df37..43880fa44269510dc97f3f8d00ddef3559073f55 100644 (file)
@@ -824,8 +824,8 @@ rs6000_fetch_pointer_argument (struct frame_info *frame, int argi,
 
 /* Sequence of bytes for breakpoint instruction.  */
 
-constexpr gdb_byte big_breakpoint[] = { 0x7d, 0x82, 0x10, 0x08 };
-constexpr gdb_byte little_breakpoint[] = { 0x08, 0x10, 0x82, 0x7d };
+constexpr gdb_byte big_breakpoint[] = { 0x7f, 0xe0, 0x00, 0x08 };
+constexpr gdb_byte little_breakpoint[] = { 0x08, 0x00, 0xe0, 0x7f };
 
 typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint)
   rs6000_breakpoint;