+2015-11-26 Simon Marchi <simon.marchi@ericsson.com>
+
+ * linux-nat.c (linux_nat_thread_name): Constify return value.
+ * target.h (struct target_ops) <to_thread_name>: Likewise.
+ (target_thread_name): Likewise.
+ * target.c (target_thread_name): Likewise.
+ * target-delegates.c (debug_thread_name): Regenerate.
+ * python/py-infthread.c (thpy_get_name): Constify local variables.
+ * thread.c (print_thread_info): Likewise.
+ (thread_find_command): Likewise.
+
2015-11-26 Markus Metzger <markus.t.metzger@intel.com>
PR 19297
return normal_pid_to_str (ptid);
}
-static char *
+static const char *
linux_nat_thread_name (struct target_ops *self, struct thread_info *thr)
{
int pid = ptid_get_pid (thr->ptid);
thpy_get_name (PyObject *self, void *ignore)
{
thread_object *thread_obj = (thread_object *) self;
- char *name;
+ const char *name;
THPY_REQUIRE_VALID (thread_obj);
return result;
}
-static char *
+static const char *
delegate_thread_name (struct target_ops *self, struct thread_info *arg1)
{
self = self->beneath;
return self->to_thread_name (self, arg1);
}
-static char *
+static const char *
tdefault_thread_name (struct target_ops *self, struct thread_info *arg1)
{
return NULL;
}
-static char *
+static const char *
debug_thread_name (struct target_ops *self, struct thread_info *arg1)
{
- char * result;
+ const char * result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_thread_name (...)\n", debug_target.to_shortname);
result = debug_target.to_thread_name (&debug_target, arg1);
fprintf_unfiltered (gdb_stdlog, "<- %s->to_thread_name (", debug_target.to_shortname);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_struct_thread_info_p (arg1);
fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_char_p (result);
+ target_debug_print_const_char_p (result);
fputs_unfiltered ("\n", gdb_stdlog);
return result;
}
return (*current_target.to_pid_to_str) (¤t_target, ptid);
}
-char *
+const char *
target_thread_name (struct thread_info *info)
{
return current_target.to_thread_name (¤t_target, info);
TARGET_DEFAULT_FUNC (default_pid_to_str);
char *(*to_extra_thread_info) (struct target_ops *, struct thread_info *)
TARGET_DEFAULT_RETURN (NULL);
- char *(*to_thread_name) (struct target_ops *, struct thread_info *)
+ const char *(*to_thread_name) (struct target_ops *, struct thread_info *)
TARGET_DEFAULT_RETURN (NULL);
void (*to_stop) (struct target_ops *, ptid_t)
TARGET_DEFAULT_IGNORE ();
/* Return the thread's name. A NULL result means that the target
could not determine this thread's name. */
-extern char *target_thread_name (struct thread_info *);
+extern const char *target_thread_name (struct thread_info *);
/* Attempts to find the pathname of the executable file
that was run to create a specified process.
struct thread_info *tp;
ptid_t current_ptid;
struct cleanup *old_chain;
- char *extra_info, *name, *target_id;
+ const char *extra_info, *name, *target_id;
int current_thread = -1;
update_thread_list ();
thread_find_command (char *arg, int from_tty)
{
struct thread_info *tp;
- char *tmp;
+ const char *tmp;
unsigned long match = 0;
if (arg == NULL || *arg == '\0')