From: Carl Love Date: Wed, 13 Oct 2021 20:28:48 +0000 (+0000) Subject: Powerpc: Add support for openat and fstatat syscalls X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38c90362460000bac2efdbf06250821429777bb0;p=binutils-gdb.git Powerpc: Add support for openat and fstatat syscalls [gdb] update ppc-linux-tdep.c Add argument to ppc_canonicalize_syscall for the wordsize. Add syscall entries for the openat and fstatat system calls. --- diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index ea8e3b98fa4..e2e1b1ec1d4 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1371,7 +1371,7 @@ static struct linux_record_tdep ppc64_linux_record_tdep; SYSCALL. */ static enum gdb_syscall -ppc_canonicalize_syscall (int syscall) +ppc_canonicalize_syscall (int syscall, int wordsize) { int result = -1; @@ -1391,6 +1391,15 @@ ppc_canonicalize_syscall (int syscall) result = syscall += 259 - 240; else if (syscall >= 250 && syscall <= 251) /* tgkill */ result = syscall + 270 - 250; + else if (syscall == 286) + result = gdb_sys_openat; + else if (syscall == 291) + { + if (wordsize == 64) + result = gdb_sys_newfstatat; + else + result = gdb_sys_fstatat64; + } else if (syscall == 336) result = gdb_sys_recv; else if (syscall == 337) @@ -1414,7 +1423,7 @@ ppc_linux_syscall_record (struct regcache *regcache) int ret; regcache_raw_read_unsigned (regcache, tdep->ppc_gp0_regnum, &scnum); - syscall_gdb = ppc_canonicalize_syscall (scnum); + syscall_gdb = ppc_canonicalize_syscall (scnum, tdep->wordsize); if (syscall_gdb < 0) {