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, palves at redhat dot com, tromey at redhat dot com
- Date: Thu, 19 Jul 2012 20:40:50 +0200
- Subject: Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads ()
- References: <1342711757-7243-1-git-send-email-markus.t.metzger@intel.com>
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.
> +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).
> + 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.
Thanks,
Jan