mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-28 22:21:26 +08:00
2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR Python/12692 Add gdb.selected_inferior() to Python interface. * python/py-inferior.c (GdbMethods): New Python method definition. doc: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.texinfo (Inferiors In Python): Describe new gdb.selected_inferior() function. testsuite: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
This commit is contained in:
@ -683,6 +683,20 @@ py_free_inferior (struct inferior *inf, void *datum)
|
||||
do_cleanups (cleanup);
|
||||
}
|
||||
|
||||
/* Implementation of gdb.selected_inferior() -> gdb.Inferior.
|
||||
Returns the current inferior object. */
|
||||
|
||||
PyObject *
|
||||
gdbpy_selected_inferior (PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *inf_obj;
|
||||
|
||||
inf_obj = inferior_to_inferior_object (current_inferior ());
|
||||
Py_INCREF (inf_obj);
|
||||
|
||||
return inf_obj;
|
||||
}
|
||||
|
||||
void
|
||||
gdbpy_initialize_inferior (void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user