GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
py-inferior.c File Reference
#include "defs.h"
#include "auto-load.h"
#include "gdbcore.h"
#include "gdbthread.h"
#include "inferior.h"
#include "objfiles.h"
#include "observable.h"
#include "python-internal.h"
#include "arch-utils.h"
#include "language.h"
#include "gdbsupport/gdb_signals.h"
#include "py-event.h"
#include "py-stopevent.h"
#include <unordered_map>

Go to the source code of this file.

Classes

struct  inferior_object
 
struct  infpy_deleter
 

Macros

#define INFPY_REQUIRE_VALID(Inferior)
 

Typedefs

using thread_map_t = std::unordered_map< thread_info *, gdbpy_ref< thread_object > >
 

Functions

PyTypeObject inferior_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("inferior_object")
 
static void python_on_normal_stop (struct bpstat *bs, int print_frame)
 
static void python_on_resume (ptid_t ptid)
 
static void python_on_inferior_call_pre (ptid_t thread, CORE_ADDR address)
 
static void python_on_inferior_call_post (ptid_t thread, CORE_ADDR address)
 
static void python_on_memory_change (struct inferior *inferior, CORE_ADDR addr, ssize_t len, const bfd_byte *data)
 
static void python_on_register_change (frame_info_ptr frame, int regnum)
 
static void python_inferior_exit (struct inferior *inf)
 
static void python_new_objfile (struct objfile *objfile)
 
static void python_free_objfile (struct objfile *objfile)
 
gdbpy_ref< inferior_objectinferior_to_inferior_object (struct inferior *inferior)
 
static void python_new_inferior (struct inferior *inf)
 
static void python_inferior_deleted (struct inferior *inf)
 
gdbpy_ref thread_to_thread_object (thread_info *thr)
 
static void add_thread_object (struct thread_info *tp)
 
static void delete_thread_object (struct thread_info *tp, int ignore)
 
static PyObjectinfpy_threads (PyObject *self, PyObject *args)
 
static PyObjectinfpy_get_num (PyObject *self, void *closure)
 
static PyObjectinfpy_get_connection (PyObject *self, void *closure)
 
static PyObjectinfpy_get_connection_num (PyObject *self, void *closure)
 
static PyObjectinfpy_get_pid (PyObject *self, void *closure)
 
static PyObjectinfpy_get_was_attached (PyObject *self, void *closure)
 
static PyObjectinfpy_get_progspace (PyObject *self, void *closure)
 
PyObjectgdbpy_inferiors (PyObject *unused, PyObject *unused2)
 
static PyObjectinfpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectinfpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectinfpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectinfpy_is_valid (PyObject *self, PyObject *args)
 
static PyObjectinfpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectinfpy_architecture (PyObject *self, PyObject *args)
 
static PyObjectinfpy_repr (PyObject *obj)
 
static void infpy_dealloc (PyObject *obj)
 
PyObjectgdbpy_selected_inferior (PyObject *self, PyObject *args)
 
int gdbpy_initialize_inferior (void)
 

Variables

static const registry< inferior >::key< inferior_object, infpy_deleterinfpy_inf_data_key
 
static gdb_PyGetSetDef inferior_object_getset []
 
static PyMethodDef inferior_object_methods []
 
PyTypeObject inferior_object_type
 

Macro Definition Documentation

◆ INFPY_REQUIRE_VALID

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

Definition at line 74 of file py-inferior.c.

Typedef Documentation

◆ thread_map_t

using thread_map_t = std::unordered_map<thread_info *, gdbpy_ref<thread_object> >

Definition at line 35 of file py-inferior.c.

Function Documentation

◆ add_thread_object()

static void add_thread_object ( struct thread_info tp)
static

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject inferior_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "inferior_object"  )

◆ delete_thread_object()

static void delete_thread_object ( struct thread_info tp,
int  ignore 
)
static

◆ gdbpy_inferiors()

PyObject * gdbpy_inferiors ( PyObject unused,
PyObject unused2 
)

Definition at line 499 of file py-inferior.c.

References all_inferiors(), and inferior_to_inferior_object().

◆ gdbpy_initialize_inferior()

int gdbpy_initialize_inferior ( void  )

◆ gdbpy_selected_inferior()

PyObject * gdbpy_selected_inferior ( PyObject self,
PyObject args 
)

Definition at line 799 of file py-inferior.c.

References current_inferior(), and inferior_to_inferior_object().

◆ inferior_to_inferior_object()

gdbpy_ref< inferior_object > inferior_to_inferior_object ( struct inferior inferior)

◆ infpy_architecture()

static PyObject * infpy_architecture ( PyObject self,
PyObject args 
)
static

Definition at line 749 of file py-inferior.c.

References gdbarch_to_arch_object(), and INFPY_REQUIRE_VALID.

◆ infpy_dealloc()

static void infpy_dealloc ( PyObject obj)
static

Definition at line 775 of file py-inferior.c.

References inferior_object::inferior.

◆ infpy_get_connection()

static PyObject * infpy_get_connection ( PyObject self,
void *  closure 
)
static

Definition at line 433 of file py-inferior.c.

References INFPY_REQUIRE_VALID, and target_to_connection_object().

◆ infpy_get_connection_num()

static PyObject * infpy_get_connection_num ( PyObject self,
void *  closure 
)
static

◆ infpy_get_num()

static PyObject * infpy_get_num ( PyObject self,
void *  closure 
)
static

Definition at line 420 of file py-inferior.c.

References gdb_py_object_from_longest(), and INFPY_REQUIRE_VALID.

◆ infpy_get_pid()

static PyObject * infpy_get_pid ( PyObject self,
void *  closure 
)
static

Definition at line 461 of file py-inferior.c.

References gdb_py_object_from_longest(), INFPY_REQUIRE_VALID, and inf::pid.

◆ infpy_get_progspace()

static PyObject * infpy_get_progspace ( PyObject self,
void *  closure 
)
static

Definition at line 484 of file py-inferior.c.

References INFPY_REQUIRE_VALID, and pspace_to_pspace_object().

◆ infpy_get_was_attached()

static PyObject * infpy_get_was_attached ( PyObject self,
void *  closure 
)
static

Definition at line 471 of file py-inferior.c.

References INFPY_REQUIRE_VALID.

◆ infpy_is_valid()

static PyObject * infpy_is_valid ( PyObject self,
PyObject args 
)
static

Definition at line 677 of file py-inferior.c.

◆ infpy_read_memory()

static PyObject * infpy_read_memory ( PyObject self,
PyObject args,
PyObject kw 
)
static

◆ infpy_repr()

static PyObject * infpy_repr ( PyObject obj)
static

Definition at line 761 of file py-inferior.c.

References inferior_object::inferior, and inf::pid.

◆ infpy_search_memory()

static PyObject * infpy_search_memory ( PyObject self,
PyObject args,
PyObject kw 
)
static

◆ infpy_thread_from_thread_handle()

static PyObject * infpy_thread_from_thread_handle ( PyObject self,
PyObject args,
PyObject kw 
)
static

◆ infpy_threads()

static PyObject * infpy_threads ( PyObject self,
PyObject args 
)
static

◆ infpy_write_memory()

static PyObject * infpy_write_memory ( PyObject self,
PyObject args,
PyObject kw 
)
static

◆ python_free_objfile()

static void python_free_objfile ( struct objfile objfile)
static

◆ python_inferior_deleted()

static void python_inferior_deleted ( struct inferior inf)
static

◆ python_inferior_exit()

static void python_inferior_exit ( struct inferior inf)
static

◆ python_new_inferior()

static void python_new_inferior ( struct inferior inf)
static

◆ python_new_objfile()

static void python_new_objfile ( struct objfile objfile)
static

◆ python_on_inferior_call_post()

static void python_on_inferior_call_post ( ptid_t  thread,
CORE_ADDR  address 
)
static

◆ python_on_inferior_call_pre()

static void python_on_inferior_call_pre ( ptid_t  thread,
CORE_ADDR  address 
)
static

◆ python_on_memory_change()

static void python_on_memory_change ( struct inferior inferior,
CORE_ADDR  addr,
ssize_t  len,
const bfd_byte *  data 
)
static

◆ python_on_normal_stop()

static void python_on_normal_stop ( struct bpstat bs,
int  print_frame 
)
static

◆ python_on_register_change()

static void python_on_register_change ( frame_info_ptr  frame,
int  regnum 
)
static

◆ python_on_resume()

static void python_on_resume ( ptid_t  ptid)
static

◆ thread_to_thread_object()

gdbpy_ref thread_to_thread_object ( thread_info thr)

Variable Documentation

◆ inferior_object_getset

gdb_PyGetSetDef inferior_object_getset[]
static
Initial value:
=
{
{ "num", infpy_get_num, NULL, "ID of inferior, as assigned by GDB.", NULL },
{ "connection", infpy_get_connection, NULL,
"The gdb.TargetConnection for this inferior.", NULL },
{ "connection_num", infpy_get_connection_num, NULL,
"ID of inferior's connection, as assigned by GDB.", NULL },
{ "pid", infpy_get_pid, NULL, "PID of inferior, as assigned by the OS.",
NULL },
{ "was_attached", infpy_get_was_attached, NULL,
"True if the inferior was created using 'attach'.", NULL },
{ "progspace", infpy_get_progspace, NULL, "Program space of this inferior" },
{ NULL }
}
static PyObject * infpy_get_was_attached(PyObject *self, void *closure)
static PyObject * infpy_get_num(PyObject *self, void *closure)
static PyObject * infpy_get_progspace(PyObject *self, void *closure)
static PyObject * infpy_get_pid(PyObject *self, void *closure)
static PyObject * infpy_get_connection_num(PyObject *self, void *closure)
static PyObject * infpy_get_connection(PyObject *self, void *closure)

Definition at line 841 of file py-inferior.c.

◆ inferior_object_methods

PyMethodDef inferior_object_methods[]
static

Definition at line 856 of file py-inferior.c.

◆ inferior_object_type

PyTypeObject inferior_object_type

Definition at line 891 of file py-inferior.c.

Referenced by gdbpy_initialize_inferior(), and inferior_to_inferior_object().

◆ infpy_inf_data_key

const registry<inferior>::key<inferior_object, infpy_deleter> infpy_inf_data_key
static

Definition at line 71 of file py-inferior.c.

Referenced by inferior_to_inferior_object().