]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/record] Fix syscall recording some more
authorTom de Vries <tdevries@suse.de>
Tue, 3 Mar 2026 08:19:43 +0000 (09:19 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 3 Mar 2026 08:19:43 +0000 (09:19 +0100)
I ran into the same gdb.reverse/sigall-reverse.exp failure on ppc64le-linux,
as fixed in commits:
- commit 3686645cec9 ("[gdb/record] Fix return value for svc in
  aarch64_record_branch_except_sys"), and
- commit 4ef576bdb7f ("[gdb/record] Fix return value for syscall in
  loongarch_record_syscall_insn").

The difference with those commits is that the problem is not due to confusion
about a port-local enums (aarch64_record_result, loongarch_record_result).

Instead, the port just treats return values 1 and -1 the same:
...
  if (tdep->ppc_syscall_record (regcache) != 0)
    return -1;
...

Fix this by passing through the return value 1 instead.

Likewise on s390x-linux.

Tested on ppc64le-linux and s390x-linux.

Reviewed-by: Abhay Kandpal <abhay@linux.ibm.com>
gdb/rs6000-tdep.c
gdb/s390-tdep.c

index 8aa155e1f364b761a79b9c569920f2bd2c3e99cf..7d0902941a03cc5bbcf9f7c16ce3f06ff344e9a9 100644 (file)
@@ -7187,8 +7187,9 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
 
       if (tdep->ppc_syscall_record != NULL)
        {
-         if (tdep->ppc_syscall_record (regcache) != 0)
-           return -1;
+         int res = tdep->ppc_syscall_record (regcache);
+         if (res != 0)
+           return res;
        }
       else
        {
index 6cf5acbc542492161c17f39fc36539d6e7b52eb8..f52e898047b72128ee200fac41081e8d756e07cf 100644 (file)
@@ -3242,8 +3242,9 @@ ex:
       /* SVC - supervisor call */
       if (tdep->s390_syscall_record != NULL)
        {
-         if (tdep->s390_syscall_record (regcache, ibyte[1]))
-           return -1;
+         int res = tdep->s390_syscall_record (regcache, ibyte[1]);
+         if (res != 0)
+           return res;
        }
       else
        {