aboutsummaryrefslogtreecommitdiff
path: root/gdb/s390-linux-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2015-11-19 14:32:53 +0000
committerPedro Alves <palves@redhat.com>2015-11-19 14:32:53 +0000
commit4d1931791d0aca95ce82d5391f03b31613d9173b (patch)
tree94a29046e710d68ecdf04ba82967331cf83ee025 /gdb/s390-linux-tdep.c
parentf8708a14262c9abe0a6823de4470f5710374fe40 (diff)
downloadgdb-4d1931791d0aca95ce82d5391f03b31613d9173b.zip
gdb-4d1931791d0aca95ce82d5391f03b31613d9173b.tar.gz
gdb-4d1931791d0aca95ce82d5391f03b31613d9173b.tar.bz2
[C++] s390: Fix enum gdb_syscall conversion
Fixes: src/gdb/s390-linux-tdep.c: In function ‘gdb_syscall s390_canonicalize_syscall(int, s390_abi_kind)’: src/gdb/s390-linux-tdep.c:2622:16: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall; ^ src/gdb/s390-linux-tdep.c:2722:16: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall; ^ src/gdb/s390-linux-tdep.c:2725:24: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall + 2; ^ src/gdb/s390-linux-tdep.c:2728:24: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall + 5; ^ src/gdb/s390-linux-tdep.c:2731:24: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall + 6; ^ src/gdb/s390-linux-tdep.c:2734:24: error: invalid conversion from ‘int’ to ‘gdb_syscall’ [-fpermissive] return syscall + 7; ^ gdb/ChangeLog: 2015-11-19 Simon Marchi <simon.marchi@ericsson.com> Pedro Alves <palves@redhat.com> * s390-linux-tdep.c (s390_canonicalize_syscall): Add casts and intermediate 'int' variable.
Diffstat (limited to 'gdb/s390-linux-tdep.c')
-rw-r--r--gdb/s390-linux-tdep.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 3ce6336..0f8a3a8 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -2619,7 +2619,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
case 197: /* fstat64 */
case 221: /* fcntl64 */
if (abi == ABI_LINUX_S390)
- return syscall;
+ return (enum gdb_syscall) syscall;
return gdb_sys_no_syscall;
/* These syscalls don't exist on s390. */
case 17: /* break */
@@ -2717,22 +2717,29 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
return gdb_sys_newfstatat;
/* 313+ not yet supported */
default:
- /* Most "old" syscalls copied from i386. */
- if (syscall <= 221)
- return syscall;
- /* xattr syscalls. */
- if (syscall >= 224 && syscall <= 235)
- return syscall + 2;
- /* timer syscalls. */
- if (syscall >= 254 && syscall <= 262)
- return syscall + 5;
- /* mq_* and kexec_load */
- if (syscall >= 271 && syscall <= 277)
- return syscall + 6;
- /* ioprio_set .. epoll_pwait */
- if (syscall >= 282 && syscall <= 312)
- return syscall + 7;
- return gdb_sys_no_syscall;
+ {
+ int ret;
+
+ /* Most "old" syscalls copied from i386. */
+ if (syscall <= 221)
+ ret = syscall;
+ /* xattr syscalls. */
+ else if (syscall >= 224 && syscall <= 235)
+ ret = syscall + 2;
+ /* timer syscalls. */
+ else if (syscall >= 254 && syscall <= 262)
+ ret = syscall + 5;
+ /* mq_* and kexec_load */
+ else if (syscall >= 271 && syscall <= 277)
+ ret = syscall + 6;
+ /* ioprio_set .. epoll_pwait */
+ else if (syscall >= 282 && syscall <= 312)
+ ret = syscall + 7;
+ else
+ ret = gdb_sys_no_syscall;
+
+ return (enum gdb_syscall) ret;
+ }
}
}