1 1.1 christos /* Functions that provide the mechanism to parse a syscall XML file 2 1.1 christos and get its values. 3 1.1 christos 4 1.11 christos Copyright (C) 2009-2024 Free Software Foundation, Inc. 5 1.1 christos 6 1.1 christos This file is part of GDB. 7 1.1 christos 8 1.1 christos This program is free software; you can redistribute it and/or modify 9 1.1 christos it under the terms of the GNU General Public License as published by 10 1.1 christos the Free Software Foundation; either version 3 of the License, or 11 1.1 christos (at your option) any later version. 12 1.1 christos 13 1.1 christos This program is distributed in the hope that it will be useful, 14 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 15 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 1.1 christos GNU General Public License for more details. 17 1.1 christos 18 1.1 christos You should have received a copy of the GNU General Public License 19 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>. */ 20 1.1 christos 21 1.12 christos #ifndef GDB_XML_SYSCALL_H 22 1.12 christos #define GDB_XML_SYSCALL_H 23 1.1 christos 24 1.1 christos /* Function used to set the name of the file which contains 25 1.1 christos information about the system calls present in the current 26 1.1 christos architecture. 27 1.1 christos 28 1.1 christos This function *should* be called before anything else, otherwise 29 1.1 christos GDB won't be able to find the correct XML file to open and get 30 1.1 christos the syscalls definitions. */ 31 1.1 christos 32 1.3 christos void set_xml_syscall_file_name (struct gdbarch *gdbarch, 33 1.3 christos const char *name); 34 1.1 christos 35 1.1 christos /* Function that retrieves the syscall name corresponding to the given 36 1.1 christos number. It puts the requested information inside 'struct syscall'. */ 37 1.1 christos 38 1.3 christos void get_syscall_by_number (struct gdbarch *gdbarch, 39 1.3 christos int syscall_number, struct syscall *s); 40 1.1 christos 41 1.8 christos /* Function that retrieves the syscall numbers corresponding to the 42 1.8 christos given name. The numbers of all syscalls with either a name or 43 1.8 christos alias equal to SYSCALL_NAME are appended to SYSCALL_NUMBERS. If no 44 1.8 christos matching syscalls are found, return false. */ 45 1.1 christos 46 1.8 christos bool get_syscalls_by_name (struct gdbarch *gdbarch, const char *syscall_name, 47 1.8 christos std::vector<int> *syscall_numbers); 48 1.1 christos 49 1.1 christos /* Function used to retrieve the list of syscalls in the system. This list 50 1.1 christos is returned as an array of strings. Returns the list of syscalls in the 51 1.1 christos system, or NULL otherwise. */ 52 1.1 christos 53 1.3 christos const char **get_syscall_names (struct gdbarch *gdbarch); 54 1.1 christos 55 1.6 christos /* Function used to retrieve the list of syscalls of a given group in 56 1.8 christos the system. The syscall numbers are appended to SYSCALL_NUMBERS. 57 1.8 christos If the group doesn't exist, return false. */ 58 1.6 christos 59 1.8 christos bool get_syscalls_by_group (struct gdbarch *gdbarch, const char *group, 60 1.8 christos std::vector<int> *syscall_numbers); 61 1.6 christos 62 1.6 christos /* Function used to retrieve the list of syscall groups in the system. 63 1.6 christos Return an array of strings terminated by a NULL element. The list 64 1.6 christos must be freed by the caller. Return NULL if there is no syscall 65 1.6 christos information available. */ 66 1.6 christos 67 1.6 christos const char **get_syscall_group_names (struct gdbarch *gdbarch); 68 1.6 christos 69 1.12 christos #endif /* GDB_XML_SYSCALL_H */ 70