RE: [PATCH 1/1] gdb, python: update threads in Inferior.threads ()

Metzger, Markus T
2012-07-19T15:27:29Z

[-- Attachment #1.1: Type: text/plain, Size: 1534 bytes --]

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

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 7228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 350 bytes --]

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer, Christian Lamprechter
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052