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"

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 PyGetSetDef objfile_getset []
 
PyTypeObject objfile_object_type
 

Macro Definition Documentation

#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:40
return
Definition: gnu-nat.c:1865

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

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

Function Documentation

PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "objfile_object"  )
int gdbpy_initialize_objfile ( void  )
PyObject* gdbpy_lookup_objfile ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
PyObject* objfile_to_objfile_object ( struct objfile objfile)
static PyObject* objfpy_add_separate_debug_file ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static
static int objfpy_build_id_matches ( const struct bfd_build_id *  build_id,
const char *  string 
)
static

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

References host_hex_value().

Referenced by objfpy_lookup_objfile_by_build_id().

static int objfpy_build_id_ok ( const char *  string)
static

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

Referenced by gdbpy_lookup_objfile().

static void objfpy_dealloc ( PyObject *  o)
static

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

References Py_TYPE.

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

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

References host_charset(), objfile_object::objfile, and objfile_name().

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

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

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

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

static PyObject* objfpy_get_owner ( PyObject *  self,
void *  closure 
)
static
PyObject* objfpy_get_printers ( PyObject *  o,
void *  ignore 
)

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

Referenced by find_pretty_printer_from_objfiles().

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

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

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

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

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

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

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

References host_charset(), objfile_object::objfile, and objfile::original_name.

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

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

Referenced by gdbpy_get_matching_xmethod_workers().

static int objfpy_initialize ( objfile_object self)
static

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

Referenced by objfile_to_objfile_object(), and objfpy_new().

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

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

References objfile_object::objfile.

static struct objfile* objfpy_lookup_objfile_by_build_id ( const char *  build_id)
static
static struct objfile* objfpy_lookup_objfile_by_name ( const char *  name)
static
static PyObject* objfpy_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  keywords 
)
static

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

References objfpy_initialize(), and Py_DECREF.

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

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

References _.

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

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

References _.

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

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

References _.

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

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

References _.

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

Variable Documentation

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:420
static int objfpy_set_frame_unwinders(PyObject *o, PyObject *unwinders, void *ignore)
Definition: py-objfile.c:338
static int objfpy_set_type_printers(PyObject *o, PyObject *value, void *ignore)
Definition: py-objfile.c:391
PyObject * objfpy_get_xmethods(PyObject *o, void *ignore)
Definition: py-objfile.c:380
static PyObject * objfpy_get_username(PyObject *self, void *closure)
Definition: py-objfile.c:91
static PyObject * objfpy_get_owner(PyObject *self, void *closure)
Definition: py-objfile.c:110
static PyObject * objfpy_get_filename(PyObject *self, void *closure)
Definition: py-objfile.c:76
PyObject * objfpy_get_frame_unwinders(PyObject *o, void *ignore)
Definition: py-objfile.c:327
static PyObject * objfpy_get_type_printers(PyObject *o, void *ignore)
Definition: py-objfile.c:369
static int objfpy_set_printers(PyObject *o, PyObject *value, void *ignore)
Definition: py-objfile.c:255
PyObject * objfpy_get_printers(PyObject *o, void *ignore)
Definition: py-objfile.c:246
PyObject * objfpy_get_frame_filters(PyObject *o, void *ignore)
Definition: py-objfile.c:286
static PyObject * objfpy_get_progspace(PyObject *self, void *closure)
Definition: py-objfile.c:167
PyTypeObject objfile_object_type
Definition: py-objfile.c:713
static PyObject * objfpy_get_build_id(PyObject *self, void *closure)
Definition: py-objfile.c:132
static int objfpy_set_frame_filters(PyObject *o, PyObject *filters, void *ignore)
Definition: py-objfile.c:296

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

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:423
static PyObject * objfpy_add_separate_debug_file(PyObject *self, PyObject *args, PyObject *kw)
Definition: py-objfile.c:436

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

PyTypeObject objfile_object_type

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

Referenced by gdbpy_initialize_objfile(), and objfile_to_objfile_object().

const struct objfile_data* objfpy_objfile_data_key
static

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

Referenced by gdbpy_initialize_objfile(), and objfile_to_objfile_object().