GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
py-arch.c File Reference
#include "defs.h"
#include "gdbarch.h"
#include "arch-utils.h"
#include "disasm.h"
#include "python-internal.h"

Go to the source code of this file.

Classes

struct  arch_object_type_object
 

Macros

#define ARCHPY_REQUIRE_VALID(arch_obj, arch)
 

Typedefs

typedef struct arch_object_type_object arch_object
 

Functions

PyTypeObject arch_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("arch_object")
 
static void * arch_object_data_init (struct gdbarch *gdbarch)
 
struct gdbarcharch_object_to_gdbarch (PyObject *obj)
 
PyObject * gdbarch_to_arch_object (struct gdbarch *gdbarch)
 
static PyObject * archpy_name (PyObject *self, PyObject *args)
 
static PyObject * archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
 
int gdbpy_initialize_arch (void)
 

Variables

static struct gdbarch_dataarch_object_data = NULL
 
static PyMethodDef arch_object_methods []
 
PyTypeObject arch_object_type
 

Macro Definition Documentation

#define ARCHPY_REQUIRE_VALID (   arch_obj,
  arch 
)
Value:
do { \
arch = arch_object_to_gdbarch (arch_obj); \
if (arch == NULL) \
{ \
PyErr_SetString (PyExc_RuntimeError, \
_("Architecture is invalid.")); \
return NULL; \
} \
} while (0)
struct gdbarch * arch_object_to_gdbarch(PyObject *obj)
Definition: py-arch.c:68
#define _(String)
Definition: gdb_locale.h:40
return
Definition: gnu-nat.c:1865

Definition at line 34 of file py-arch.c.

Referenced by archpy_disassemble(), and archpy_name().

Typedef Documentation

Function Documentation

static void* arch_object_data_init ( struct gdbarch gdbarch)
static

Definition at line 52 of file py-arch.c.

References arch_object_type, and arch_object_type_object::gdbarch.

Referenced by gdbpy_initialize_arch().

struct gdbarch* arch_object_to_gdbarch ( PyObject *  obj)

Definition at line 68 of file py-arch.c.

References arch_object_type_object::gdbarch.

static PyObject* archpy_disassemble ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static
static PyObject* archpy_name ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 95 of file py-arch.c.

References ARCHPY_REQUIRE_VALID, gdbarch_bfd_arch_info(), and name.

PyTypeObject arch_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "arch_object"  )
PyObject* gdbarch_to_arch_object ( struct gdbarch gdbarch)

Definition at line 80 of file py-arch.c.

Referenced by frapy_arch().

int gdbpy_initialize_arch ( void  )

Variable Documentation

struct gdbarch_data* arch_object_data = NULL
static

Definition at line 31 of file py-arch.c.

PyMethodDef arch_object_methods[]
static
Initial value:
= {
{ "name", archpy_name, METH_NOARGS,
"name () -> String.\n\
Return the name of the architecture as a string value." },
{ "disassemble", (PyCFunction) archpy_disassemble,
METH_VARARGS | METH_KEYWORDS,
"disassemble (start_pc [, end_pc [, count]]) -> List.\n\
Return a list of at most COUNT disassembled instructions from START_PC to\n\
END_PC." },
{NULL}
}
static PyObject * archpy_disassemble(PyObject *self, PyObject *args, PyObject *kw)
Definition: py-arch.c:116
static PyObject * archpy_name(PyObject *self, PyObject *args)
Definition: py-arch.c:95

Definition at line 272 of file py-arch.c.

PyTypeObject arch_object_type

Definition at line 284 of file py-arch.c.

Referenced by arch_object_data_init(), and gdbpy_initialize_arch().