]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/xml-syscall.c
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / gdb / xml-syscall.c
index a09ccb99b2a8382bfb7e87c0756bdd66e2fa2e47..8cca875c740b38071731744341b6b52305c79750 100644 (file)
@@ -1,7 +1,7 @@
 /* Functions that provide the mechanism to parse a syscall XML file
    and get its values.
 
-   Copyright (C) 2009-2018 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);
     }
 }
@@ -316,7 +317,8 @@ static struct syscalls_info *
 xml_init_syscalls_info (const char *filename)
 {
   gdb::optional<gdb::char_vector> full_file
-    = xml_fetch_content_from_file (filename, gdb_datadir);
+    = xml_fetch_content_from_file (filename,
+                                  const_cast<char *>(gdb_datadir.c_str ()));
   if (!full_file)
     return NULL;
 
@@ -336,7 +338,7 @@ init_syscalls_info (struct gdbarch *gdbarch)
   /* Should we re-read the XML info for this target?  */
   if (syscalls_info != NULL && !syscalls_info->my_gdb_datadir.empty ()
       && filename_cmp (syscalls_info->my_gdb_datadir.c_str (),
-                      gdb_datadir) != 0)
+                      gdb_datadir.c_str ()) != 0)
     {
       /* The data-directory changed from the last time we used it.
         It means that we have to re-read the XML info.  */
@@ -361,7 +363,7 @@ init_syscalls_info (struct gdbarch *gdbarch)
     {
       if (xml_syscall_file != NULL)
        warning (_("Could not load the syscall XML file `%s/%s'."),
-                gdb_datadir, xml_syscall_file);
+                gdb_datadir.c_str (), xml_syscall_file);
       else
        warning (_("There is no XML file to open."));
 
@@ -472,7 +474,7 @@ xml_list_syscalls_by_group (struct gdbarch *gdbarch, const char *group,
   if (groupdesc == NULL)
     return false;
 
-  for (const struct syscall_desc *sysdesc : groupdesc->syscalls)
+  for (const syscall_desc *sysdesc : groupdesc->syscalls)
     syscalls->push_back (sysdesc->number);
 
   return true;