aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2025-08-19 15:33:44 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2025-08-25 19:58:08 +0800
commitc9b8f14cbafac00acfbeaba1590ef9dd5ec8cd4a (patch)
treeb4e147509e87909657effd93ee1102be56b94276
parent8b7a074374f812a00f6f30be849f1b1f32bbe230 (diff)
downloadbinutils-c9b8f14cbafac00acfbeaba1590ef9dd5ec8cd4a.zip
binutils-c9b8f14cbafac00acfbeaba1590ef9dd5ec8cd4a.tar.gz
binutils-c9b8f14cbafac00acfbeaba1590ef9dd5ec8cd4a.tar.bz2
gdb: LoongArch: Handle newly added llsc instructions
We can't put a breakpoint in the middle of a ll/sc atomic sequence, handle the instructions sc.q, llacq.{w/d}, screl.{w/d} newly added in the LoongArch Reference Manual v1.10 so a ll/sc atomic sequence using them won't loop forever being debugged. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
-rw-r--r--gdb/loongarch-tdep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c
index 3bf47d2..e497848 100644
--- a/gdb/loongarch-tdep.c
+++ b/gdb/loongarch-tdep.c
@@ -98,7 +98,9 @@ static bool
loongarch_insn_is_ll (insn_t insn)
{
if ((insn & 0xff000000) == 0x20000000 /* ll.w */
- || (insn & 0xff000000) == 0x22000000) /* ll.d */
+ || (insn & 0xff000000) == 0x22000000 /* ll.d */
+ || (insn & 0xfffffc00) == 0x38578000 /* llacq.w */
+ || (insn & 0xfffffc00) == 0x38578800) /* llacq.d */
return true;
return false;
}
@@ -109,7 +111,10 @@ static bool
loongarch_insn_is_sc (insn_t insn)
{
if ((insn & 0xff000000) == 0x21000000 /* sc.w */
- || (insn & 0xff000000) == 0x23000000) /* sc.d */
+ || (insn & 0xff000000) == 0x23000000 /* sc.d */
+ || (insn & 0xffff8000) == 0x38570000 /* sc.q */
+ || (insn & 0xfffffc00) == 0x38578400 /* screl.w */
+ || (insn & 0xfffffc00) == 0x38578c00) /* screl.d */
return true;
return false;
}