/* Ada Ravenscar thread support.
- Copyright (C) 2004-2019 Free Software Foundation, Inc.
+ Copyright (C) 2004-2020 Free Software Foundation, Inc.
This file is part of GDB.
is running, switching to its corresponding ptid, and then performing
the operation on that ptid using the target beneath us. */
-/* If non-null, ravenscar task support is enabled. */
-static int ravenscar_task_support = 1;
+/* If true, ravenscar task support is enabled. */
+static bool ravenscar_task_support = true;
static const char running_thread_name[] = "__gnat_running_thread_table";
const char *extra_thread_info (struct thread_info *) override;
- const char *pid_to_str (ptid_t) override;
+ std::string pid_to_str (ptid_t) override;
ptid_t get_ada_task_ptid (long lwp, long thread) override;
return true;
}
-const char *
+std::string
ravenscar_thread_target::pid_to_str (ptid_t ptid)
{
- static char buf[30];
-
- snprintf (buf, sizeof (buf), "Thread %#x", (int) ptid.tid ());
- return buf;
+ return string_printf ("Thread %#x", (int) ptid.tid ());
}
void
gdb::observers::inferior_created.attach (ravenscar_inferior_created);
add_prefix_cmd ("ravenscar", no_class, set_ravenscar_command,
- _("Prefix command for changing Ravenscar-specific settings"),
+ _("Prefix command for changing Ravenscar-specific settings."),
&set_ravenscar_list, "set ravenscar ", 0, &setlist);
add_prefix_cmd ("ravenscar", no_class, show_ravenscar_command,
- _("Prefix command for showing Ravenscar-specific settings"),
+ _("Prefix command for showing Ravenscar-specific settings."),
&show_ravenscar_list, "show ravenscar ", 0, &showlist);
add_setshow_boolean_cmd ("task-switching", class_obscure,
&ravenscar_task_support, _("\
-Enable or disable support for GNAT Ravenscar tasks"), _("\
-Show whether support for GNAT Ravenscar tasks is enabled"),
+Enable or disable support for GNAT Ravenscar tasks."), _("\
+Show whether support for GNAT Ravenscar tasks is enabled."),
_("\
Enable or disable support for task/thread switching with the GNAT\n\
Ravenscar run-time library for bareboard configuration."),