> -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Wednesday, July 18, 2012 3:54 PM Thanks for your review! > > Update the thread list in infpy_threads () before creating the Python objects. > > It would be good to have a testcase for this issue. I added a test. > > 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. So it is the right place - just not a good one. Those scripts will now do "info threads" to achieve the same effect. > 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. Shouldn't this rather be an event? > 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.) CC'ing Pedro. Regards, Markus.