From 6f3dab758fbcb7814ddfe09fb8224a38f45eb35c Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sun, 30 Mar 2025 16:45:25 +0200 Subject: [gdb/tdep] Fix mmap syscall mapping There are a few spots where an mmap system call is mapped onto enum gdb_syscall value gdb_sys_mmap2. Strictly speaking, this is incorrect. Fix this by mapping to enum gdb_syscall value gdb_old_mmap instead. No functional changes: both gdb_old_mmap and gdb_sys_mmap2 are handled the same in record_linux_system_call. Tested by rebuilding on x86_64-linux. --- gdb/aarch64-linux-tdep.c | 2 +- gdb/amd64-linux-tdep.c | 2 +- gdb/loongarch-linux-tdep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 0b4ae7f..ec68ade 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -2275,7 +2275,7 @@ aarch64_canonicalize_syscall (enum aarch64_syscall syscall_number) SYSCALL_MAP (clone); SYSCALL_MAP (execve); - SYSCALL_MAP_RENAME (mmap, gdb_sys_mmap2); + SYSCALL_MAP_RENAME (mmap, gdb_old_mmap); SYSCALL_MAP (fadvise64); SYSCALL_MAP (swapon); diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index e290d2c..69e2054 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -412,7 +412,7 @@ amd64_canonicalize_syscall (enum amd64_syscall syscall_number) case amd64_sys_mmap: case amd64_x32_sys_mmap: - return gdb_sys_mmap2; + return gdb_old_mmap; case amd64_sys_mprotect: case amd64_x32_sys_mprotect: diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c index bd42d09..949327d 100644 --- a/gdb/loongarch-linux-tdep.c +++ b/gdb/loongarch-linux-tdep.c @@ -812,7 +812,7 @@ loongarch_canonicalize_syscall (enum loongarch_syscall syscall_number) SYSCALL_MAP (clone); SYSCALL_MAP (execve); - SYSCALL_MAP_RENAME (mmap, gdb_sys_mmap2); + SYSCALL_MAP_RENAME (mmap, gdb_old_mmap); SYSCALL_MAP (fadvise64); SYSCALL_MAP (swapon); -- cgit v1.1