xml-syscall.h 2.7 KB

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