From 73ede76585a987a07fbd67a7474b193e4ca05517 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 26 Nov 2015 09:49:03 -0500 Subject: Constify thread name return path Since this code path returns a string owned by the target (we don't know how it's allocated, could be a static read-only string), it's safer if we return a constant string. If, for some reasons, the caller wishes to modify the string, it should make itself a copy. gdb/ChangeLog: * linux-nat.c (linux_nat_thread_name): Constify return value. * target.h (struct target_ops) : 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. --- gdb/python/py-infthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/python') diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c index 4d0a020..e5db354 100644 --- a/gdb/python/py-infthread.c +++ b/gdb/python/py-infthread.c @@ -62,7 +62,7 @@ static PyObject * thpy_get_name (PyObject *self, void *ignore) { thread_object *thread_obj = (thread_object *) self; - char *name; + const char *name; THPY_REQUIRE_VALID (thread_obj); -- cgit v1.1