This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Give thread names in thread events, give Ada task names in more output.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]