]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/tdep] Fix mmap syscall mapping
authorTom de Vries <tdevries@suse.de>
Sun, 30 Mar 2025 14:45:25 +0000 (16:45 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 30 Mar 2025 14:45:25 +0000 (16:45 +0200)
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
gdb/amd64-linux-tdep.c
gdb/loongarch-linux-tdep.c

index 0b4ae7f604c6d881969f92e9f2822d2829655462..ec68ade441737427621226e314d7937fdf5cd21a 100644 (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);
index e290d2cab6dd054bd63cb5dc87dd587761fc3f71..69e2054cfb6973d493308c0711bff70783407d54 100644 (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:
index bd42d0990e89459929121958f1415e97e8afa8d9..949327ddf1f2b5c46260ef0f67494b7e56170a96 100644 (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);