This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]