2011-03-17 Phil Muldoon <pmuldoon@redhat.com>
* python/py-symtab.c: Populate symtab_object_methods, sal_object_methods. (stpy_is_valid): New function. (salpy_is_valid): Ditto. * python/py-symbol.c: Declare symbol_object_methods. Populate. (sympy_is_valid): New function. * python/py-objfile.c: Declare objfile_object_methods. Populate. (objfpy_is_valid): New function. * python/py-inferior.c: Populate inferior_object_methods. (infpy_is_valid): New function. * python/py-infthread.c: Populate thread_object_methods. (thpy_is_valid): New function. * python/py-block.c: Declare block_object_methods. Populate. Declare block_iterator_object_methods. Populate. (blpy_is_valid): New function. (blpy_iter_is_valid): Ditto. 2010-03-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/Makefile.in: Add py-objfile. * gdb.python/py-objfile.exp: New file. * gdb.python/py-objfile.c: New file. * gdb.python/py-block.exp: Add is_valid tests. * gdb.python/py-inferior.exp: Ditto. * gdb.python/py-infthread.exp: Ditto. * gdb.python/py-symbol.exp: Ditto. * gdb.python/py-symtab.exp: Ditto. 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Blocks In Python): Add is_valid method description. (Inferiors In Python): Likewise. (Threads In Python): Likewise. (Symbols In Python): Likewise. (Objfiles In Python): Likewise. (Symbol Tables In Python): Likewise.
This commit is contained in:
parent
a6363bfc38
commit
29703da4b1
19 changed files with 427 additions and 8 deletions
|
@ -606,6 +606,20 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* Implementation of gdb.Inferior.is_valid (self) -> Boolean.
|
||||
Returns True if this inferior object still exists in GDB. */
|
||||
|
||||
static PyObject *
|
||||
infpy_is_valid (PyObject *self, PyObject *args)
|
||||
{
|
||||
inferior_object *inf = (inferior_object *) self;
|
||||
|
||||
if (! inf->inferior)
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Clear the INFERIOR pointer in an Inferior object and clear the
|
||||
thread list. */
|
||||
|
@ -676,6 +690,9 @@ static PyGetSetDef inferior_object_getset[] =
|
|||
|
||||
static PyMethodDef inferior_object_methods[] =
|
||||
{
|
||||
{ "is_valid", infpy_is_valid, METH_NOARGS,
|
||||
"is_valid () -> Boolean.\n\
|
||||
Return true if this inferior is valid, false if not." },
|
||||
{ "threads", infpy_threads, METH_NOARGS,
|
||||
"Return all the threads of this inferior." },
|
||||
{ "read_memory", (PyCFunction) infpy_read_memory,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue