Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: gdb/python/py-infthread.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/python/py-inferior.c ('k') | gdb/python/py-lazy-string.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/python/py-infthread.c
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index 8821f20c59f8ae975f622b3ab6effc331110efcf..2b1da22f151f8b07def050483c49b78233527f04 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -1,6 +1,6 @@
/* Python interface to inferior threads.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,7 +23,8 @@
#include "inferior.h"
#include "python-internal.h"
-static PyTypeObject thread_object_type;
+static PyTypeObject thread_object_type
+ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("thread_object");
/* Require that INFERIOR be a valid inferior ID. */
#define THPY_REQUIRE_VALID(Thread) \
@@ -48,7 +49,7 @@ create_thread_object (struct thread_info *tp)
return NULL;
thread_obj->thread = tp;
- thread_obj->inf_obj = find_inferior_object (PIDGET (tp->ptid));
+ thread_obj->inf_obj = find_inferior_object (ptid_get_pid (tp->ptid));
return thread_obj;
}
@@ -59,7 +60,7 @@ static void
thpy_dealloc (PyObject *self)
{
Py_DECREF (((thread_object *) self)->inf_obj);
- self->ob_type->tp_free (self);
+ Py_TYPE (self)->tp_free (self);
}
static PyObject *
@@ -94,7 +95,7 @@ thpy_set_name (PyObject *self, PyObject *newvalue, void *ignore)
if (newvalue == NULL)
{
- PyErr_SetString (PyExc_TypeError,
+ PyErr_SetString (PyExc_TypeError,
_("Cannot delete `name' attribute."));
return -1;
}
@@ -254,15 +255,14 @@ gdbpy_selected_thread (PyObject *self, PyObject *args)
-void
+int
gdbpy_initialize_thread (void)
{
if (PyType_Ready (&thread_object_type) < 0)
- return;
+ return -1;
- Py_INCREF (&thread_object_type);
- PyModule_AddObject (gdb_module, "InferiorThread",
- (PyObject *) &thread_object_type);
+ return gdb_pymodule_addobject (gdb_module, "InferiorThread",
+ (PyObject *) &thread_object_type);
}
@@ -301,8 +301,7 @@ Return whether the thread is exited." },
static PyTypeObject thread_object_type =
{
- PyObject_HEAD_INIT (NULL)
- 0, /*ob_size*/
+ PyVarObject_HEAD_INIT (NULL, 0)
"gdb.InferiorThread", /*tp_name*/
sizeof (thread_object), /*tp_basicsize*/
0, /*tp_itemsize*/
« no previous file with comments | « gdb/python/py-inferior.c ('k') | gdb/python/py-lazy-string.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698