Révision | 4d1931791d0aca95ce82d5391f03b31613d9173b (tree) |
---|---|
l'heure | 2015-11-19 23:32:53 |
Auteur | Simon Marchi <simon.marchi@eric...> |
Commiter | Pedro Alves |
[C++] s390: Fix enum gdb_syscall conversion
Fixes:
return syscall;
return syscall;
return syscall + 2;
return syscall + 5;
return syscall + 6;
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.
@@ -1,3 +1,9 @@ | ||
1 | +2015-11-19 Simon Marchi <simon.marchi@ericsson.com> | |
2 | + Pedro Alves <palves@redhat.com> | |
3 | + | |
4 | + * s390-linux-tdep.c (s390_canonicalize_syscall): Add casts and | |
5 | + intermediate 'int' variable. | |
6 | + | |
1 | 7 | 2015-11-19 Pedro Alves <palves@redhat.com> |
2 | 8 | |
3 | 9 | * linux-thread-db.c (try_thread_db_load_1): Add cast. |
@@ -2619,7 +2619,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi) | ||
2619 | 2619 | case 197: /* fstat64 */ |
2620 | 2620 | case 221: /* fcntl64 */ |
2621 | 2621 | if (abi == ABI_LINUX_S390) |
2622 | - return syscall; | |
2622 | + return (enum gdb_syscall) syscall; | |
2623 | 2623 | return gdb_sys_no_syscall; |
2624 | 2624 | /* These syscalls don't exist on s390. */ |
2625 | 2625 | case 17: /* break */ |
@@ -2717,22 +2717,29 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi) | ||
2717 | 2717 | return gdb_sys_newfstatat; |
2718 | 2718 | /* 313+ not yet supported */ |
2719 | 2719 | default: |
2720 | - /* Most "old" syscalls copied from i386. */ | |
2721 | - if (syscall <= 221) | |
2722 | - return syscall; | |
2723 | - /* xattr syscalls. */ | |
2724 | - if (syscall >= 224 && syscall <= 235) | |
2725 | - return syscall + 2; | |
2726 | - /* timer syscalls. */ | |
2727 | - if (syscall >= 254 && syscall <= 262) | |
2728 | - return syscall + 5; | |
2729 | - /* mq_* and kexec_load */ | |
2730 | - if (syscall >= 271 && syscall <= 277) | |
2731 | - return syscall + 6; | |
2732 | - /* ioprio_set .. epoll_pwait */ | |
2733 | - if (syscall >= 282 && syscall <= 312) | |
2734 | - return syscall + 7; | |
2735 | - return gdb_sys_no_syscall; | |
2720 | + { | |
2721 | + int ret; | |
2722 | + | |
2723 | + /* Most "old" syscalls copied from i386. */ | |
2724 | + if (syscall <= 221) | |
2725 | + ret = syscall; | |
2726 | + /* xattr syscalls. */ | |
2727 | + else if (syscall >= 224 && syscall <= 235) | |
2728 | + ret = syscall + 2; | |
2729 | + /* timer syscalls. */ | |
2730 | + else if (syscall >= 254 && syscall <= 262) | |
2731 | + ret = syscall + 5; | |
2732 | + /* mq_* and kexec_load */ | |
2733 | + else if (syscall >= 271 && syscall <= 277) | |
2734 | + ret = syscall + 6; | |
2735 | + /* ioprio_set .. epoll_pwait */ | |
2736 | + else if (syscall >= 282 && syscall <= 312) | |
2737 | + ret = syscall + 7; | |
2738 | + else | |
2739 | + ret = gdb_sys_no_syscall; | |
2740 | + | |
2741 | + return (enum gdb_syscall) ret; | |
2742 | + } | |
2736 | 2743 | } |
2737 | 2744 | } |
2738 | 2745 |