]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/tdep] Handle memory error in s390_linux_get_syscall_number
authorTom de Vries <tdevries@suse.de>
Tue, 21 Nov 2023 12:57:19 +0000 (13:57 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 21 Nov 2023 12:57:19 +0000 (13:57 +0100)
commitd80aef339f6c7c30da28f79056725eedd64f84d7
tree07af9834a72ff597a205158f1b6995cb8aa46bad
parent42ffc15774fc791f2ac9a719e81589c8e91bdb98
[gdb/tdep] Handle memory error in s390_linux_get_syscall_number

In s390_linux_get_syscall_number, we use read_memory_unsigned_integer, which
can throw a memory error.

According to the function comment though, it should return -1 on error:
...
/* Retrieve the syscall number at a ptrace syscall-stop.  Return -1
   upon error. */
...

Catch the memory error by using safe_read_memory_unsigned_integer instead,
similar to how that was fixed for arm in commit eb42bb14895 ("[gdb/tdep] Fix
catching syscall execve exit for arm").

Approved-By: Ulrich Weigand <uweigand@de.ibm.com>
gdb/s390-linux-tdep.c