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

markus.t.metzger
2012-07-06T09:50:05Z

From: Markus Metzger <markus.t.metzger@intel.com>

When querying an inferior's threads in Python in a remote debugging
configuration, only the already known threads are returned.

Update the thread list in infpy_threads () before creating the Python objects.

Not sure this is the right place. We should probably update the thread list as
soon as we learn that the target stopped.

2012-07-06 Markus Metzger <markus.t.metzger@intel.com>

gdb/python/
* py-inferior.c (infpy_threads): Call update_thread_list ().

---
gdb/python/py-inferior.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 2b229be..ef28c33 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -303,6 +303,8 @@ infpy_threads (PyObject *self, PyObject *args)

INFPY_REQUIRE_VALID (inf_obj);

+ update_thread_list ();
+
tuple = PyTuple_New (inf_obj->nthreads);
if (!tuple)
return NULL;
--
1.7.1