GDB (xrefs)
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 "py-ref.h"

Go to the source code of this file.

Classes

struct  objfile_object
 

Macros

#define OBJFPY_REQUIRE_VALID(obj)
 

Functions

PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("objfile_object")
 
static PyObject * objfpy_get_filename (PyObject *self, void *closure)
 
static PyObject * objfpy_get_username (PyObject *self, void *closure)
 
static PyObject * objfpy_get_owner (PyObject *self, void *closure)
 
static PyObject * objfpy_get_build_id (PyObject *self, void *closure)
 
static PyObject * objfpy_get_progspace (PyObject *self, void *closure)
 
static void objfpy_dealloc (PyObject *o)
 
static int objfpy_initialize (objfile_object *self)
 
static PyObject * objfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
 
PyObject * objfpy_get_printers (PyObject *o, void *ignore)
 
static int objfpy_set_printers (PyObject *o, PyObject *value, void *ignore)
 
PyObject * objfpy_get_frame_filters (PyObject *o, void *ignore)
 
static int objfpy_set_frame_filters (PyObject *o, PyObject *filters, void *ignore)
 
PyObject * objfpy_get_frame_unwinders (PyObject *o, void *ignore)
 
static int objfpy_set_frame_unwinders (PyObject *o, PyObject *unwinders, void *ignore)
 
static PyObject * objfpy_get_type_printers (PyObject *o, void *ignore)
 
PyObject * objfpy_get_xmethods (PyObject *o, void *ignore)
 
static int objfpy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
 
static PyObject * objfpy_is_valid (PyObject *self, PyObject *args)
 
static PyObject * objfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
 
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)
 
static struct objfileobjfpy_lookup_objfile_by_name (const char *name)
 
static struct objfileobjfpy_lookup_objfile_by_build_id (const char *build_id)
 
PyObject * gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 
static void py_free_objfile (struct objfile *objfile, void *datum)
 
PyObject * objfile_to_objfile_object (struct objfile *objfile)
 
int gdbpy_initialize_objfile (void)
 

Variables

static const struct objfile_data * objfpy_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)
#define _(String)
Definition: gdb_locale.h:35

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

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

Function Documentation

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "objfile_object"  )

◆ gdbpy_initialize_objfile()

int gdbpy_initialize_objfile ( void  )

◆ gdbpy_lookup_objfile()

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

◆ objfile_to_objfile_object()

PyObject* 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 482 of file py-objfile.c.

References host_hex_value().

Referenced by objfpy_lookup_objfile_by_build_id().

◆ objfpy_build_id_ok()

static int objfpy_build_id_ok ( const char *  string)
static

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

Referenced by gdbpy_lookup_objfile().

◆ objfpy_dealloc()

static void objfpy_dealloc ( PyObject *  o)
static

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

References Py_TYPE.

◆ 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 283 of file py-objfile.c.

◆ objfpy_get_frame_unwinders()

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

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

◆ 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 243 of file py-objfile.c.

Referenced by find_pretty_printer_from_objfiles().

◆ objfpy_get_progspace()

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

Definition at line 164 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 366 of file py-objfile.c.

◆ 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 377 of file py-objfile.c.

Referenced by gdbpy_get_matching_xmethod_workers().

◆ objfpy_initialize()

static int objfpy_initialize ( objfile_object self)
static

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

Referenced by objfile_to_objfile_object(), and objfpy_new().

◆ objfpy_is_valid()

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

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

References objfile_object::objfile.

◆ objfpy_lookup_objfile_by_build_id()

static struct objfile* objfpy_lookup_objfile_by_build_id ( const char *  build_id)
static

◆ objfpy_lookup_objfile_by_name()

static struct objfile* objfpy_lookup_objfile_by_name ( const char *  name)
static

◆ objfpy_new()

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

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

References objfpy_initialize(), and gdb::ref_ptr< T, Policy >::release().

◆ objfpy_set_frame_filters()

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

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

References _.

◆ objfpy_set_frame_unwinders()

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

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

References _.

◆ objfpy_set_printers()

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

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

References _.

◆ objfpy_set_type_printers()

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

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

References _.

◆ py_free_objfile()

static void py_free_objfile ( struct objfile objfile,
void *  datum 
)
static

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

References current_language, and get_objfile_arch().

Referenced by gdbpy_initialize_objfile().

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 },
{ NULL }
}
PyObject * gdb_py_generic_dict(PyObject *self, void *closure)
Definition: py-utils.c:359
static int objfpy_set_frame_unwinders(PyObject *o, PyObject *unwinders, void *ignore)
Definition: py-objfile.c:335
static int objfpy_set_type_printers(PyObject *o, PyObject *value, void *ignore)
Definition: py-objfile.c:388
PyObject * objfpy_get_xmethods(PyObject *o, void *ignore)
Definition: py-objfile.c:377
static PyObject * objfpy_get_username(PyObject *self, void *closure)
Definition: py-objfile.c:90
static PyObject * objfpy_get_owner(PyObject *self, void *closure)
Definition: py-objfile.c:108
static PyObject * objfpy_get_filename(PyObject *self, void *closure)
Definition: py-objfile.c:77
PyObject * objfpy_get_frame_unwinders(PyObject *o, void *ignore)
Definition: py-objfile.c:324
static PyObject * objfpy_get_type_printers(PyObject *o, void *ignore)
Definition: py-objfile.c:366
static int objfpy_set_printers(PyObject *o, PyObject *value, void *ignore)
Definition: py-objfile.c:252
PyObject * objfpy_get_printers(PyObject *o, void *ignore)
Definition: py-objfile.c:243
PyObject * objfpy_get_frame_filters(PyObject *o, void *ignore)
Definition: py-objfile.c:283
static PyObject * objfpy_get_progspace(PyObject *self, void *closure)
Definition: py-objfile.c:164
PyTypeObject objfile_object_type
Definition: py-objfile.c:701
static PyObject * objfpy_get_build_id(PyObject *self, void *closure)
Definition: py-objfile.c:130
static int objfpy_set_frame_filters(PyObject *o, PyObject *filters, void *ignore)
Definition: py-objfile.c:293

Definition at line 673 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." },
{ NULL }
}
static PyObject * objfpy_is_valid(PyObject *self, PyObject *args)
Definition: py-objfile.c:420
static PyObject * objfpy_add_separate_debug_file(PyObject *self, PyObject *args, PyObject *kw)
Definition: py-objfile.c:433

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

◆ objfile_object_type

PyTypeObject objfile_object_type

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

Referenced by gdbpy_initialize_objfile(), and objfile_to_objfile_object().

◆ objfpy_objfile_data_key

const struct objfile_data* objfpy_objfile_data_key
static

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

Referenced by gdbpy_initialize_objfile(), and objfile_to_objfile_object().