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

Metzger, Markus T markus.t.metzger@intel.com
Tue Jul 24 08:08:00 GMT 2012


> > From: Jan Kratochvil <jan.kratochvil@redhat.com>
> > Subject: Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads ()
> > Date: July 19, 2012 8:40:50 PM GMT+02:00

Thanks for your review!

> > On Thu, 19 Jul 2012 17:29:17 +0200, markus.t.metzger@intel.com wrote:
> >> gdb/python/
> >> 	* py-inferior.c (infpy_threads): Call update_thread_list ().
> >>
> >> gdb/testsuite/gdb.python/
> >> 	* py-threads.c: New file.
> >> 	* py-threads.exp: New file.
> >
> > OK with the issue below but please check it in only after several days, there
> > is questionable the caching of threads list.

I don't have write access. Regarding the caching question, this is being discussed here:
http://sourceware.org/ml/gdb-patches/2012-07/msg00382.html.


> >> +static void *
> >> +thread (void *param)
> >> +{
> >> +  for (;;)
> >> +    ;
> >
> > (1) Never create needlessly busy-looping testcases.
> >    Therefore use sleep().
> >
> > (2) Never create testcases which run forever, always use some reasonable
> >    timeout (such as 60 seconds).

I now use a barrier to synchronize threads. This should satisfy both requirements.


> >> +  return param;
> >> +}
> > [...]
> >> +gdb_test "python print len(gdb.selected_inferior().threads())" "9" "py-threads"
> >
> > Nitpick but better "\r\n9" as otherwise any number x%10==9 would match.

Done. Thanks.

Regards,
Markus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7228 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120724/e8cbed4d/attachment.p7s>
-------------- next part --------------
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


More information about the Gdb-patches mailing list