This is the mail archive of the
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: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 05 Jun 2019 07:28:48 -0600
- Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output.
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
>>>>> "Philippe" == Philippe Waroquiers <firstname.lastname@example.org> writes:
>> Are there spots calling target_pid_to_str that do not want to call the
>> new function?
Philippe> We have different "spot kinds" calling target_pid_to_str.
Philippe> Some spots have a thread_info*, they get the ptid from this thread_info
Philippe> to call target_pid_to_str. These are trivial to convert.
Philippe> Some spots have just a ptid. Calling thread_target_id_str implies to
Philippe> convert the ptid to a thread_info*. This can return a null ptr, and so
Philippe> could lead to a problem.
Philippe> Maybe we could define a new function such as:
Philippe> target_pid_to_thr_id_str (ptid)
Philippe> that tries to convert ptid to a thread_info*.
Philippe> If it finds one, then it returns thread_target_id_str (th)
Philippe> otherwise it returns target_pid_to_str (ptid).
Philippe> This should be a relatively mechanical and not risky change, but we
Philippe> have about 200 calls to target_pid_to_str in various user messages
Philippe> and (mostly) debug info.
Philippe> What do you think ?
I think when I wrote that line, I hadn't yet appreciated that the patch
was just exposing a previously private function. So, while it may still
make sense to switch other calls to use it, I don't think it is a
requirement for this patch.