+ struct syscalls_info *syscalls_info = gdbarch_syscalls_info (gdbarch);
+
+ if (syscalls_info == NULL)
+ return NULL;
+
+ int nsyscalls = syscalls_info->syscalls.size ();
+ const char **names = XNEWVEC (const char *, nsyscalls + 1);
+
+ int i;
+ for (i = 0; i < syscalls_info->syscalls.size (); i++)
+ names[i] = syscalls_info->syscalls[i]->name.c_str ();
+
+ names[i] = NULL;
+
+ return names;
+}
+
+/* Iterate over the syscall_group_desc element to return a list of
+ syscalls that are part of the given group. If the syscall group
+ doesn't exist, return false. */
+
+static bool
+xml_list_syscalls_by_group (struct gdbarch *gdbarch, const char *group,
+ std::vector<int> *syscalls)
+{
+ struct syscalls_info *syscalls_info = gdbarch_syscalls_info (gdbarch);
+ struct syscall_group_desc *groupdesc;
+
+ if (syscalls_info == NULL || syscalls == NULL)
+ return false;
+
+ groupdesc = syscall_group_get_group_by_name (syscalls_info, group);
+ if (groupdesc == NULL)
+ return false;
+
+ for (const syscall_desc *sysdesc : groupdesc->syscalls)
+ syscalls->push_back (sysdesc->number);
+
+ return true;
+}
+
+/* Return a NULL terminated list of syscall groups or an empty list, if
+ no syscall group is available. Return NULL, if there is no syscall
+ information available. */
+
+static const char **
+xml_list_of_groups (struct gdbarch *gdbarch)
+{
+ struct syscalls_info *syscalls_info = gdbarch_syscalls_info (gdbarch);