diff options
author | Pedro Alves <palves@redhat.com> | 2017-04-05 19:21:34 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-04-05 19:21:34 +0100 |
commit | 7a1149643d8621541025e2c70e6391e901c8c7ef (patch) | |
tree | 0e9b2b60dcb66d50bc41dec2201a1223693bd42c /gdb/ravenscar-thread.c | |
parent | 69bbf465237819bd7bf2a21a682d695273b3c8cb (diff) | |
download | gdb-7a1149643d8621541025e2c70e6391e901c8c7ef.zip gdb-7a1149643d8621541025e2c70e6391e901c8c7ef.tar.gz gdb-7a1149643d8621541025e2c70e6391e901c8c7ef.tar.bz2 |
-Wwrite-strings: Constify target_pid_to_str and target_thread_extra_thread_info
-Wwrite-strings flagged a missing cast for example here:
static char *
ravenscar_extra_thread_info (struct target_ops *self, struct thread_info *tp)
{
return "Ravenscar task";
Since callers are not supposed to free the string returned by these
methods, change the methods' signature to return const strings.
gdb/ChangeLog:
2017-04-05 Pedro Alves <palves@redhat.com>
* aix-thread.c (aix_thread_pid_to_str)
(aix_thread_extra_thread_info): Constify.
* bsd-kvm.c (bsd_kvm_pid_to_str): Constify.
* bsd-uthread.c (bsd_uthread_extra_thread_info)
(bsd_uthread_pid_to_str): Constify.
* corelow.c (core_pid_to_str): Constify.
* darwin-nat.c (darwin_pid_to_str): Constify.
* fbsd-nat.c (fbsd_pid_to_str): Constify.
* fbsd-tdep.c (fbsd_core_pid_to_str, gdbarch_core_pid_to_str):
Constify.
* gnu-nat.c (gnu_pid_to_str): Constify.
* go32-nat.c (go32_pid_to_str): Constify.
* i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Constify.
* inf-ptrace.c (inf_ptrace_pid_to_str): Constify.
* inferior.c (inferior_pid_to_str): Constify.
* linux-nat.c (linux_nat_pid_to_str): Constify.
* linux-tdep.c (linux_core_pid_to_str): Constify.
* linux-thread-db.c (thread_db_pid_to_str)
(thread_db_extra_thread_info): Constify.
* nto-tdep.c (nto_extra_thread_info): Constify.
* nto-tdep.h (nto_extra_thread_info): Constify.
* obsd-nat.c (obsd_pid_to_str): Constify.
* procfs.c (procfs_pid_to_str): Constify.
* ravenscar-thread.c (ravenscar_extra_thread_info)
(ravenscar_pid_to_str): Constify.
* remote-sim.c (gdbsim_pid_to_str): Constify.
* remote.c (remote_threads_extra_info, remote_pid_to_str):
Constify.
* sol-thread.c (solaris_pid_to_str): Constify.
* sol2-tdep.c (sol2_core_pid_to_str): Constify.
* sol2-tdep.h (sol2_core_pid_to_str): Constify.
* target.c (default_pid_to_str, target_pid_to_str)
(normal_pid_to_str, default_pid_to_str): Constify.
* target.h (target_ops::to_pid_to_str)
(target_ops::to_extra_thread_info): Constify.
(target_pid_to_str, normal_pid_to_str): Constify.
* windows-nat.c (windows_pid_to_str): Constify.
* gdbarch.sh (core_pid_to_str): Constify.
* target-delegates.c: Regenerate.
* gdbarch.h, gdbarch.c: Regenerate.
Diffstat (limited to 'gdb/ravenscar-thread.c')
-rw-r--r-- | gdb/ravenscar-thread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index d1bd97f..1f89ea2 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -54,8 +54,8 @@ static const char ravenscar_runtime_initializer[] = static void ravenscar_update_thread_list (struct target_ops *ops); static ptid_t ravenscar_running_thread (void); -static char *ravenscar_extra_thread_info (struct target_ops *self, - struct thread_info *tp); +static const char *ravenscar_extra_thread_info (struct target_ops *self, + struct thread_info *tp); static int ravenscar_thread_alive (struct target_ops *ops, ptid_t ptid); static void ravenscar_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum); @@ -241,7 +241,7 @@ ravenscar_running_thread (void) return ptid_build (ptid_get_pid (base_ptid), 0, tid); } -static char * +static const char * ravenscar_extra_thread_info (struct target_ops *self, struct thread_info *tp) { return "Ravenscar task"; @@ -254,7 +254,7 @@ ravenscar_thread_alive (struct target_ops *ops, ptid_t ptid) return 1; } -static char * +static const char * ravenscar_pid_to_str (struct target_ops *ops, ptid_t ptid) { static char buf[30]; |