This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Give thread names in thread events, give Ada task names in more output.
- From: Tom Tromey <tom at tromey dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 03 Jun 2019 14:02:17 -0600
- Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output.
- References: <20190518182306.22937-1-philippe.waroquiers@skynet.be>
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> With this patch, we e.g. get:
Philippe> [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
Philippe> [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")]
Philippe> instead of:
Philippe> [New Thread 0x7ffff701b700 (LWP 13918)]
Philippe> [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]
Thanks. I'm mildly surprised this works at thread-announce time, since
I thought the thread had to be created before it could be given a name.
Maybe it is racy? (FWIW it is fine if it is.) Or maybe I'm mistaken
and there's a way to name a thread before pthread_create.
Philippe> +/* Return the string to display e.g. in "info threads"'s "Target Id"
Philippe> + column, for TP. */
Philippe> +
Philippe> +std::string
Philippe> +thread_target_id_str (thread_info *tp);
This should be "extern std::string thread_target_id_str (...);".
However, could this just be a method on thread_info? I think that would
be preferable. I think it's not much more work.
Philippe> - target_pid_to_str (lp->ptid).c_str ());
Philippe> + thread_target_id_str (th).c_str ());
Are there spots calling target_pid_to_str that do not want to call the
new function?
thanks,
Tom