Remove DW_ADDR
[deliverable/binutils-gdb.git] / gdb / xml-syscall.c
index dc988dfae8c131e2cf85c1d27c48ad4aa5bff388..effb37960eea825e38309a98bb386a7c5f83aac0 100644 (file)
@@ -1,7 +1,7 @@
 /* Functions that provide the mechanism to parse a syscall XML file
    and get its values.
 
-   Copyright (C) 2009-2019 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -221,9 +221,10 @@ syscall_create_syscall_desc (struct syscalls_info *syscalls_info,
   /*  Add syscall to its groups.  */
   if (groups != NULL)
     {
-      for (char *group = strtok (groups, ",");
+      char *saveptr;
+      for (char *group = strtok_r (groups, ",", &saveptr);
           group != NULL;
-          group = strtok (NULL, ","))
+          group = strtok_r (NULL, ",", &saveptr))
        syscall_group_add_syscall (syscalls_info, sysdesc, group);
     }
 }
@@ -286,8 +287,7 @@ static const struct gdb_xml_element syselements[] = {
 };
 
 static struct syscalls_info *
-syscall_parse_xml (const char *document, xml_fetch_another fetcher,
-                   void *fetcher_baton)
+syscall_parse_xml (const char *document, xml_fetch_another fetcher)
 {
   struct syscall_parsing_data data;
   syscalls_info_up sysinfo (new syscalls_info ());
@@ -321,9 +321,13 @@ xml_init_syscalls_info (const char *filename)
   if (!full_file)
     return NULL;
 
-  return syscall_parse_xml (full_file->data (),
-                           xml_fetch_content_from_file,
-                           (void *) ldirname (filename).c_str ());
+  const std::string dirname = ldirname (filename);
+  auto fetch_another = [&dirname] (const char *name)
+    {
+      return xml_fetch_content_from_file (name, dirname.c_str ());
+    };
+
+  return syscall_parse_xml (full_file->data (), fetch_another);
 }
 
 /* Initializes the syscalls_info structure according to the
This page took 0.023943 seconds and 4 git commands to generate.