aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-linux-tdep.h
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-03-13 07:41:51 +0100
committerTom de Vries <tdevries@suse.de>2025-03-13 07:41:51 +0100
commitf9f033220046f011aeb259469cb15fe8141b213b (patch)
tree51e36d8d84e5088d57253697afb6375cb1d3d6c9 /gdb/amd64-linux-tdep.h
parentfbfb29b304ef7d3270a918b5fc60c22b0909367e (diff)
downloadbinutils-f9f033220046f011aeb259469cb15fe8141b213b.zip
binutils-f9f033220046f011aeb259469cb15fe8141b213b.tar.gz
binutils-f9f033220046f011aeb259469cb15fe8141b213b.tar.bz2
[gdb/record] Support recording syscall accept4
While reviewing the enum gdb_syscall entries with values >= 500, I noticed that gdb_sys_accept exists, but gdb_sys_accept4 doesn't, while recording support is essentially the same, given that the difference in interface is only an extra int parameter: ... int accept (int sockfd, struct sockaddr *addr, socklen_t *addrlen); int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags); ... Fix this by: - adding gdb_sys_accept4, - supporting it in record_linux_system_call alongside gdb_sys_accept, and - mapping to gdb_sys_accept4 in various syscall canonicalization functions. The usual thing to do before the rewrite of i386_canonicalize_syscall would have been to use the value from arch/x86/entry/syscalls/syscall_32.tbl: ... gdb_sys_accept4 = 364, ... but that's no longer necessary, so instead we use some >= 500 value: ... gdb_sys_accept4 = 533, ... to steer clear of the space where ppc_canonicalize_syscall and s390_canonicalize_syscall do hard-coded number magic. Tested on x86_64-linux, with and without target board unix/-m32, and aarch64-linux. Approved-By: Guinevere Larsen <guinevere@redhat.com>
Diffstat (limited to 'gdb/amd64-linux-tdep.h')
-rw-r--r--gdb/amd64-linux-tdep.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h
index 935e9b6..4bcd423 100644
--- a/gdb/amd64-linux-tdep.h
+++ b/gdb/amd64-linux-tdep.h
@@ -302,6 +302,7 @@ enum amd64_syscall {
amd64_sys_sync_file_range = 277,
amd64_sys_vmsplice = 278,
amd64_sys_move_pages = 279,
+ amd64_sys_accept4 = 288,
amd64_sys_pipe2 = 293,
amd64_sys_getrandom = 318
};
@@ -553,6 +554,7 @@ enum amd64_x32_syscall {
amd64_x32_sys_splice = (amd64_x32_syscall_bit + 275),
amd64_x32_sys_tee = (amd64_x32_syscall_bit + 276),
amd64_x32_sys_sync_file_range = (amd64_x32_syscall_bit + 277),
+ amd64_x32_sys_accept4 = (amd64_x32_syscall_bit + 288),
amd64_x32_sys_rt_sigaction = (amd64_x32_syscall_bit + 512),
amd64_x32_sys_rt_sigreturn = (amd64_x32_syscall_bit + 513),
amd64_x32_sys_ioctl = (amd64_x32_syscall_bit + 514),