/* 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-2019 Free Software Foundation, Inc.
This file is part of GDB.
/* 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);
}
}
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;
/* 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. */
{
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."));
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;