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"
#include "py-ref.h"

Go to the source code of this file.

Classes

struct  pending_frame_object
 
struct  saved_reg
 
struct  unwind_info_object
 
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 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

◆ TRACE_PY_UNWIND

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

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

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

Function Documentation

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF() [1/2]

PyTypeObject pending_frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "pending_frame_object"  )

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF() [2/2]

PyTypeObject unwind_info_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "unwind_info_object"  )

◆ DEF_VEC_O()

DEF_VEC_O ( saved_reg  )

◆ gdbpy_initialize_unwind()

int gdbpy_initialize_unwind ( void  )

◆ pending_framepy_create_unwind_info()

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

◆ pending_framepy_read_register()

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

◆ pending_framepy_str()

static PyObject* pending_framepy_str ( PyObject *  self)
static

◆ pyuw_create_unwind_info()

static PyObject* pyuw_create_unwind_info ( PyObject *  pyo_pending_frame,
struct frame_id  frame_id 
)
static

◆ pyuw_dealloc_cache()

static void pyuw_dealloc_cache ( struct frame_info this_frame,
void *  cache 
)
static

◆ pyuw_gdbarch_data_init()

static void* pyuw_gdbarch_data_init ( struct gdbarch gdbarch)
static

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

References GDBARCH_OBSTACK_ZALLOC.

Referenced by gdbpy_initialize_unwind().

◆ pyuw_object_attribute_to_pointer()

static int pyuw_object_attribute_to_pointer ( PyObject *  pyo,
const char *  attr_name,
CORE_ADDR addr 
)
static

◆ pyuw_on_new_gdbarch()

static void pyuw_on_new_gdbarch ( struct gdbarch newarch)
static

◆ pyuw_parse_register_id()

static int pyuw_parse_register_id ( struct gdbarch gdbarch,
PyObject *  pyo_reg_id,
int *  reg_num 
)
static

◆ pyuw_prev_register()

static struct value* pyuw_prev_register ( struct frame_info this_frame,
void **  cache_ptr,
int  regnum 
)
static

◆ pyuw_sniffer()

static int pyuw_sniffer ( const struct frame_unwind self,
struct frame_info this_frame,
void **  cache_ptr 
)
static

◆ pyuw_this_id()

static void pyuw_this_id ( struct frame_info this_frame,
void **  cache_ptr,
struct frame_id this_id 
)
static

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

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

Referenced by pyuw_on_new_gdbarch().

◆ pyuw_value_obj_to_pointer()

static int pyuw_value_obj_to_pointer ( PyObject *  pyo_value,
CORE_ADDR addr 
)
static

◆ unwind_infopy_add_saved_register()

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

◆ unwind_infopy_dealloc()

static void unwind_infopy_dealloc ( PyObject *  self)
static

◆ unwind_infopy_str()

static PyObject* unwind_infopy_str ( PyObject *  self)
static

Variable Documentation

◆ pending_frame_object_methods

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:421
static PyObject * pending_framepy_read_register(PyObject *self, PyObject *args)
Definition: py-unwind.c:374

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

◆ pending_frame_object_type

PyTypeObject pending_frame_object_type

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

Referenced by gdbpy_initialize_unwind(), and pyuw_sniffer().

◆ pyuw_debug

unsigned int pyuw_debug = 0
static

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

Referenced by gdbpy_initialize_unwind(), and pyuw_this_id().

◆ pyuw_gdbarch_data

struct gdbarch_data* pyuw_gdbarch_data
static

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

Referenced by gdbpy_initialize_unwind(), and pyuw_on_new_gdbarch().

◆ unwind_info_object_methods

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:260

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

◆ unwind_info_object_type

PyTypeObject unwind_info_object_type

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

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