This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads ()
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: markus dot t dot metzger at intel dot com
- Cc: gdb-patches at sourceware dot org, markus dot t dot metzger at gmail dot com
- Date: Wed, 18 Jul 2012 15:54:13 +0200
- Subject: Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads ()
- References: <1341568171-27211-1-git-send-email-markus.t.metzger@intel.com>
On Fri, 06 Jul 2012 11:49:31 +0200, markus.t.metzger@intel.com wrote:
> Update the thread list in infpy_threads () before creating the Python objects.
It would be good to have a testcase for this issue.
> Not sure this is the right place. We should probably update the thread list as
> soon as we learn that the target stopped.
So far update_thread_list is called only before (in) the commands which really
need the thread list. The problem is that infpy_threads can be called from
a script repeatedly which may be pretty inefficient to call update_thread_list
each time.
The right would be to:
(1) Support update_thread_list per-inferior, not just for all inferiors at
once. For example infpy_threads is interested only in specific inferior.
(2) Cache the current thread list in struct inferior, clearing it from
begin of target_resume according to PTID (which depends for example on
'set schedule-multiple', see user_visible_resume_ptid), therefore either
the specific inferior only or all inferiors.
Still it is trying to push at you optimization out of the scope of this patch.
With a preferred testcase I find your patch OK. (Pedro knows better all this
infrun stuff.)
Thanks,
Jan