From: Xi Ruoyao Date: Tue, 19 Aug 2025 07:33:44 +0000 (+0800) Subject: gdb: LoongArch: Handle newly added llsc instructions X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;ds=inline;p=thirdparty%2Fbinutils-gdb.git 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 Signed-off-by: Tiezhu Yang --- diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index 3bf47d2c6d2..e497848bfce 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; }