summaryrefslogtreecommitdiff
path: root/gdb/python/py-infthread.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-12-02 11:12:49 -0800
committerDoug Evans <dje@google.com>2014-12-02 11:12:49 -0800
commit71dd4b30a741cf8a23e8a49f6a4294759f76be33 (patch)
tree0d3df55be8a1c69eb9e302648f9315cda3489788 /gdb/python/py-infthread.c
parentdc6c87175b672f00e72997c0ff9dcf984e305285 (diff)
downloadbinutils-gdb-71dd4b30a741cf8a23e8a49f6a4294759f76be33.tar.gz
revert previous patch so that I can re-commit with correct author
Diffstat (limited to 'gdb/python/py-infthread.c')
-rw-r--r--gdb/python/py-infthread.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index 67a187cf238..7fa2ca820b9 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -134,10 +134,23 @@ thpy_get_ptid (PyObject *self, void *closure)
int pid;
long tid, lwp;
thread_object *thread_obj = (thread_object *) self;
+ PyObject *ret;
THPY_REQUIRE_VALID (thread_obj);
- return gdbpy_create_ptid_object (thread_obj->thread->ptid);
+ ret = PyTuple_New (3);
+ if (!ret)
+ return NULL;
+
+ pid = ptid_get_pid (thread_obj->thread->ptid);
+ lwp = ptid_get_lwp (thread_obj->thread->ptid);
+ tid = ptid_get_tid (thread_obj->thread->ptid);
+
+ PyTuple_SET_ITEM (ret, 0, PyInt_FromLong (pid));
+ PyTuple_SET_ITEM (ret, 1, PyInt_FromLong (lwp));
+ PyTuple_SET_ITEM (ret, 2, PyInt_FromLong (tid));
+
+ return ret;
}
/* Implementation of InferiorThread.switch ().
@@ -223,30 +236,6 @@ thpy_is_valid (PyObject *self, PyObject *args)
Py_RETURN_TRUE;
}
-/* Return a reference to a new Python object representing a ptid_t.
- The object is a tuple containing (pid, lwp, tid). */
-PyObject *
-gdbpy_create_ptid_object (ptid_t ptid)
-{
- int pid;
- long tid, lwp;
- PyObject *ret;
-
- ret = PyTuple_New (3);
- if (!ret)
- return NULL;
-
- pid = ptid_get_pid (ptid);
- lwp = ptid_get_lwp (ptid);
- tid = ptid_get_tid (ptid);
-
- PyTuple_SET_ITEM (ret, 0, PyInt_FromLong (pid));
- PyTuple_SET_ITEM (ret, 1, PyInt_FromLong (lwp));
- PyTuple_SET_ITEM (ret, 2, PyInt_FromLong (tid));
-
- return ret;
-}
-
/* Implementation of gdb.selected_thread () -> gdb.InferiorThread.
Returns the selected thread object. */