GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
py-progspace.c File Reference
#include "defs.h"
#include "python-internal.h"
#include "charset.h"
#include "progspace.h"
#include "objfiles.h"
#include "language.h"
#include "arch-utils.h"
#include "solib.h"
#include "block.h"
#include "py-event.h"
#include "observable.h"

Go to the source code of this file.

Classes

struct  pspace_object
 
struct  pspace_deleter
 

Macros

#define PSPY_REQUIRE_VALID(pspace_obj)
 

Functions

PyTypeObject pspace_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("pspace_object")
 
static PyObjectpspy_get_filename (PyObject *self, void *closure)
 
static PyObjectpspy_get_symbol_file (PyObject *self, void *closure)
 
static PyObjectpspy_get_exec_file (PyObject *self, void *closure)
 
static void pspy_dealloc (PyObject *self)
 
static int pspy_initialize (pspace_object *self)
 
static PyObjectpspy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
 
PyObjectpspy_get_printers (PyObject *o, void *ignore)
 
static int pspy_set_printers (PyObject *o, PyObject *value, void *ignore)
 
PyObjectpspy_get_frame_filters (PyObject *o, void *ignore)
 
static int pspy_set_frame_filters (PyObject *o, PyObject *frame, void *ignore)
 
PyObjectpspy_get_frame_unwinders (PyObject *o, void *ignore)
 
static int pspy_set_frame_unwinders (PyObject *o, PyObject *unwinders, void *ignore)
 
static PyObjectpspy_get_type_printers (PyObject *o, void *ignore)
 
PyObjectpspy_get_xmethods (PyObject *o, void *ignore)
 
static int pspy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
 
static PyObjectpspy_get_objfiles (PyObject *self_, PyObject *args)
 
static PyObjectpspy_solib_name (PyObject *o, PyObject *args)
 
static PyObjectpspy_objfile_for_address (PyObject *o, PyObject *args)
 
static PyObjectpspy_block_for_pc (PyObject *o, PyObject *args)
 
static PyObjectpspy_find_pc_line (PyObject *o, PyObject *args)
 
static PyObjectpspy_is_valid (PyObject *o, PyObject *args)
 
gdbpy_ref pspace_to_pspace_object (struct program_space *pspace)
 
struct program_spaceprogspace_object_to_program_space (PyObject *obj)
 
bool gdbpy_is_progspace (PyObject *obj)
 
static int emit_executable_changed_event (eventregistry_object *registry, struct program_space *pspace, bool reload_p)
 
static void gdbpy_executable_changed (struct program_space *pspace, bool reload_p)
 
static void gdbpy_program_space_event (program_space *pspace, bool adding_p)
 
static void gdbpy_new_program_space_event (program_space *pspace)
 
static void gdbpy_free_program_space_event (program_space *pspace)
 
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_pspace (void)
 
 GDBPY_INITIALIZE_FILE (gdbpy_initialize_pspace)
 

Variables

static const registry< program_space >::key< pspace_object, pspace_deleterpspy_pspace_data_key
 
static gdb_PyGetSetDef pspace_getset []
 
static PyMethodDef progspace_object_methods []
 
PyTypeObject pspace_object_type
 

Macro Definition Documentation

◆ PSPY_REQUIRE_VALID

#define PSPY_REQUIRE_VALID ( pspace_obj)
Value:
do { \
if (pspace_obj->pspace == nullptr) \
{ \
PyErr_SetString (PyExc_RuntimeError, \
_("Program space no longer exists.")); \
return NULL; \
} \
} while (0)

Definition at line 88 of file py-progspace.c.

Referenced by pspy_block_for_pc(), pspy_find_pc_line(), pspy_get_exec_file(), pspy_get_objfiles(), pspy_get_symbol_file(), pspy_objfile_for_address(), and pspy_solib_name().

Function Documentation

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject pspace_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "pspace_object" )
extern

◆ emit_executable_changed_event()

static int emit_executable_changed_event ( eventregistry_object * registry,
struct program_space * pspace,
bool reload_p )
static

◆ gdbpy_executable_changed()

static void gdbpy_executable_changed ( struct program_space * pspace,
bool reload_p )
static

◆ gdbpy_free_program_space_event()

static void gdbpy_free_program_space_event ( program_space * pspace)
static

Definition at line 700 of file py-progspace.c.

References gdbpy_program_space_event().

Referenced by gdbpy_initialize_pspace().

◆ GDBPY_INITIALIZE_FILE()

GDBPY_INITIALIZE_FILE ( gdbpy_initialize_pspace )

◆ gdbpy_initialize_pspace()

static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_pspace ( void )
static

◆ gdbpy_is_progspace()

bool gdbpy_is_progspace ( PyObject * obj)

Definition at line 592 of file py-progspace.c.

References pspace_object_type.

Referenced by progspace_object_to_program_space().

◆ gdbpy_new_program_space_event()

static void gdbpy_new_program_space_event ( program_space * pspace)
static

Definition at line 691 of file py-progspace.c.

References gdbpy_program_space_event().

Referenced by gdbpy_initialize_pspace().

◆ gdbpy_program_space_event()

static void gdbpy_program_space_event ( program_space * pspace,
bool adding_p )
static

◆ progspace_object_to_program_space()

struct program_space * progspace_object_to_program_space ( PyObject * obj)

Definition at line 583 of file py-progspace.c.

References gdbpy_is_progspace().

◆ pspace_to_pspace_object()

gdbpy_ref pspace_to_pspace_object ( struct program_space * pspace)

◆ pspy_block_for_pc()

static PyObject * pspy_block_for_pc ( PyObject * o,
PyObject * args )
static

◆ pspy_dealloc()

static void pspy_dealloc ( PyObject * self)
static

◆ pspy_find_pc_line()

static PyObject * pspy_find_pc_line ( PyObject * o,
PyObject * args )
static

◆ pspy_get_exec_file()

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

◆ pspy_get_filename()

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

◆ pspy_get_frame_filters()

PyObject * pspy_get_frame_filters ( PyObject * o,
void * ignore )

Definition at line 257 of file py-progspace.c.

References pspace_object::frame_filters.

◆ pspy_get_frame_unwinders()

PyObject * pspy_get_frame_unwinders ( PyObject * o,
void * ignore )

Definition at line 296 of file py-progspace.c.

References pspace_object::frame_unwinders.

◆ pspy_get_objfiles()

static PyObject * pspy_get_objfiles ( PyObject * self_,
PyObject * args )
static

◆ pspy_get_printers()

PyObject * pspy_get_printers ( PyObject * o,
void * ignore )

Definition at line 219 of file py-progspace.c.

References pspace_object::printers.

Referenced by find_pretty_printer_from_progspace().

◆ pspy_get_symbol_file()

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

◆ pspy_get_type_printers()

static PyObject * pspy_get_type_printers ( PyObject * o,
void * ignore )
static

Definition at line 336 of file py-progspace.c.

References pspace_object::type_printers.

◆ pspy_get_xmethods()

PyObject * pspy_get_xmethods ( PyObject * o,
void * ignore )

Definition at line 347 of file py-progspace.c.

References pspace_object::xmethods.

Referenced by gdbpy_get_matching_xmethod_workers().

◆ pspy_initialize()

static int pspy_initialize ( pspace_object * self)
static

◆ pspy_is_valid()

static PyObject * pspy_is_valid ( PyObject * o,
PyObject * args )
static

Definition at line 542 of file py-progspace.c.

References pspace_object::pspace.

◆ pspy_new()

static PyObject * pspy_new ( PyTypeObject * type,
PyObject * args,
PyObject * keywords )
static

Definition at line 205 of file py-progspace.c.

References pspy_initialize().

◆ pspy_objfile_for_address()

static PyObject * pspy_objfile_for_address ( PyObject * o,
PyObject * args )
static

◆ pspy_set_frame_filters()

static int pspy_set_frame_filters ( PyObject * o,
PyObject * frame,
void * ignore )
static

Definition at line 267 of file py-progspace.c.

References pspace_object::frame_filters.

◆ pspy_set_frame_unwinders()

static int pspy_set_frame_unwinders ( PyObject * o,
PyObject * unwinders,
void * ignore )
static

Definition at line 307 of file py-progspace.c.

References pspace_object::frame_unwinders.

◆ pspy_set_printers()

static int pspy_set_printers ( PyObject * o,
PyObject * value,
void * ignore )
static

Definition at line 228 of file py-progspace.c.

References pspace_object::printers, and value.

◆ pspy_set_type_printers()

static int pspy_set_type_printers ( PyObject * o,
PyObject * value,
void * ignore )
static

Definition at line 358 of file py-progspace.c.

References pspace_object::type_printers, and value.

◆ pspy_solib_name()

static PyObject * pspy_solib_name ( PyObject * o,
PyObject * args )
static

Variable Documentation

◆ progspace_object_methods

PyMethodDef progspace_object_methods[]
static
Initial value:
=
{
{ "objfiles", pspy_get_objfiles, METH_NOARGS,
"Return a sequence of objfiles associated to this program space." },
{ "solib_name", pspy_solib_name, METH_VARARGS,
"solib_name (Long) -> String.\n\
Return the name of the shared library holding a given address, or None." },
{ "objfile_for_address", pspy_objfile_for_address, METH_VARARGS,
"objfile_for_address (int) -> gdb.Objfile\n\
Return the objfile containing the given address, or None." },
{ "block_for_pc", pspy_block_for_pc, METH_VARARGS,
"Return the block containing the given pc value, or None." },
{ "find_pc_line", pspy_find_pc_line, METH_VARARGS,
"find_pc_line (pc) -> Symtab_and_line.\n\
Return the gdb.Symtab_and_line object corresponding to the pc value." },
{ "is_valid", pspy_is_valid, METH_NOARGS,
"is_valid () -> Boolean.\n\
Return true if this program space is valid, false if not." },
{ NULL }
}
static PyObject * pspy_is_valid(PyObject *o, PyObject *args)
static PyObject * pspy_get_objfiles(PyObject *self_, PyObject *args)
static PyObject * pspy_find_pc_line(PyObject *o, PyObject *args)
static PyObject * pspy_solib_name(PyObject *o, PyObject *args)
static PyObject * pspy_block_for_pc(PyObject *o, PyObject *args)
static PyObject * pspy_objfile_for_address(PyObject *o, PyObject *args)

Definition at line 750 of file py-progspace.c.

◆ pspace_getset

gdb_PyGetSetDef pspace_getset[]
static
Initial value:
=
{
{ "__dict__", gdb_py_generic_dict, NULL,
"The __dict__ for this progspace.", &pspace_object_type },
{ "filename", pspy_get_filename, NULL,
"The filename of the progspace's main symbol file, or None.", nullptr },
{ "symbol_file", pspy_get_symbol_file, nullptr,
"The gdb.Objfile for the progspace's main symbol file, or None.",
nullptr},
{ "executable_filename", pspy_get_exec_file, nullptr,
"The filename for the progspace's executable, or None.", nullptr},
{ "pretty_printers", pspy_get_printers, pspy_set_printers,
"Pretty printers.", NULL },
"Frame filters.", NULL },
"Frame unwinders.", NULL },
"Type printers.", NULL },
{ "xmethods", pspy_get_xmethods, NULL,
"Debug methods.", NULL },
{ NULL }
}
PyTypeObject pspace_object_type
static PyObject * pspy_get_symbol_file(PyObject *self, void *closure)
static int pspy_set_frame_filters(PyObject *o, PyObject *frame, void *ignore)
static PyObject * pspy_get_filename(PyObject *self, void *closure)
static int pspy_set_type_printers(PyObject *o, PyObject *value, void *ignore)
PyObject * pspy_get_xmethods(PyObject *o, void *ignore)
static int pspy_set_frame_unwinders(PyObject *o, PyObject *unwinders, void *ignore)
static PyObject * pspy_get_type_printers(PyObject *o, void *ignore)
static PyObject * pspy_get_exec_file(PyObject *self, void *closure)
static int pspy_set_printers(PyObject *o, PyObject *value, void *ignore)
PyObject * pspy_get_printers(PyObject *o, void *ignore)
PyObject * pspy_get_frame_filters(PyObject *o, void *ignore)
PyObject * pspy_get_frame_unwinders(PyObject *o, void *ignore)
PyObject * gdb_py_generic_dict(PyObject *self, void *closure)
Definition py-utils.c:317

Definition at line 726 of file py-progspace.c.

◆ pspace_object_type

PyTypeObject pspace_object_type

◆ pspy_pspace_data_key

const registry<program_space>::key<pspace_object, pspace_deleter> pspy_pspace_data_key
static

Definition at line 85 of file py-progspace.c.

Referenced by pspace_to_pspace_object().