GDB (xrefs)
Classes | Macros | Functions | Variables
py-unwind.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "frame-unwind.h"
#include "gdb_obstack.h"
#include "gdbcmd.h"
#include "language.h"
#include "observer.h"
#include "python-internal.h"
#include "regcache.h"
#include "valprint.h"
#include "user-regs.h"

Go to the source code of this file.

Classes

struct  pending_frame_object
 
struct  saved_reg
 
struct  unwind_info_object
 
struct  reg_info
 
struct  cached_frame_info
 
struct  pyuw_gdbarch_data_type
 

Macros

#define TRACE_PY_UNWIND(level, args...)
 

Functions

 DEF_VEC_O (saved_reg)
 
PyTypeObject pending_frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("pending_frame_object")
 
PyTypeObject unwind_info_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("unwind_info_object")
 
static int pyuw_parse_register_id (struct gdbarch *gdbarch, PyObject *pyo_reg_id, int *reg_num)
 
static int pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
 
static int pyuw_object_attribute_to_pointer (PyObject *pyo, const char *attr_name, CORE_ADDR *addr)
 
static PyObject * unwind_infopy_str (PyObject *self)
 
static PyObject * pyuw_create_unwind_info (PyObject *pyo_pending_frame, struct frame_id frame_id)
 
static PyObject * unwind_infopy_add_saved_register (PyObject *self, PyObject *args)
 
static void unwind_infopy_dealloc (PyObject *self)
 
static PyObject * pending_framepy_str (PyObject *self)
 
static PyObject * pending_framepy_read_register (PyObject *self, PyObject *args)
 
static PyObject * pending_framepy_create_unwind_info (PyObject *self, PyObject *args)
 
static void pending_frame_invalidate (void *pyo_pending_frame)
 
static void pyuw_this_id (struct frame_info *this_frame, void **cache_ptr, struct frame_id *this_id)
 
static struct valuepyuw_prev_register (struct frame_info *this_frame, void **cache_ptr, int regnum)
 
static int pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **cache_ptr)
 
static void pyuw_dealloc_cache (struct frame_info *this_frame, void *cache)
 
static void * pyuw_gdbarch_data_init (struct gdbarch *gdbarch)
 
static void pyuw_on_new_gdbarch (struct gdbarch *newarch)
 
int gdbpy_initialize_unwind (void)
 

Variables

static unsigned int pyuw_debug = 0
 
static struct gdbarch_datapyuw_gdbarch_data
 
static PyMethodDef pending_frame_object_methods []
 
PyTypeObject pending_frame_object_type
 
static PyMethodDef unwind_info_object_methods []
 
PyTypeObject unwind_info_object_type
 

Macro Definition Documentation

#define TRACE_PY_UNWIND (   level,
  args... 
)
Value:
if (pyuw_debug >= level) \
static unsigned int pyuw_debug
Definition: py-unwind.c:104
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2361
struct ui_file * gdb_stdlog
Definition: main.c:73

Definition at line 32 of file py-unwind.c.

Referenced by pyuw_dealloc_cache(), pyuw_prev_register(), and pyuw_sniffer().

Function Documentation

PyTypeObject pending_frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "pending_frame_object"  )
PyTypeObject unwind_info_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "unwind_info_object"  )
DEF_VEC_O ( saved_reg  )
int gdbpy_initialize_unwind ( void  )
static void pending_frame_invalidate ( void *  pyo_pending_frame)
static

Definition at line 474 of file py-unwind.c.

Referenced by pyuw_sniffer().

static PyObject* pending_framepy_create_unwind_info ( PyObject *  self,
PyObject *  args 
)
static
static PyObject* pending_framepy_read_register ( PyObject *  self,
PyObject *  args 
)
static
static PyObject* pending_framepy_str ( PyObject *  self)
static
static PyObject* pyuw_create_unwind_info ( PyObject *  pyo_pending_frame,
struct frame_id  frame_id 
)
static
static void pyuw_dealloc_cache ( struct frame_info this_frame,
void *  cache 
)
static

Definition at line 613 of file py-unwind.c.

References TRACE_PY_UNWIND, and xfree().

Referenced by pyuw_on_new_gdbarch().

static void* pyuw_gdbarch_data_init ( struct gdbarch gdbarch)
static

Definition at line 626 of file py-unwind.c.

References GDBARCH_OBSTACK_ZALLOC.

Referenced by gdbpy_initialize_unwind().

static int pyuw_object_attribute_to_pointer ( PyObject *  pyo,
const char *  attr_name,
CORE_ADDR addr 
)
static
static void pyuw_on_new_gdbarch ( struct gdbarch newarch)
static
static int pyuw_parse_register_id ( struct gdbarch gdbarch,
PyObject *  pyo_reg_id,
int reg_num 
)
static
static struct value* pyuw_prev_register ( struct frame_info this_frame,
void **  cache_ptr,
int  regnum 
)
static
static int pyuw_sniffer ( const struct frame_unwind self,
struct frame_info this_frame,
void **  cache_ptr 
)
static
static void pyuw_this_id ( struct frame_info this_frame,
void **  cache_ptr,
struct frame_id this_id 
)
static

Definition at line 483 of file py-unwind.c.

References fprint_frame_id(), fprintf_unfiltered(), gdb_stdlog, and pyuw_debug.

Referenced by pyuw_on_new_gdbarch().

static int pyuw_value_obj_to_pointer ( PyObject *  pyo_value,
CORE_ADDR addr 
)
static
static PyObject* unwind_infopy_add_saved_register ( PyObject *  self,
PyObject *  args 
)
static
static void unwind_infopy_dealloc ( PyObject *  self)
static
static PyObject* unwind_infopy_str ( PyObject *  self)
static

Variable Documentation

PyMethodDef pending_frame_object_methods[]
static
Initial value:
=
{
{ "read_register", pending_framepy_read_register, METH_VARARGS,
"read_register (REG) -> gdb.Value\n"
"Return the value of the REG in the frame." },
{ "create_unwind_info",
"create_unwind_info (FRAME_ID) -> gdb.UnwindInfo\n"
"Construct UnwindInfo for this PendingFrame, using FRAME_ID\n"
"to identify it." },
{NULL}
}
static PyObject * pending_framepy_create_unwind_info(PyObject *self, PyObject *args)
Definition: py-unwind.c:437
static PyObject * pending_framepy_read_register(PyObject *self, PyObject *args)
Definition: py-unwind.c:395

Definition at line 688 of file py-unwind.c.

PyTypeObject pending_frame_object_type

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

Referenced by gdbpy_initialize_unwind(), and pyuw_sniffer().

unsigned int pyuw_debug = 0
static

Definition at line 104 of file py-unwind.c.

Referenced by gdbpy_initialize_unwind(), and pyuw_this_id().

struct gdbarch_data* pyuw_gdbarch_data
static

Definition at line 106 of file py-unwind.c.

PyMethodDef unwind_info_object_methods[]
static
Initial value:
=
{
{ "add_saved_register",
"add_saved_register (REG, VALUE) -> None\n"
"Set the value of the REG in the previous frame to VALUE." },
{ NULL }
}
static PyObject * unwind_infopy_add_saved_register(PyObject *self, PyObject *args)
Definition: py-unwind.c:281

Definition at line 742 of file py-unwind.c.

PyTypeObject unwind_info_object_type

Definition at line 751 of file py-unwind.c.

Referenced by gdbpy_initialize_unwind(), pyuw_create_unwind_info(), and pyuw_sniffer().