GDB (xrefs)
Classes | Macros | Typedefs | Enumerations | Functions | Variables
python-internal.h File Reference
#include "extension.h"
#include "extension-priv.h"
#include <Python.h>
#include <frameobject.h>
#include "symtab.h"
#include "command.h"
#include "breakpoint.h"

Go to the source code of this file.

Classes

struct  gdbpy_breakpoint_object
 
struct  thread_object
 

Macros

#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 PyVarObject_HEAD_INIT(type, size)    PyObject_HEAD_INIT(type) size,
 
#define Py_TYPE(ob)    (((PyObject*)(ob))->ob_type)
 
#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 PyObject_GetAttrString(obj, attr)   gdb_PyObject_GetAttrString (obj, attr)
 
#define PyObject_HasAttrString(obj, attr)   gdb_PyObject_HasAttrString (obj, attr)
 
#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 long Py_hash_t
 
typedef struct gdbpy_breakpoint_object gdbpy_breakpoint_object
 

Enumerations

enum  gdbpy_iter_kind { iter_keys, iter_values, iter_items }
 

Functions

static void gdb_Py_DECREF (void *op)
 
static PyObject * gdb_PyObject_GetAttrString (PyObject *obj, const char *attr)
 
static int gdb_PyObject_HasAttrString (PyObject *obj, const char *attr)
 
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")
 
int gdbpy_auto_load_enabled (const struct extension_language_defn *)
 
enum ext_lang_rc gdbpy_apply_val_pretty_printer (const struct extension_language_defn *, struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, const struct language_defn *language)
 
enum ext_lang_bt_status gdbpy_apply_frame_filter (const struct extension_language_defn *, struct frame_info *frame, int flags, enum ext_lang_frame_args args_type, struct ui_out *out, int frame_low, int frame_high)
 
void gdbpy_preserve_values (const struct extension_language_defn *, struct objfile *objfile, htab_t copied_types)
 
enum ext_lang_bp_stop gdbpy_breakpoint_cond_says_stop (const struct extension_language_defn *, struct breakpoint *)
 
int gdbpy_breakpoint_has_cond (const struct extension_language_defn *, struct breakpoint *b)
 
void * gdbpy_clone_xmethod_worker_data (const struct extension_language_defn *extlang, void *data)
 
void gdbpy_free_xmethod_worker_data (const struct extension_language_defn *extlang, void *data)
 
enum ext_lang_rc gdbpy_get_matching_xmethod_workers (const struct extension_language_defn *extlang, struct type *obj_type, const char *method_name, xmethod_worker_vec **dm_vec)
 
enum ext_lang_rc gdbpy_get_xmethod_arg_types (const struct extension_language_defn *extlang, struct xmethod_worker *worker, int *nargs, struct type ***arg_types)
 
enum ext_lang_rc gdbpy_get_xmethod_result_type (const struct extension_language_defn *extlang, struct xmethod_worker *worker, struct value *object, struct value **args, int nargs, struct type **result_type)
 
struct valuegdbpy_invoke_xmethod (const struct extension_language_defn *extlang, struct xmethod_worker *worker, struct value *obj, struct value **args, int nargs)
 
PyObject * gdbpy_history (PyObject *self, PyObject *args)
 
PyObject * gdbpy_breakpoints (PyObject *, PyObject *)
 
PyObject * gdbpy_frame_stop_reason_string (PyObject *, PyObject *)
 
PyObject * gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
 
PyObject * gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
 
PyObject * gdbpy_newest_frame (PyObject *self, PyObject *args)
 
PyObject * gdbpy_selected_frame (PyObject *self, PyObject *args)
 
PyObject * gdbpy_block_for_pc (PyObject *self, PyObject *args)
 
PyObject * gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw)
 
int gdbpy_is_field (PyObject *obj)
 
PyObject * gdbpy_create_lazy_string_object (CORE_ADDR address, long length, const char *encoding, struct type *type)
 
PyObject * gdbpy_inferiors (PyObject *unused, PyObject *unused2)
 
PyObject * gdbpy_create_ptid_object (ptid_t ptid)
 
PyObject * gdbpy_selected_thread (PyObject *self, PyObject *args)
 
PyObject * gdbpy_selected_inferior (PyObject *self, PyObject *args)
 
PyObject * gdbpy_string_to_argv (PyObject *self, PyObject *args)
 
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)
 
PyObject * symtab_and_line_to_sal_object (struct symtab_and_line sal)
 
PyObject * symtab_to_symtab_object (struct symtab *symtab)
 
PyObject * symbol_to_symbol_object (struct symbol *sym)
 
PyObject * block_to_block_object (const struct block *block, struct objfile *objfile)
 
PyObject * value_to_value_object (struct value *v)
 
PyObject * type_to_type_object (struct type *)
 
PyObject * frame_info_to_frame_object (struct frame_info *frame)
 
PyObject * symtab_to_linetable_object (PyObject *symtab)
 
PyObject * pspace_to_pspace_object (struct program_space *) CPYCHECKER_RETURNS_BORROWED_REF
 
PyObject * pspy_get_printers (PyObject *, void *)
 
PyObject * pspy_get_frame_filters (PyObject *, void *)
 
PyObject * pspy_get_frame_unwinders (PyObject *, void *)
 
PyObject * pspy_get_xmethods (PyObject *, void *)
 
PyObject * objfile_to_objfile_object (struct objfile *) CPYCHECKER_RETURNS_BORROWED_REF
 
PyObject * objfpy_get_printers (PyObject *, void *)
 
PyObject * objfpy_get_frame_filters (PyObject *, void *)
 
PyObject * objfpy_get_frame_unwinders (PyObject *, void *)
 
PyObject * objfpy_get_xmethods (PyObject *, void *)
 
PyObject * gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 
PyObject * gdbarch_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
 
PyObject * find_inferior_object (int pid)
 
PyObject * inferior_to_inferior_object (struct inferior *inferior)
 
const struct blockblock_object_to_block (PyObject *obj)
 
struct symbolsymbol_object_to_symbol (PyObject *obj)
 
struct valuevalue_object_to_value (PyObject *self)
 
struct valueconvert_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_infoframe_object_to_frame_info (PyObject *frame_obj)
 
struct gdbarcharch_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_linetable (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_inferior_call_pre_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_inferior_call_post_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_register_changed_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_memory_changed_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_clear_objfiles_event (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_arch (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_xmethods (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
int gdbpy_initialize_unwind (void) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
struct cleanupmake_cleanup_py_decref (PyObject *py)
 
struct cleanupmake_cleanup_py_xdecref (PyObject *py)
 
struct cleanupensure_python_env (struct gdbarch *gdbarch, const struct language_defn *language)
 
int gdbpy_print_python_errors_p (void)
 
void gdbpy_print_stack (void)
 
PyObject * python_string_to_unicode (PyObject *obj)
 
char * unicode_to_target_string (PyObject *unicode_str)
 
char * python_string_to_target_string (PyObject *obj)
 
PyObject * python_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)
 
PyObject * apply_varobj_pretty_printer (PyObject *print_obj, struct value **replacement, struct ui_file *stream)
 
PyObject * gdbpy_get_varobj_pretty_printer (struct value *value)
 
char * gdbpy_get_display_hint (PyObject *printer)
 
PyObject * gdbpy_default_visualizer (PyObject *self, PyObject *args)
 
void bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
 
void bpfinishpy_post_stop_hook (struct gdbpy_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
 
PyObject * gdb_py_object_from_longest (LONGEST l)
 
PyObject * gdb_py_object_from_ulongest (ULONGEST l)
 
int gdb_py_int_as_long (PyObject *, long *)
 
PyObject * gdb_py_generic_dict (PyObject *self, void *closure)
 
int gdb_pymodule_addobject (PyObject *module, const char *name, PyObject *object) CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 
struct varobj_iterpy_varobj_get_iterator (struct varobj *var, PyObject *printer)
 

Variables

int gdb_python_initialized
 
PyObject * gdb_module
 
PyObject * gdb_python_module
 
gdbpy_breakpoint_objectbppy_pending_object
 
struct cmd_list_elementset_python_list
 
struct cmd_list_elementshow_python_list
 
struct gdbarchpython_gdbarch
 
const struct language_defnpython_language
 
PyObject * gdbpy_doc_cst
 
PyObject * gdbpy_children_cst
 
PyObject * gdbpy_to_string_cst
 
PyObject * gdbpy_display_hint_cst
 
PyObject * gdbpy_enabled_cst
 
PyObject * gdbpy_value_cst
 
PyObject * gdbpy_gdb_error
 
PyObject * gdbpy_gdb_memory_error
 
PyObject * gdbpy_gdberror_exc
 

Macro Definition 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)
#define _(String)
Definition: gdb_locale.h:40

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

Referenced by bppy_delete_breakpoint(), bppy_get_commands(), bppy_get_condition(), bppy_get_enabled(), bppy_get_expression(), bppy_get_hit_count(), bppy_get_ignore_count(), bppy_get_location(), bppy_get_number(), bppy_get_silent(), bppy_get_task(), bppy_get_temporary(), bppy_get_thread(), bppy_get_type(), and bppy_get_visibility().

#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)
#define _(String)
Definition: gdb_locale.h:40

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

Referenced by bppy_init(), bppy_set_condition(), bppy_set_enabled(), bppy_set_hit_count(), bppy_set_ignore_count(), bppy_set_silent(), bppy_set_task(), and bppy_set_thread().

#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION

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

#define CPYCHECKER_RETURNS_BORROWED_REF

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

#define CPYCHECKER_SETS_EXCEPTION

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

#define CPYCHECKER_STEALS_REFERENCE_TO_ARG (   n)

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

#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF (   ARG)

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

#define GDB_PY_HANDLE_EXCEPTION (   Exception)
Value:
do { \
if (Exception.reason < 0) \
{ \
return NULL; \
} \
} while (0)
void gdbpy_convert_exception(struct gdb_exception) CPYCHECKER_SETS_EXCEPTION
Definition: py-utils.c:295

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

Referenced by bppy_delete_breakpoint(), execute_gdb_command(), frapy_arch(), frapy_block(), frapy_find_sal(), frapy_function(), frapy_is_valid(), frapy_name(), frapy_newer(), frapy_older(), frapy_pc(), frapy_read_register(), frapy_read_var(), frapy_select(), frapy_type(), frapy_unwind_stop_reason(), gdbpy_block_for_pc(), gdbpy_find_pc_line(), gdbpy_get_varobj_pretty_printer(), gdbpy_history(), gdbpy_lookup_global_symbol(), gdbpy_lookup_symbol(), gdbpy_newest_frame(), gdbpy_parameter(), gdbpy_parse_and_eval(), gdbpy_selected_frame(), gdbpy_write(), infpy_read_memory(), infpy_search_memory(), infpy_threads(), infpy_write_memory(), ltpy_get_pcs_for_line(), objfpy_add_separate_debug_file(), objfpy_get_build_id(), pending_framepy_read_register(), pending_framepy_str(), stpy_convert_to_value(), sympy_needs_frame(), sympy_value(), thpy_switch(), typy_array_1(), typy_const(), typy_fields_items(), typy_get_composite(), typy_legacy_template_argument(), typy_lookup_type(), typy_lookup_typename(), typy_pointer(), typy_reference(), typy_richcompare(), typy_str(), typy_strip_typedefs(), typy_template_argument(), typy_unqualified(), typy_volatile(), unwind_infopy_str(), valpy_absolute(), valpy_binop(), valpy_call(), valpy_const_value(), valpy_dereference(), valpy_do_cast(), valpy_fetch_lazy(), valpy_float(), valpy_get_dynamic_type(), valpy_get_is_lazy(), valpy_get_is_optimized_out(), valpy_getitem(), valpy_int(), valpy_invert(), valpy_lazy_string(), valpy_long(), valpy_negative(), valpy_reference_value(), valpy_referenced_value(), valpy_richcompare(), valpy_str(), and valpy_string().

#define GDB_PY_LL_ARG   "L"
#define GDB_PY_LLU_ARG   "K"

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

Referenced by archpy_disassemble(), gdbpy_block_for_pc(), and gdbpy_find_pc_line().

#define gdb_py_long_as_ulongest   PyLong_AsUnsignedLong

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

Referenced by get_addr_from_python().

#define gdb_py_long_from_longest   PyLong_FromLong

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

Referenced by convert_field(), typy_get_sizeof(), and valpy_long().

#define gdb_py_long_from_ulongest   PyLong_FromUnsignedLong
#define GDB_PY_SET_HANDLE_EXCEPTION (   Exception)
Value:
do { \
if (Exception.reason < 0) \
{ \
return -1; \
} \
} while (0)
void gdbpy_convert_exception(struct gdb_exception) CPYCHECKER_SETS_EXCEPTION
Definition: py-utils.c:295

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

Referenced by bpfinishpy_init(), bppy_set_condition(), bppy_set_enabled(), bppy_set_ignore_count(), bppy_set_task(), get_addr_from_python(), valpy_nonzero(), and value_has_field().

#define Py_DECREF (   op)    gdb_Py_DECREF (op)

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

Referenced by archpy_disassemble(), bootstrap_python_frame_filters(), build_inferior_list(), build_line_table_tuple_from_pcs(), call_doc_function(), cmdpy_completer_helper(), cmdpy_destroyer(), cmdpy_function(), cmdpy_init(), compute_enum_values(), construct_visualizer(), convert_field(), convert_value_from_python(), convert_values_to_python(), create_eventregistry_object(), create_exited_event_object(), create_signal_event_object(), del_objfile_sal(), delete_thread_object(), emit_stop_event(), enumerate_args(), eval_python_command(), evpy_emit_event(), extract_sym(), extract_value(), field_new(), find_pretty_printer(), find_pretty_printer_from_objfiles(), find_thread_object(), fnpy_call(), fnpy_init(), frame_info_to_frame_object(), gdb_Py_DECREF(), gdb_pymodule_addobject(), gdbpy_apply_val_pretty_printer(), gdbpy_before_prompt_hook(), gdbpy_breakpoint_cond_says_stop(), gdbpy_breakpoint_deleted(), gdbpy_breakpoints(), gdbpy_decode_line(), gdbpy_finish_initialization(), gdbpy_free_type_printers(), gdbpy_free_xmethod_worker_data(), gdbpy_get_display_hint(), gdbpy_get_matching_xmethod_workers(), gdbpy_get_varobj_pretty_printer(), gdbpy_get_xmethod_arg_types(), gdbpy_inferiors(), gdbpy_lookup_symbol(), gdbpy_obj_to_string(), gdbpy_objfiles(), gdbpy_progspaces(), gdbpy_run_events(), gdbpy_string_to_argv(), get_field_flag(), get_field_type(), get_py_iter_from_func(), get_show_value(), infpy_read_memory(), install_default_visualizer(), instantiate_pretty_printer(), ltpy_dealloc(), ltpy_get_all_source_lines(), ltpy_iterator_dealloc(), objfile_to_objfile_object(), objfpy_new(), parmpy_init(), pretty_print_one_value(), print_children(), pspace_to_pspace_object(), pspy_new(), push_dummy_python_frame(), py_decref(), py_free_inferior(), py_free_objfile(), py_free_pspace(), py_print_frame(), python_string_to_host_string(), python_string_to_target_python_string(), python_string_to_target_string(), salpy_dealloc(), search_pp_list(), symtab_and_line_to_sal_object(), thpy_dealloc(), typy_fields(), typy_fields_items(), typy_iterator_dealloc(), typy_range(), unicode_to_encoded_string(), unwind_infopy_add_saved_register(), unwind_infopy_dealloc(), valpy_dealloc(), valpy_getitem(), value_has_field(), and VEC().

#define PY_SSIZE_T_CLEAN

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

#define Py_TYPE (   ob)    (((PyObject*)(ob))->ob_type)
#define PyEval_InitThreads ( )

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

Referenced by _initialize_python().

#define PyEval_ReleaseLock ( )

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

Referenced by _initialize_python().

#define PyGILState_Ensure ( )    ((PyGILState_STATE) 0)
#define PyGILState_Release (   ARG)    ((void)(ARG))
#define PyObject_GetAttrString (   obj,
  attr 
)    gdb_PyObject_GetAttrString (obj, attr)
#define PyObject_HasAttrString (   obj,
  attr 
)    gdb_PyObject_HasAttrString (obj, attr)
#define PyThreadState_Swap (   ARG)    ((void)(ARG))

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

Referenced by _initialize_python().

#define PyVarObject_HEAD_INIT (   type,
  size 
)    PyObject_HEAD_INIT(type) size,

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

Typedef Documentation

typedef long gdb_py_longest

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

typedef unsigned long gdb_py_ulongest

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

typedef long Py_hash_t

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

Enumeration Type Documentation

Enumerator
iter_keys 
iter_values 
iter_items 

Definition at line 225 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)

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

References arch_object_type_object::gdbarch.

const struct block* block_object_to_block ( PyObject *  obj)
PyObject* block_to_block_object ( const struct block block,
struct objfile objfile 
)
void bpfinishpy_post_stop_hook ( struct gdbpy_breakpoint_object bp_obj)
void bpfinishpy_pre_stop_hook ( struct gdbpy_breakpoint_object bp_obj)
struct value* convert_value_from_python ( PyObject *  obj)
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"  )
thread_object* create_thread_object ( struct thread_info tp)
struct cleanup* ensure_python_env ( struct gdbarch gdbarch,
const struct language_defn language 
)

Definition at line 247 of file python.c.

References _, error(), python_env::error_traceback, python_env::error_type, python_env::error_value, gdb_python_initialized, python_env::gdbarch, python_env::language, make_cleanup(), python_env::previous_active, PyGILState_Ensure, python_gdbarch, python_language, restore_python_env(), set_active_ext_lang(), python_env::state, and xmalloc().

Referenced by add_thread_object(), bpfinishpy_handle_exit(), bpfinishpy_handle_stop(), cmdpy_completer_handle_brkchars(), cmdpy_destroyer(), cmdpy_function(), delete_thread_object(), fnpy_call(), gdbpy_apply_frame_filter(), gdbpy_apply_type_printers(), gdbpy_apply_val_pretty_printer(), gdbpy_before_prompt_hook(), gdbpy_breakpoint_cond_says_stop(), gdbpy_breakpoint_has_cond(), gdbpy_clone_xmethod_worker_data(), gdbpy_eval_from_control_command(), gdbpy_execute_objfile_script(), gdbpy_finish_initialization(), gdbpy_free_type_printers(), gdbpy_free_xmethod_worker_data(), gdbpy_get_matching_xmethod_workers(), gdbpy_get_xmethod_arg_types(), gdbpy_get_xmethod_result_type(), gdbpy_invoke_xmethod(), gdbpy_run_events(), gdbpy_source_objfile_script(), gdbpy_source_script(), gdbpy_start_type_printers(), get_set_value(), get_show_value(), py_free_inferior(), py_free_objfile(), py_free_pspace(), python_command(), python_inferior_exit(), python_interactive_command(), python_new_objfile(), python_on_inferior_call_post(), python_on_inferior_call_pre(), python_on_memory_change(), python_on_normal_stop(), python_on_register_change(), python_on_resume(), pyuw_sniffer(), save_objfile_types(), varobj_ensure_python_env(), and VEC().

PyObject* find_inferior_object ( int  pid)
thread_object* find_thread_object ( ptid_t  ptid)
PyObject* frame_info_to_frame_object ( struct frame_info frame)
struct frame_info* frame_object_to_frame_info ( PyObject *  frame_obj)
static void gdb_Py_DECREF ( void *  op)
inlinestatic

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

References Py_DECREF.

PyObject* gdb_py_generic_dict ( PyObject *  self,
void *  closure 
)

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

int gdb_py_int_as_long ( PyObject *  ,
long *   
)
PyObject* gdb_py_object_from_longest ( LONGEST  l)
PyObject* gdb_py_object_from_ulongest ( ULONGEST  l)

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

Referenced by blpy_get_end(), and blpy_get_start().

int gdb_pymodule_addobject ( PyObject *  module,
const char *  name,
PyObject *  object 
)
static PyObject* gdb_PyObject_GetAttrString ( PyObject *  obj,
const char *  attr 
)
inlinestatic

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

References PyObject_GetAttrString.

static int gdb_PyObject_HasAttrString ( PyObject *  obj,
const char *  attr 
)
inlinestatic

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

References PyObject_HasAttrString.

PyObject* gdbarch_to_arch_object ( struct gdbarch gdbarch)

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

Referenced by frapy_arch().

enum ext_lang_bt_status gdbpy_apply_frame_filter ( const struct extension_language_defn ,
struct frame_info frame,
int  flags,
enum ext_lang_frame_args  args_type,
struct ui_out out,
int  frame_low,
int  frame_high 
)
enum ext_lang_rc gdbpy_apply_val_pretty_printer ( const struct extension_language_defn ,
struct type type,
const gdb_byte valaddr,
int  embedded_offset,
CORE_ADDR  address,
struct ui_file stream,
int  recurse,
const struct value val,
const struct value_print_options options,
const struct language_defn language 
)
int gdbpy_auto_load_enabled ( const struct extension_language_defn )

Definition at line 47 of file py-auto-load.c.

References auto_load_python_scripts.

PyObject* gdbpy_block_for_pc ( PyObject *  self,
PyObject *  args 
)
enum ext_lang_bp_stop gdbpy_breakpoint_cond_says_stop ( const struct extension_language_defn ,
struct breakpoint  
)
int gdbpy_breakpoint_has_cond ( const struct extension_language_defn ,
struct breakpoint b 
)
PyObject* gdbpy_breakpoints ( PyObject *  ,
PyObject *   
)

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

References bppy_live, build_bp_list(), iterate_over_breakpoints(), and Py_DECREF.

void* gdbpy_clone_xmethod_worker_data ( const struct extension_language_defn extlang,
void *  data 
)
void gdbpy_convert_exception ( struct gdb_exception  )
PyObject* gdbpy_create_lazy_string_object ( CORE_ADDR  address,
long  length,
const char *  encoding,
struct type type 
)
PyObject* gdbpy_create_ptid_object ( ptid_t  ptid)

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

References pid, ptid_get_lwp(), ptid_get_pid(), and ptid_get_tid().

Referenced by create_inferior_call_event_object(), and thpy_get_ptid().

PyObject* gdbpy_default_visualizer ( PyObject *  self,
PyObject *  args 
)

Definition at line 848 of file py-prettyprint.c.

References _, find_pretty_printer(), and value_object_to_value().

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

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

References _, host_charset(), and unwind_stop_reason_to_string().

void gdbpy_free_xmethod_worker_data ( const struct extension_language_defn extlang,
void *  data 
)
char* gdbpy_get_display_hint ( PyObject *  printer)
enum ext_lang_rc gdbpy_get_matching_xmethod_workers ( const struct extension_language_defn extlang,
struct type obj_type,
const char *  method_name,
xmethod_worker_vec **  dm_vec 
)
PyObject* gdbpy_get_varobj_pretty_printer ( struct value value)
enum ext_lang_rc gdbpy_get_xmethod_arg_types ( const struct extension_language_defn extlang,
struct xmethod_worker worker,
int nargs,
struct type ***  arg_types 
)
enum ext_lang_rc gdbpy_get_xmethod_result_type ( const struct extension_language_defn extlang,
struct xmethod_worker worker,
struct value object,
struct value **  args,
int  nargs,
struct type **  result_type 
)
PyObject* gdbpy_history ( PyObject *  self,
PyObject *  args 
)
PyObject* gdbpy_inferiors ( PyObject *  unused,
PyObject *  unused2 
)

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

References build_inferior_list(), iterate_over_inferiors(), and Py_DECREF.

int gdbpy_initialize_arch ( void  )
int gdbpy_initialize_auto_load ( void  )
int gdbpy_initialize_blocks ( void  )
int gdbpy_initialize_breakpoint_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_breakpoints ( void  )
int gdbpy_initialize_clear_objfiles_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_commands ( void  )
int gdbpy_initialize_continue_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_event ( void  )

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

References event_object_type, and gdbpy_initialize_event_generic().

Referenced by _initialize_python().

int gdbpy_initialize_eventregistry ( void  )

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

References eventregistry_object_type, gdb_module, and gdb_pymodule_addobject().

Referenced by _initialize_python().

int gdbpy_initialize_exited_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_finishbreakpoints ( void  )
int gdbpy_initialize_frames ( void  )
int gdbpy_initialize_functions ( void  )

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

References fnpy_object_type, gdb_module, and gdb_pymodule_addobject().

Referenced by _initialize_python().

void gdbpy_initialize_gdb_readline ( void  )

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

References gdbpy_readline_wrapper().

Referenced by _initialize_python().

int gdbpy_initialize_inferior ( void  )
int gdbpy_initialize_inferior_call_post_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_inferior_call_pre_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_lazy_string ( void  )

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

References lazy_string_object_type.

Referenced by _initialize_python().

int gdbpy_initialize_linetable ( void  )
int gdbpy_initialize_memory_changed_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_new_objfile_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_objfile ( void  )
int gdbpy_initialize_parameters ( void  )
int gdbpy_initialize_pspace ( void  )
int gdbpy_initialize_py_events ( void  )
int gdbpy_initialize_register_changed_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_signal_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_stop_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_symbols ( void  )
int gdbpy_initialize_symtabs ( void  )
int gdbpy_initialize_thread ( void  )

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

References gdb_module, gdb_pymodule_addobject(), and thread_object_type.

Referenced by _initialize_python().

int gdbpy_initialize_thread_event ( void  )

Referenced by _initialize_python().

int gdbpy_initialize_types ( void  )
int gdbpy_initialize_unwind ( void  )
int gdbpy_initialize_values ( void  )

Definition at line 1706 of file py-value.c.

References gdb_module, gdb_pymodule_addobject(), and value_object_type.

Referenced by _initialize_python().

int gdbpy_initialize_xmethods ( void  )
struct value* gdbpy_invoke_xmethod ( const struct extension_language_defn extlang,
struct xmethod_worker worker,
struct value obj,
struct value **  args,
int  nargs 
)
int gdbpy_is_field ( PyObject *  obj)

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

References field_object_type.

Referenced by valpy_getitem().

int gdbpy_is_lazy_string ( PyObject *  result)
int gdbpy_is_string ( PyObject *  obj)
int gdbpy_is_value_object ( PyObject *  obj)

Definition at line 1700 of file py-value.c.

References value_object_type.

Referenced by get_addr_from_python().

PyObject* gdbpy_lookup_global_symbol ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
PyObject* gdbpy_lookup_objfile ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
PyObject* gdbpy_lookup_symbol ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
PyObject* gdbpy_lookup_type ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)

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

References _, block_object_to_block(), type_to_type_object(), and typy_lookup_typename().

PyObject* gdbpy_newest_frame ( PyObject *  self,
PyObject *  args 
)
char* gdbpy_obj_to_string ( PyObject *  obj)
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 428 of file py-cmd.c.

References _, CMD_LIST_AMBIGUOUS, len, lookup_cmd_1(), cmd_list_element::prefixlist, xfree(), and xmalloc().

Referenced by cmdpy_init(), and parmpy_init().

void gdbpy_preserve_values ( const struct extension_language_defn ,
struct objfile objfile,
htab_t  copied_types 
)

Definition at line 162 of file py-value.c.

References value_object::next, preserve_one_value(), and value_object::value.

int gdbpy_print_python_errors_p ( void  )

Definition at line 1189 of file python.c.

References gdbpy_should_print_stack, and python_excp_none.

Referenced by print_children().

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

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

References current_inferior(), and inferior_to_inferior_object().

PyObject* gdbpy_selected_thread ( PyObject *  self,
PyObject *  args 
)

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

References find_thread_object(), and inferior_ptid.

PyObject* gdbpy_string_to_argv ( PyObject *  self,
PyObject *  args 
)

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

References gdb_buildargv(), and Py_DECREF.

int get_addr_from_python ( PyObject *  obj,
CORE_ADDR addr 
)
PyObject* inferior_to_inferior_object ( struct inferior inferior)
struct cleanup* make_cleanup_py_decref ( PyObject *  py)
struct cleanup* make_cleanup_py_xdecref ( PyObject *  py)

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

References make_cleanup(), and py_xdecref().

Referenced by py_mi_print_variables(), py_print_args(), and py_print_locals().

PyObject* objfile_to_objfile_object ( struct objfile )
PyObject* objfpy_get_frame_filters ( PyObject *  ,
void *   
)

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

PyObject* objfpy_get_frame_unwinders ( PyObject *  ,
void *   
)

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

PyObject* objfpy_get_printers ( PyObject *  ,
void *   
)

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

Referenced by find_pretty_printer_from_objfiles().

PyObject* objfpy_get_xmethods ( PyObject *  ,
void *   
)

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

Referenced by gdbpy_get_matching_xmethod_workers().

PyObject* pspace_to_pspace_object ( struct program_space )
PyObject* pspy_get_frame_filters ( PyObject *  ,
void *   
)

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

PyObject* pspy_get_frame_unwinders ( PyObject *  ,
void *   
)

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

PyObject* pspy_get_printers ( PyObject *  ,
void *   
)

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

Referenced by find_pretty_printer_from_progspace().

PyObject* pspy_get_xmethods ( PyObject *  ,
void *   
)

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

Referenced by gdbpy_get_matching_xmethod_workers().

struct varobj_iter* py_varobj_get_iterator ( struct varobj var,
PyObject *  printer 
)
char* python_string_to_host_string ( PyObject *  obj)
PyObject* python_string_to_target_python_string ( PyObject *  obj)

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

References Py_DECREF, python_string_to_unicode(), and unicode_to_target_python_string().

Referenced by print_string_repr().

char* python_string_to_target_string ( PyObject *  obj)
PyObject* python_string_to_unicode ( PyObject *  obj)
struct symtab_and_line* sal_object_to_symtab_and_line ( PyObject *  obj)

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

References sal_object_type.

Referenced by salpy_is_valid().

struct symbol* symbol_object_to_symbol ( PyObject *  obj)

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

References symbol_object_type.

Referenced by extract_sym(), frapy_read_var(), and sympy_is_valid().

PyObject* symbol_to_symbol_object ( struct symbol sym)
PyObject* symtab_and_line_to_sal_object ( struct symtab_and_line  sal)

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

References Py_DECREF, sal_object_type, and set_sal().

Referenced by frapy_find_sal(), gdbpy_decode_line(), and gdbpy_find_pc_line().

struct symtab* symtab_object_to_symtab ( PyObject *  obj)

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

References symtab_object_type.

Referenced by ltpy_is_valid(), ltpy_iter_is_valid(), and stpy_is_valid().

PyObject* symtab_to_linetable_object ( PyObject *  symtab)

Definition at line 85 of file py-linetable.c.

References linetable_object_type, and linetable_object::symtab.

Referenced by stpy_get_linetable().

PyObject* symtab_to_symtab_object ( struct symtab symtab)

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

References set_symtab(), and symtab_object_type.

Referenced by set_sal(), and sympy_get_symtab().

struct type* type_object_to_type ( PyObject *  obj)
PyObject* type_to_type_object ( struct type )
char* unicode_to_target_string ( PyObject *  unicode_str)

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

References python_gdbarch, target_charset(), and unicode_to_encoded_string().

Referenced by python_string_to_target_string().

struct value* value_object_to_value ( PyObject *  self)
PyObject* value_to_value_object ( struct value v)

Variable Documentation

gdbpy_breakpoint_object* bppy_pending_object

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

Referenced by bpfinishpy_init(), and gdbpy_breakpoint_created().

PyObject* gdb_module
int gdb_python_initialized
PyObject* gdb_python_module
PyObject* gdbpy_children_cst
PyObject* gdbpy_display_hint_cst

Definition at line 118 of file python.c.

Referenced by _initialize_python(), and gdbpy_get_display_hint().

PyObject* gdbpy_doc_cst

Definition at line 119 of file python.c.

Referenced by _initialize_python(), cmdpy_init(), and parmpy_init().

PyObject* gdbpy_enabled_cst

Definition at line 120 of file python.c.

Referenced by _initialize_python(), and search_pp_list().

PyObject* gdbpy_gdb_error

Definition at line 127 of file python.c.

Referenced by _initialize_python(), and gdbpy_convert_exception().

PyObject* gdbpy_gdb_memory_error
PyObject* gdbpy_gdberror_exc

Definition at line 124 of file python.c.

Referenced by _initialize_python(), cmdpy_function(), and fnpy_call().

PyObject* gdbpy_to_string_cst
PyObject* gdbpy_value_cst

Definition at line 121 of file python.c.

Referenced by _initialize_python(), and convert_value_from_python().

struct gdbarch* python_gdbarch
const struct language_defn* python_language
struct cmd_list_element* set_python_list
struct cmd_list_element* show_python_list