GDB (API)
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/python/python-internal.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <Python.h>
#include <frameobject.h>
#include "symtab.h"
#include "command.h"
#include "breakpoint.h"
#include "exceptions.h"

Go to the source code of this file.

Classes

struct  breakpoint_object
struct  thread_object

Defines

#define CPYCHECKER_RETURNS_BORROWED_REF
#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG)
#define CPYCHECKER_STEALS_REFERENCE_TO_ARG(n)
#define CPYCHECKER_SETS_EXCEPTION
#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
#define PY_SSIZE_T_CLEAN
#define PyGILState_Ensure()   ((PyGILState_STATE) 0)
#define PyGILState_Release(ARG)   ((void)(ARG))
#define PyEval_InitThreads()
#define PyThreadState_Swap(ARG)   ((void)(ARG))
#define PyEval_ReleaseLock()
#define GDB_PY_LL_ARG   "L"
#define GDB_PY_LLU_ARG   "K"
#define gdb_py_long_from_longest   PyLong_FromLong
#define gdb_py_long_from_ulongest   PyLong_FromUnsignedLong
#define gdb_py_long_as_ulongest   PyLong_AsUnsignedLong
#define Py_DECREF(op)   gdb_Py_DECREF (op)
#define BPPY_REQUIRE_VALID(Breakpoint)
#define BPPY_SET_REQUIRE_VALID(Breakpoint)
#define GDB_PY_HANDLE_EXCEPTION(Exception)
#define GDB_PY_SET_HANDLE_EXCEPTION(Exception)

Typedefs

typedef long gdb_py_longest
typedef unsigned long gdb_py_ulongest
typedef struct breakpoint_object breakpoint_object

Enumerations

enum  gdbpy_iter_kind { iter_keys, iter_values, iter_items }

Functions

PyTypeObject value_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("value_object")
PyTypeObject block_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("block_object")
PyTypeObject symbol_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("symbol_object")
PyTypeObject event_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object")
PyTypeObject breakpoint_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("breakpoint_object")
PyTypeObject frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("frame_object")
PyObjectgdbpy_history (PyObject *self, PyObject *args)
PyObjectgdbpy_breakpoints (PyObject *, PyObject *)
PyObjectgdbpy_frame_stop_reason_string (PyObject *, PyObject *)
PyObjectgdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
PyObjectgdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
PyObjectgdbpy_newest_frame (PyObject *self, PyObject *args)
PyObjectgdbpy_selected_frame (PyObject *self, PyObject *args)
PyObjectgdbpy_block_for_pc (PyObject *self, PyObject *args)
PyObjectgdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw)
PyObjectgdbpy_create_lazy_string_object (CORE_ADDR address, long length, const char *encoding, struct type *type)
PyObjectgdbpy_inferiors (PyObject *unused, PyObject *unused2)
PyObjectgdbpy_selected_thread (PyObject *self, PyObject *args)
PyObjectgdbpy_selected_inferior (PyObject *self, PyObject *args)
PyObjectgdbpy_string_to_argv (PyObject *self, PyObject *args)
PyObjectgdbpy_parameter (PyObject *self, PyObject *args)
PyObjectgdbpy_parameter_value (enum var_types type, void *var)
char * gdbpy_parse_command_name (const char *name, struct cmd_list_element ***base_list, struct cmd_list_element **start_list)
PyObjectsymtab_and_line_to_sal_object (struct symtab_and_line sal)
PyObjectsymtab_to_symtab_object (struct symtab *symtab)
PyObjectsymbol_to_symbol_object (struct symbol *sym)
PyObjectblock_to_block_object (const struct block *block, struct objfile *objfile)
PyObjectvalue_to_value_object (struct value *v)
PyObjecttype_to_type_object (struct type *)
PyObjectframe_info_to_frame_object (struct frame_info *frame)
PyObjectpspace_to_pspace_object (struct program_space *) CPYCHECKER_RETURNS_BORROWED_REF
PyObjectpspy_get_printers (PyObject *, void *)
PyObjectpspy_get_frame_filters (PyObject *, void *)
PyObjectobjfile_to_objfile_object (struct objfile *) CPYCHECKER_RETURNS_BORROWED_REF
PyObjectobjfpy_get_printers (PyObject *, void *)
PyObjectobjfpy_get_frame_filters (PyObject *, void *)
PyObjectgdbarch_to_arch_object (struct gdbarch *gdbarch)
thread_objectcreate_thread_object (struct thread_info *tp)
thread_objectfind_thread_object (ptid_t ptid) CPYCHECKER_RETURNS_BORROWED_REF
PyObjectfind_inferior_object (int pid)
PyObjectinferior_to_inferior_object (struct inferior *inferior)
struct blockblock_object_to_block (PyObject *obj)
struct symbolsymbol_object_to_symbol (PyObject *obj)
struct value * value_object_to_value (PyObject *self)
struct value * convert_value_from_python (PyObject *obj)
struct typetype_object_to_type (PyObject *obj)
struct symtabsymtab_object_to_symtab (PyObject *obj)
struct symtab_and_linesal_object_to_symtab_and_line (PyObject *obj)
struct frame_info * frame_object_to_frame_info (PyObject *frame_obj)
struct gdbarch * arch_object_to_gdbarch (PyObject *obj)
void gdbpy_initialize_gdb_readline (void)
int gdbpy_initialize_auto_load (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_values (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_frames (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_symtabs (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_commands (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_symbols (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_blocks (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_types (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_functions (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_pspace (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_objfile (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_breakpoints (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_finishbreakpoints (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_lazy_string (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_parameters (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_thread (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_inferior (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_eventregistry (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_py_events (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_stop_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_signal_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_breakpoint_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_continue_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_exited_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_thread_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_new_objfile_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
int gdbpy_initialize_arch (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
struct cleanup * make_cleanup_py_decref (PyObject *py)
struct cleanup * make_cleanup_py_xdecref (PyObject *py)
struct cleanup * ensure_python_env (struct gdbarch *gdbarch, const struct language_defn *language)
void gdbpy_print_stack (void)
void source_python_script_for_objfile (struct objfile *objfile, FILE *file, const char *filename)
PyObjectpython_string_to_unicode (PyObject *obj)
char * unicode_to_target_string (PyObject *unicode_str)
char * python_string_to_target_string (PyObject *obj)
PyObjectpython_string_to_target_python_string (PyObject *obj)
char * python_string_to_host_string (PyObject *obj)
int gdbpy_is_string (PyObject *obj)
char * gdbpy_obj_to_string (PyObject *obj)
char * gdbpy_exception_to_string (PyObject *ptype, PyObject *pvalue)
int gdbpy_is_lazy_string (PyObject *result)
void gdbpy_extract_lazy_string (PyObject *string, CORE_ADDR *addr, struct type **str_type, long *length, char **encoding)
int gdbpy_is_value_object (PyObject *obj)
PyObjectapply_varobj_pretty_printer (PyObject *print_obj, struct value **replacement, struct ui_file *stream)
PyObjectgdbpy_get_varobj_pretty_printer (struct value *value)
char * gdbpy_get_display_hint (PyObject *printer)
PyObjectgdbpy_default_visualizer (PyObject *self, PyObject *args)
void bpfinishpy_pre_stop_hook (struct breakpoint_object *bp_obj)
void bpfinishpy_post_stop_hook (struct breakpoint_object *bp_obj)
void gdbpy_convert_exception (struct gdb_exception) CPYCHECKER_SETS_EXCEPTION
int get_addr_from_python (PyObject *obj, CORE_ADDR *addr) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
PyObjectgdb_py_object_from_longest (LONGEST l)
PyObjectgdb_py_object_from_ulongest (ULONGEST l)
int gdb_py_int_as_long (PyObject *, long *)
PyObjectgdb_py_generic_dict (PyObject *self, void *closure)
int gdb_pymodule_addobject (PyObject *module, const char *name, PyObject *object) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION

Variables

int gdb_python_initialized
PyObjectgdb_module
PyObjectgdb_python_module
breakpoint_objectbppy_pending_object
struct cmd_list_elementset_python_list
struct cmd_list_elementshow_python_list
struct gdbarch * python_gdbarch
struct language_defnpython_language
PyObjectgdbpy_doc_cst
PyObjectgdbpy_children_cst
PyObjectgdbpy_to_string_cst
PyObjectgdbpy_display_hint_cst
PyObjectgdbpy_enabled_cst
PyObjectgdbpy_value_cst
PyObjectgdbpy_gdb_error
PyObjectgdbpy_gdb_memory_error
PyObjectgdbpy_gdberror_exc

Define Documentation

#define BPPY_REQUIRE_VALID (   Breakpoint)
Value:
do {                                                                \
      if ((Breakpoint)->bp == NULL)                                     \
        return PyErr_Format (PyExc_RuntimeError,                        \
                             _("Breakpoint %d is invalid."),            \
                             (Breakpoint)->number);                     \
    } while (0)

Definition at line 243 of file python-internal.h.

#define BPPY_SET_REQUIRE_VALID (   Breakpoint)
Value:
do {                                                                \
      if ((Breakpoint)->bp == NULL)                                     \
        {                                                               \
          PyErr_Format (PyExc_RuntimeError, _("Breakpoint %d is invalid."), \
                        (Breakpoint)->number);                          \
          return -1;                                                    \
        }                                                               \
    } while (0)

Definition at line 253 of file python-internal.h.

Definition at line 60 of file python-internal.h.

Definition at line 33 of file python-internal.h.

Definition at line 53 of file python-internal.h.

Definition at line 47 of file python-internal.h.

Definition at line 40 of file python-internal.h.

#define GDB_PY_HANDLE_EXCEPTION (   Exception)
Value:
do {                                            \
    if (Exception.reason < 0)                   \
      {                                         \
        gdbpy_convert_exception (Exception);    \
        return NULL;                            \
      }                                         \
  } while (0)

Definition at line 414 of file python-internal.h.

#define GDB_PY_LL_ARG   "L"

Definition at line 162 of file python-internal.h.

#define GDB_PY_LLU_ARG   "K"

Definition at line 163 of file python-internal.h.

#define gdb_py_long_as_ulongest   PyLong_AsUnsignedLong

Definition at line 168 of file python-internal.h.

#define gdb_py_long_from_longest   PyLong_FromLong

Definition at line 166 of file python-internal.h.

#define gdb_py_long_from_ulongest   PyLong_FromUnsignedLong

Definition at line 167 of file python-internal.h.

#define GDB_PY_SET_HANDLE_EXCEPTION (   Exception)
Value:
do {                                                            \
      if (Exception.reason < 0)                                         \
        {                                                               \
          gdbpy_convert_exception (Exception);                          \
          return -1;                                                    \
        }                                                               \
    } while (0)

Definition at line 425 of file python-internal.h.

#define Py_DECREF (   op)    gdb_Py_DECREF (op)

Definition at line 186 of file python-internal.h.

Definition at line 90 of file python-internal.h.

#define PyEval_InitThreads ( )

Definition at line 142 of file python-internal.h.

#define PyEval_ReleaseLock ( )

Definition at line 144 of file python-internal.h.

#define PyGILState_Ensure ( )    ((PyGILState_STATE) 0)

Definition at line 140 of file python-internal.h.

#define PyGILState_Release (   ARG)    ((void)(ARG))

Definition at line 141 of file python-internal.h.

#define PyThreadState_Swap (   ARG)    ((void)(ARG))

Definition at line 143 of file python-internal.h.


Typedef Documentation

typedef long gdb_py_longest

Definition at line 164 of file python-internal.h.

typedef unsigned long gdb_py_ulongest

Definition at line 165 of file python-internal.h.


Enumeration Type Documentation

Enumerator:
iter_keys 
iter_values 
iter_items 

Definition at line 198 of file python-internal.h.


Function Documentation

PyObject* apply_varobj_pretty_printer ( PyObject print_obj,
struct value **  replacement,
struct ui_file *  stream 
)
struct gdbarch* arch_object_to_gdbarch ( PyObject obj) [read]

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

struct block* block_object_to_block ( PyObject obj) [read]

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

PyObject* block_to_block_object ( const struct block block,
struct objfile objfile 
)

Definition at line 271 of file py-block.c.

void bpfinishpy_post_stop_hook ( struct breakpoint_object bp_obj)

Definition at line 136 of file py-finishbreakpoint.c.

void bpfinishpy_pre_stop_hook ( struct breakpoint_object bp_obj)

Definition at line 93 of file py-finishbreakpoint.c.

struct value* convert_value_from_python ( PyObject obj) [read]
PyTypeObject value_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "value_object"  )
PyTypeObject block_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "block_object"  )
PyTypeObject symbol_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "symbol_object"  )
PyTypeObject event_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "event_object"  )
PyTypeObject breakpoint_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "breakpoint_object"  )
PyTypeObject frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "frame_object"  )

Definition at line 43 of file py-infthread.c.

struct cleanup* ensure_python_env ( struct gdbarch *  gdbarch,
const struct language_defn language 
) [read]

Definition at line 195 of file py-inferior.c.

Definition at line 206 of file py-inferior.c.

PyObject* frame_info_to_frame_object ( struct frame_info *  frame)

Definition at line 307 of file py-frame.c.

struct frame_info* frame_object_to_frame_info ( PyObject frame_obj) [read]

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

PyObject* gdb_py_generic_dict ( PyObject self,
void *  closure 
)

Definition at line 417 of file py-utils.c.

int gdb_py_int_as_long ( PyObject ,
long *   
)

Definition at line 404 of file py-utils.c.

Definition at line 357 of file py-utils.c.

Definition at line 379 of file py-utils.c.

int gdb_pymodule_addobject ( PyObject module,
const char *  name,
PyObject object 
)

Definition at line 434 of file py-utils.c.

PyObject* gdbarch_to_arch_object ( struct gdbarch *  gdbarch)

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

PyObject* gdbpy_block_for_pc ( PyObject self,
PyObject args 
)

Definition at line 371 of file py-block.c.

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

Definition at line 295 of file py-utils.c.

PyObject* gdbpy_create_lazy_string_object ( CORE_ADDR  address,
long  length,
const char *  encoding,
struct type type 
)

Definition at line 128 of file py-lazy-string.c.

char* gdbpy_exception_to_string ( PyObject ptype,
PyObject pvalue 
)

Definition at line 268 of file py-utils.c.

void gdbpy_extract_lazy_string ( PyObject string,
CORE_ADDR addr,
struct type **  str_type,
long *  length,
char **  encoding 
)

Definition at line 187 of file py-lazy-string.c.

Definition at line 576 of file py-frame.c.

char* gdbpy_get_display_hint ( PyObject printer)
PyObject* gdbpy_get_varobj_pretty_printer ( struct value *  value)
PyObject* gdbpy_history ( PyObject self,
PyObject args 
)
PyObject* gdbpy_inferiors ( PyObject unused,
PyObject unused2 
)

Definition at line 399 of file py-inferior.c.

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

Definition at line 429 of file py-block.c.

Definition at line 868 of file py-breakpoint.c.

Definition at line 568 of file py-cmd.c.

Definition at line 64 of file py-event.c.

Definition at line 110 of file py-evtregistry.c.

Definition at line 411 of file py-finishbreakpoint.c.

Definition at line 625 of file py-frame.c.

Definition at line 204 of file py-function.c.

Definition at line 88 of file py-gdb-readline.c.

Definition at line 781 of file py-inferior.c.

Definition at line 164 of file py-lazy-string.c.

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

Definition at line 754 of file py-param.c.

Definition at line 299 of file py-progspace.c.

Definition at line 56 of file py-evts.c.

Definition at line 478 of file py-symbol.c.

Definition at line 485 of file py-symtab.c.

Definition at line 259 of file py-infthread.c.

Definition at line 1525 of file py-type.c.

Definition at line 176 of file py-lazy-string.c.

Definition at line 228 of file py-utils.c.

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

Definition at line 422 of file py-symbol.c.

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

Definition at line 355 of file py-symbol.c.

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

Definition at line 1494 of file py-type.c.

PyObject* gdbpy_newest_frame ( PyObject self,
PyObject args 
)

Definition at line 540 of file py-frame.c.

char* gdbpy_obj_to_string ( PyObject obj)

Definition at line 242 of file py-utils.c.

PyObject* gdbpy_parameter ( PyObject self,
PyObject args 
)
PyObject* gdbpy_parameter_value ( enum var_types  type,
void *  var 
)
char* gdbpy_parse_command_name ( const char *  name,
struct cmd_list_element ***  base_list,
struct cmd_list_element **  start_list 
)

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

void gdbpy_print_stack ( void  )
PyObject* gdbpy_selected_frame ( PyObject self,
PyObject args 
)

Definition at line 558 of file py-frame.c.

Definition at line 775 of file py-inferior.c.

PyObject* gdbpy_selected_thread ( PyObject self,
PyObject args 
)

Definition at line 242 of file py-infthread.c.

PyObject* gdbpy_string_to_argv ( PyObject self,
PyObject args 
)

Definition at line 678 of file py-cmd.c.

int get_addr_from_python ( PyObject obj,
CORE_ADDR addr 
)

Definition at line 315 of file py-utils.c.

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

struct cleanup* make_cleanup_py_decref ( PyObject py) [read]

Definition at line 41 of file py-utils.c.

struct cleanup* make_cleanup_py_xdecref ( PyObject py) [read]

Definition at line 63 of file py-utils.c.

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

PyObject* objfpy_get_frame_filters ( PyObject ,
void *   
)

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

PyObject* objfpy_get_printers ( PyObject ,
void *   
)

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

Definition at line 258 of file py-progspace.c.

PyObject* pspy_get_frame_filters ( PyObject ,
void *   
)

Definition at line 155 of file py-progspace.c.

PyObject* pspy_get_printers ( PyObject ,
void *   
)

Definition at line 115 of file py-progspace.c.

Definition at line 210 of file py-utils.c.

Definition at line 191 of file py-utils.c.

Definition at line 171 of file py-utils.c.

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

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

void source_python_script_for_objfile ( struct objfile objfile,
FILE *  file,
const char *  filename 
)
struct symbol* symbol_object_to_symbol ( PyObject obj) [read]

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

Definition at line 311 of file py-symbol.c.

Definition at line 399 of file py-symtab.c.

struct symtab* symtab_object_to_symtab ( PyObject obj) [read]

Definition at line 429 of file py-symtab.c.

PyObject* symtab_to_symtab_object ( struct symtab symtab)

Definition at line 385 of file py-symtab.c.

struct type* type_object_to_type ( PyObject obj) [read]

Definition at line 1483 of file py-type.c.

Definition at line 1471 of file py-type.c.

char* unicode_to_target_string ( PyObject unicode_str)

Definition at line 149 of file py-utils.c.

struct value* value_object_to_value ( PyObject self) [read]
PyObject* value_to_value_object ( struct value *  v)

Variable Documentation

Definition at line 40 of file py-breakpoint.c.

struct gdbarch* python_gdbarch
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines