[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.
This commit is contained in:
Tom de Vries
2025-03-30 16:45:25 +02:00
parent 79580fac6f
commit 6f3dab758f
3 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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:

View File

@@ -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);