Discussion:
[inferior events] another fix from trunk
Tom Tromey
2010-12-14 21:39:09 UTC
Permalink
Here's another fix from trunk.

gdb.selected_thread is defined to return None when there is no current
thread. On the branch it errors.

Ok to push?

Tom

diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index 64f0a21..3e76519 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -173,13 +173,6 @@ gdbpy_selected_thread (PyObject *self, PyObject *args)
{
PyObject *thread_obj;

- if (inferior_ptid.pid == 0)
- {
- PyErr_SetString (PyExc_RuntimeError,
- _("No thread is currently selected."));
- return NULL;
- }
-
thread_obj = (PyObject *) find_thread_object (inferior_ptid);
if (thread_obj)
{
sami wagiaalla
2010-12-15 15:51:59 UTC
Permalink
Post by Tom Tromey
Here's another fix from trunk.
gdb.selected_thread is defined to return None when there is no current
thread. On the branch it errors.
Does it do that though ? IIRC it just crash when there was no current
thread.
Post by Tom Tromey
Ok to push?
If no crash then yes.
Tom Tromey
2010-12-15 16:07:22 UTC
Permalink
Post by Tom Tromey
gdb.selected_thread is defined to return None when there is no current
thread. On the branch it errors.
Sami> Does it do that though ? IIRC it just crash when there was no current
Sami> thread.

Yeah, it does. find_thread_object returns NULL if there is no thread.

Tom

Loading...