]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: update corner case when canonicalizing riscv syscall names
authorGuinevere Larsen <guinevere@redhat.com>
Wed, 23 Apr 2025 14:26:51 +0000 (11:26 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Thu, 24 Apr 2025 18:48:29 +0000 (15:48 -0300)
The script syscalls/riscv-canonicalize-syscall-gen.py has been recently
introduced to help support record-full in riscv systems.  However, it
was developed before commit 432eca4113d5748ad284a068873455f9962b44fe,
which made the GDB enum more consistent, which forced the python script
to have a corner case for the "gdb_old_mmap" case.

Since the aforementioned commit has already been merged, we need to
update the special case for the mmap syscall. A special case is still
needed because the script would expect that the glibc sources call the
syscall "old_mmap", or that gdb call it "gdb_sys_mmap", neither of which
happens unfortunately.

This commit doesn't change the .c file because it was already fixed by a
different commit, 65ab41b7d5c612b6000b28f4c50bb256b2a9e22b, which was
pushed as obvious to fix the build issues.

Tested-By: Luis Machado <luis.machado@arm.com>
Approved-By: Luis Machado <luis.machado@arm.com>
gdb/syscalls/riscv-canonicalize-syscall-gen.py

index c7dda93d0cdd8adc1db58a05fe2d7c74fed6ea19..40039bb0f1546ca313e41bd0a6a976954e47d2db 100755 (executable)
@@ -111,7 +111,7 @@ class Generator:
                         canon_syscalls[syscall_num] = value
                     # this is a place for corner cases
                     elif syscall_name == "mmap":
-                        gdb_old_syscall_name = "gdb_old_mmap"
+                        gdb_old_syscall_name = "gdb_sys_old_mmap"
                         value = (
                             f"    case {syscall_num}: return {gdb_old_syscall_name};\n"
                         )