diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-26 09:49:03 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-26 09:49:03 -0500 |
commit | 73ede76585a987a07fbd67a7474b193e4ca05517 (patch) | |
tree | de94daac963b3cb4d15f84701db204ff6e42d69b /gdb/linux-nat.c | |
parent | 46a3515b49ce30315e2b621525b29cd8263aed15 (diff) | |
download | gdb-73ede76585a987a07fbd67a7474b193e4ca05517.zip gdb-73ede76585a987a07fbd67a7474b193e4ca05517.tar.gz gdb-73ede76585a987a07fbd67a7474b193e4ca05517.tar.bz2 |
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) <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.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 841ec39..2421687 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4097,7 +4097,7 @@ linux_nat_pid_to_str (struct target_ops *ops, ptid_t ptid) 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); |