GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
py-objfile.c File Reference
#include "defs.h"
#include "python-internal.h"
#include "charset.h"
#include "objfiles.h"
#include "language.h"
#include "build-id.h"
#include "symtab.h"
#include "python.h"

Go to the source code of this file.

Classes

struct  objfile_object
 
struct  objfpy_deleter
 

Macros

#define OBJFPY_REQUIRE_VALID(obj)
 

Functions

PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("objfile_object")
 
static PyObjectobjfpy_get_filename (PyObject *self, void *closure)
 
static PyObjectobjfpy_get_username (PyObject *self, void *closure)
 
static PyObjectobjfpy_get_is_file (PyObject *o, void *ignore)
 
static PyObjectobjfpy_get_owner (PyObject *self, void *closure)
 
static PyObjectobjfpy_get_build_id (PyObject *self, void *closure)
 
static PyObjectobjfpy_get_progspace (PyObject *self, void *closure)
 
static void objfpy_dealloc (PyObject *o)
 
static int objfpy_initialize (objfile_object *self)
 
static PyObjectobjfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
 
PyObjectobjfpy_get_printers (PyObject *o, void *ignore)
 
static int objfpy_set_printers (PyObject *o, PyObject *value, void *ignore)
 
PyObjectobjfpy_get_frame_filters (PyObject *o, void *ignore)
 
static int objfpy_set_frame_filters (PyObject *o, PyObject *filters, void *ignore)
 
PyObjectobjfpy_get_frame_unwinders (PyObject *o, void *ignore)
 
static int objfpy_set_frame_unwinders (PyObject *o, PyObject *unwinders, void *ignore)
 
static PyObjectobjfpy_get_type_printers (PyObject *o, void *ignore)
 
PyObjectobjfpy_get_xmethods (PyObject *o, void *ignore)
 
static int objfpy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
 
static PyObjectobjfpy_is_valid (PyObject *self, PyObject *args)
 
static PyObjectobjfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectobjfpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectobjfpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObjectobjfpy_repr (PyObject *self_)
 
static int objfpy_build_id_ok (const char *string)
 
static int objfpy_build_id_matches (const struct bfd_build_id *build_id, const char *string)
 
PyObjectgdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 
gdbpy_ref objfile_to_objfile_object (struct objfile *objfile)
 
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_objfile (void)
 
 GDBPY_INITIALIZE_FILE (gdbpy_initialize_objfile)
 

Variables

static const registry< objfile >::key< objfile_object, objfpy_deleterobjfpy_objfile_data_key
 
static PyMethodDef objfile_object_methods []
 
static gdb_PyGetSetDef objfile_getset []
 
PyTypeObject objfile_object_type
 

Macro Definition Documentation

◆ OBJFPY_REQUIRE_VALID

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

Definition at line 75 of file py-objfile.c.

Referenced by objfpy_add_separate_debug_file(), objfpy_get_build_id(), objfpy_get_owner(), objfpy_lookup_global_symbol(), and objfpy_lookup_static_symbol().

Function Documentation

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "objfile_object" )
extern

◆ GDBPY_INITIALIZE_FILE()

GDBPY_INITIALIZE_FILE ( gdbpy_initialize_objfile )

◆ gdbpy_initialize_objfile()

static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_objfile ( void )
static

Definition at line 708 of file py-objfile.c.

References gdb_module, gdb_pymodule_addobject(), and objfile_object_type.

◆ gdbpy_lookup_objfile()

PyObject * gdbpy_lookup_objfile ( PyObject * self,
PyObject * args,
PyObject * kw )

◆ objfile_to_objfile_object()

gdbpy_ref objfile_to_objfile_object ( struct objfile * objfile)

◆ objfpy_add_separate_debug_file()

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

◆ objfpy_build_id_matches()

static int objfpy_build_id_matches ( const struct bfd_build_id * build_id,
const char * string )
static

Definition at line 568 of file py-objfile.c.

References c1, and c2.

Referenced by gdbpy_lookup_objfile().

◆ objfpy_build_id_ok()

static int objfpy_build_id_ok ( const char * string)
static

Definition at line 549 of file py-objfile.c.

Referenced by gdbpy_lookup_objfile().

◆ objfpy_dealloc()

static void objfpy_dealloc ( PyObject * o)
static

◆ objfpy_get_build_id()

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

◆ objfpy_get_filename()

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

◆ objfpy_get_frame_filters()

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

Definition at line 293 of file py-objfile.c.

References objfile_object::frame_filters.

◆ objfpy_get_frame_unwinders()

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

Definition at line 332 of file py-objfile.c.

References objfile_object::frame_unwinders.

◆ objfpy_get_is_file()

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

Definition at line 121 of file py-objfile.c.

References objfile::flags, OBJF_NOT_FILENAME, and objfile_object::objfile.

◆ objfpy_get_owner()

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

◆ objfpy_get_printers()

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

Definition at line 255 of file py-objfile.c.

References objfile_object::printers.

Referenced by find_pretty_printer_from_objfiles().

◆ objfpy_get_progspace()

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

Definition at line 181 of file py-objfile.c.

References objfile_object::objfile, objfile::pspace, and pspace_to_pspace_object().

◆ objfpy_get_type_printers()

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

Definition at line 372 of file py-objfile.c.

References objfile_object::type_printers.

◆ objfpy_get_username()

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

◆ objfpy_get_xmethods()

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

Definition at line 383 of file py-objfile.c.

References objfile_object::xmethods.

Referenced by gdbpy_get_matching_xmethod_workers().

◆ objfpy_initialize()

static int objfpy_initialize ( objfile_object * self)
static

◆ objfpy_is_valid()

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

Definition at line 424 of file py-objfile.c.

References objfile_object::objfile.

◆ objfpy_lookup_global_symbol()

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

◆ objfpy_lookup_static_symbol()

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

◆ objfpy_new()

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

Definition at line 241 of file py-objfile.c.

References objfpy_initialize().

◆ objfpy_repr()

static PyObject * objfpy_repr ( PyObject * self_)
static

Definition at line 533 of file py-objfile.c.

References objfile_object::objfile, and objfile_name().

◆ objfpy_set_frame_filters()

static int objfpy_set_frame_filters ( PyObject * o,
PyObject * filters,
void * ignore )
static

Definition at line 303 of file py-objfile.c.

References objfile_object::frame_filters.

◆ objfpy_set_frame_unwinders()

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

Definition at line 343 of file py-objfile.c.

References objfile_object::frame_unwinders.

◆ objfpy_set_printers()

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

Definition at line 264 of file py-objfile.c.

References objfile_object::printers, and value.

◆ objfpy_set_type_printers()

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

Definition at line 394 of file py-objfile.c.

References objfile_object::type_printers, and value.

Variable Documentation

◆ objfile_getset

gdb_PyGetSetDef objfile_getset[]
static
Initial value:
=
{
{ "__dict__", gdb_py_generic_dict, NULL,
"The __dict__ for this objfile.", &objfile_object_type },
{ "filename", objfpy_get_filename, NULL,
"The objfile's filename, or None.", NULL },
{ "username", objfpy_get_username, NULL,
"The name of the objfile as provided by the user, or None.", NULL },
{ "owner", objfpy_get_owner, NULL,
"The objfile owner of separate debug info objfiles, or None.",
NULL },
{ "build_id", objfpy_get_build_id, NULL,
"The objfile's build id, or None.", NULL },
{ "progspace", objfpy_get_progspace, NULL,
"The objfile's progspace, or None.", NULL },
"Pretty printers.", NULL },
{ "frame_filters", objfpy_get_frame_filters,
objfpy_set_frame_filters, "Frame Filters.", NULL },
{ "frame_unwinders", objfpy_get_frame_unwinders,
objfpy_set_frame_unwinders, "Frame Unwinders", NULL },
"Type printers.", NULL },
{ "xmethods", objfpy_get_xmethods, NULL,
"Debug methods.", NULL },
{ "is_file", objfpy_get_is_file, nullptr,
"Whether this objfile came from a file.", nullptr },
{ NULL }
}
static int objfpy_set_printers(PyObject *o, PyObject *value, void *ignore)
Definition py-objfile.c:264
static int objfpy_set_frame_unwinders(PyObject *o, PyObject *unwinders, void *ignore)
Definition py-objfile.c:343
static PyObject * objfpy_get_owner(PyObject *self, void *closure)
Definition py-objfile.c:134
PyTypeObject objfile_object_type
Definition py-objfile.c:775
static PyObject * objfpy_get_build_id(PyObject *self, void *closure)
Definition py-objfile.c:151
static int objfpy_set_type_printers(PyObject *o, PyObject *value, void *ignore)
Definition py-objfile.c:394
PyObject * objfpy_get_frame_filters(PyObject *o, void *ignore)
Definition py-objfile.c:293
static PyObject * objfpy_get_username(PyObject *self, void *closure)
Definition py-objfile.c:104
PyObject * objfpy_get_xmethods(PyObject *o, void *ignore)
Definition py-objfile.c:383
PyObject * objfpy_get_printers(PyObject *o, void *ignore)
Definition py-objfile.c:255
static PyObject * objfpy_get_is_file(PyObject *o, void *ignore)
Definition py-objfile.c:121
PyObject * objfpy_get_frame_unwinders(PyObject *o, void *ignore)
Definition py-objfile.c:332
static PyObject * objfpy_get_filename(PyObject *self, void *closure)
Definition py-objfile.c:90
static PyObject * objfpy_get_type_printers(PyObject *o, void *ignore)
Definition py-objfile.c:372
static PyObject * objfpy_get_progspace(PyObject *self, void *closure)
Definition py-objfile.c:181
static int objfpy_set_frame_filters(PyObject *o, PyObject *filters, void *ignore)
Definition py-objfile.c:303
PyObject * gdb_py_generic_dict(PyObject *self, void *closure)
Definition py-utils.c:317

Definition at line 745 of file py-objfile.c.

◆ objfile_object_methods

PyMethodDef objfile_object_methods[]
static
Initial value:
=
{
{ "is_valid", objfpy_is_valid, METH_NOARGS,
"is_valid () -> Boolean.\n\
Return true if this object file is valid, false if not." },
{ "add_separate_debug_file", (PyCFunction) objfpy_add_separate_debug_file,
METH_VARARGS | METH_KEYWORDS,
"add_separate_debug_file (file_name).\n\
Add FILE_NAME to the list of files containing debug info for the objfile." },
{ "lookup_global_symbol", (PyCFunction) objfpy_lookup_global_symbol,
METH_VARARGS | METH_KEYWORDS,
"lookup_global_symbol (name [, domain]).\n\
Look up a global symbol in this objfile and return it." },
{ "lookup_static_symbol", (PyCFunction) objfpy_lookup_static_symbol,
METH_VARARGS | METH_KEYWORDS,
"lookup_static_symbol (name [, domain]).\n\
Look up a static-linkage global symbol in this objfile and return it." },
{ NULL }
}
static PyObject * objfpy_lookup_global_symbol(PyObject *self, PyObject *args, PyObject *kw)
Definition py-objfile.c:466
static PyObject * objfpy_lookup_static_symbol(PyObject *self, PyObject *args, PyObject *kw)
Definition py-objfile.c:500
static PyObject * objfpy_add_separate_debug_file(PyObject *self, PyObject *args, PyObject *kw)
Definition py-objfile.c:437
static PyObject * objfpy_is_valid(PyObject *self, PyObject *args)
Definition py-objfile.c:424

Definition at line 721 of file py-objfile.c.

◆ objfile_object_type

PyTypeObject objfile_object_type

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

Referenced by gdbpy_initialize_objfile(), and objfile_to_objfile_object().

◆ objfpy_objfile_data_key

const registry<objfile>::key<objfile_object, objfpy_deleter> objfpy_objfile_data_key
static

Definition at line 72 of file py-objfile.c.

Referenced by objfile_to_objfile_object().