GDB (xrefs)
Defines | Functions | Variables
/home/stan/gdb/src/gdb/python/py-infthread.c File Reference
#include "defs.h"
#include "exceptions.h"
#include "gdbthread.h"
#include "inferior.h"
#include "python-internal.h"

Go to the source code of this file.

Defines

#define THPY_REQUIRE_VALID(Thread)

Functions

static PyTypeObject
thread_object_type 
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("thread_object")
thread_objectcreate_thread_object (struct thread_info *tp)
static void thpy_dealloc (PyObject *self)
static PyObjectthpy_get_name (PyObject *self, void *ignore)
static int thpy_set_name (PyObject *self, PyObject *newvalue, void *ignore)
static PyObjectthpy_get_num (PyObject *self, void *closure)
static PyObjectthpy_get_ptid (PyObject *self, void *closure)
static PyObjectthpy_switch (PyObject *self, PyObject *args)
static PyObjectthpy_is_stopped (PyObject *self, PyObject *args)
static PyObjectthpy_is_running (PyObject *self, PyObject *args)
static PyObjectthpy_is_exited (PyObject *self, PyObject *args)
static PyObjectthpy_is_valid (PyObject *self, PyObject *args)
PyObjectgdbpy_selected_thread (PyObject *self, PyObject *args)
int gdbpy_initialize_thread (void)

Variables

static PyGetSetDef thread_object_getset []
static PyMethodDef thread_object_methods []
static PyTypeObject thread_object_type

Define Documentation

#define THPY_REQUIRE_VALID (   Thread)
Value:
do {                                                            \
    if (!Thread->thread)                                        \
      {                                                         \
        PyErr_SetString (PyExc_RuntimeError,                    \
                         _("Thread no longer exists."));        \
        return NULL;                                            \
      }                                                         \
  } while (0)

Definition at line 30 of file py-infthread.c.

Referenced by thpy_get_name(), thpy_get_num(), thpy_get_ptid(), thpy_is_exited(), thpy_is_running(), thpy_is_stopped(), and thpy_switch().


Function Documentation

static PyTypeObject thread_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "thread_object"  ) [static]

Definition at line 259 of file py-infthread.c.

References gdb_module, gdb_pymodule_addobject(), and thread_object_type.

Referenced by _initialize_python().

PyObject* gdbpy_selected_thread ( PyObject self,
PyObject args 
)

Definition at line 242 of file py-infthread.c.

References find_thread_object(), and inferior_ptid.

static void thpy_dealloc ( PyObject self) [static]

Definition at line 60 of file py-infthread.c.

References Py_DECREF.

static PyObject* thpy_get_name ( PyObject self,
void *  ignore 
) [static]
static PyObject* thpy_get_num ( PyObject self,
void *  closure 
) [static]
static PyObject* thpy_get_ptid ( PyObject self,
void *  closure 
) [static]
static PyObject* thpy_is_exited ( PyObject self,
PyObject args 
) [static]
static PyObject* thpy_is_running ( PyObject self,
PyObject args 
) [static]
static PyObject* thpy_is_stopped ( PyObject self,
PyObject args 
) [static]
static PyObject* thpy_is_valid ( PyObject self,
PyObject args 
) [static]

Definition at line 229 of file py-infthread.c.

References thread_object::thread.

static int thpy_set_name ( PyObject self,
PyObject newvalue,
void *  ignore 
) [static]
static PyObject* thpy_switch ( PyObject self,
PyObject args 
) [static]

Variable Documentation

PyGetSetDef thread_object_getset[] [static]
Initial value:
{
  { "name", thpy_get_name, thpy_set_name,
    "The name of the thread, as set by the user or the OS.", NULL },
  { "num", thpy_get_num, NULL, "ID of the thread, as assigned by GDB.", NULL },
  { "ptid", thpy_get_ptid, NULL, "ID of the thread, as assigned by the OS.",
    NULL },

  { NULL }
}

Definition at line 270 of file py-infthread.c.

PyMethodDef thread_object_methods[] [static]
Initial value:
{
  { "is_valid", thpy_is_valid, METH_NOARGS,
    "is_valid () -> Boolean.\n\
Return true if this inferior thread is valid, false if not." },
  { "switch", thpy_switch, METH_NOARGS,
    "switch ()\n\
Makes this the GDB selected thread." },
  { "is_stopped", thpy_is_stopped, METH_NOARGS,
    "is_stopped () -> Boolean\n\
Return whether the thread is stopped." },
  { "is_running", thpy_is_running, METH_NOARGS,
    "is_running () -> Boolean\n\
Return whether the thread is running." },
  { "is_exited", thpy_is_exited, METH_NOARGS,
    "is_exited () -> Boolean\n\
Return whether the thread is exited." },

  { NULL }
}

Definition at line 281 of file py-infthread.c.

PyTypeObject thread_object_type [static]

Definition at line 302 of file py-infthread.c.

Referenced by create_thread_object(), and gdbpy_initialize_thread().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines