aboutsummaryrefslogtreecommitdiff
path: root/gdb/xml-syscall.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-12-13 11:36:42 -0800
committerJohn Baldwin <jhb@FreeBSD.org>2018-12-13 11:36:42 -0800
commite9076973c822e6df7f84bb8bc0b69aa42dd29eb3 (patch)
treebaf95c12260c844b6cc692d4259af2e749695b60 /gdb/xml-syscall.h
parent4794efbfdc4b1497c1f47397b2a2c43382e3de78 (diff)
downloadgdb-e9076973c822e6df7f84bb8bc0b69aa42dd29eb3.zip
gdb-e9076973c822e6df7f84bb8bc0b69aa42dd29eb3.tar.gz
gdb-e9076973c822e6df7f84bb8bc0b69aa42dd29eb3.tar.bz2
Add an optional "alias" attribute to syscall entries.
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: * NEWS: Add entry documenting system call aliases. * break-catch-syscall.c (catch_syscall_split_args): Pass 'result' to get_syscalls_by_name. * 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 accepts a pointer to a vector of integers and returns a bool. [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 accepts a pointer to a vector of integers and returns a bool. Add syscalls whose alias or name matches the requested name. (get_syscalls_by_name): Rename from get_syscall_by_name. Now accepts a pointer to a vector of integers and returns a bool. * xml-syscall.h (get_syscalls_by_name): Likewise. gdb/doc/ChangeLog: * gdb.texinfo (Set Catchpoints): Add an anchor for 'catch syscall'. (Native): Add a FreeBSD subsection. (FreeBSD): Document use of system call aliases for compatibility system calls.
Diffstat (limited to 'gdb/xml-syscall.h')
-rw-r--r--gdb/xml-syscall.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/xml-syscall.h b/gdb/xml-syscall.h
index 012a4b7..31a13e2 100644
--- a/gdb/xml-syscall.h
+++ b/gdb/xml-syscall.h
@@ -38,11 +38,13 @@ void set_xml_syscall_file_name (struct gdbarch *gdbarch,
void get_syscall_by_number (struct gdbarch *gdbarch,
int syscall_number, struct syscall *s);
-/* Function that retrieves the syscall number corresponding to the given
- name. It puts the requested information inside 'struct syscall'. */
+/* Function that retrieves the syscall numbers corresponding to the
+ given name. The numbers of all syscalls with either a name or
+ alias equal to SYSCALL_NAME are appended to SYSCALL_NUMBERS. If no
+ matching syscalls are found, return false. */
-void get_syscall_by_name (struct gdbarch *gdbarch,
- const char *syscall_name, struct syscall *s);
+bool get_syscalls_by_name (struct gdbarch *gdbarch, const char *syscall_name,
+ std::vector<int> *syscall_numbers);
/* Function used to retrieve the list of syscalls in the system. This list
is returned as an array of strings. Returns the list of syscalls in the