This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/3] Add an optional "alias" attribute to syscall entries.
On Tue, 6 Nov 2018 09:54:30 -0800
John Baldwin <jhb@FreeBSD.org> wrote:
> When setting a syscall catchpoint by name, catch syscalls whose name
> or alias matches the requested string.
>
> When the ABI of a system call is changed in the FreeBSD kernel, this
> is implemented by leaving a compatibility system call using the old
> ABI at the existing "slot" and allocating a new system call for the
> version using the new ABI. For example, new fields were added to the
> 'struct kevent' used by the kevent() system call in FreeBSD 12. The
> previous kevent() system call in FreeBSD 12 kernels is now called
> freebsd11_kevent() and is still used by older binaries compiled
> against the older ABI. The freebsd11_kevent() system call can be
> tagged with an "alias" attribute of "kevent" permitting 'catch syscall
> kevent' to catch both system calls and providing the expected user
> behavior for both old and new binaries. It also provides the expected
> behavior if GDB is compiled on an older host (such as a FreeBSD 11
> host).
>
> gdb/ChangeLog:
>
> * break-catch-syscall.c (catch_syscall_split_args): Update for
> get_syscalls_by_name returning a vector.
> * gdbarch.sh (UNKNOWN_SYSCALL): Remove.
> * gdbarch.h: Regenerate.
> * syscalls/gdb-syscalls.dtd (syscall): Add alias attribute.
> * xml-syscall.c [!HAVE_LIBEXPAT] (get_syscalls_by_name): Rename
> from get_syscall_by_name. Now returns a vector of integers.
> [HAVE_LIBEXPAT] (struct syscall_desc): Add alias member.
> (syscall_create_syscall_desc): Add alias parameter and pass it to
> syscall_desc constructor.
> (syscall_start_syscall): Handle alias attribute.
> (syscall_attr): Add alias attribute.
> (xml_get_syscalls_by_name): Rename from xml_get_syscall_number.
> Now returns a vector of integers. Add syscalls whose alias or
> name matches the requested name.
> (get_syscalls_by_name): Rename from get_syscall_by_name. Now
> returns a vector of integers.
> * xml-syscall.h (get_syscalls_by_name): Likewise.
Okay.
Kevin