GDB (xrefs)

Classes | Macros | Functions | Variables
python.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include "command.h"`
`#include "ui-out.h"`
`#include "cli/cli-script.h"`
`#include "gdbcmd.h"`
`#include "progspace.h"`
`#include "objfiles.h"`
`#include "value.h"`
`#include "language.h"`
`#include "event-loop.h"`
`#include "serial.h"`
`#include "readline/tilde.h"`
`#include "python.h"`
`#include "extension-priv.h"`
`#include "cli/cli-utils.h"`
`#include <ctype.h>`
`#include "location.h"`
`#include "ser-event.h"`
`#include "cli/cli-decode.h"`
`#include "charset.h"`
`#include "top.h"`
`#include "solib.h"`
`#include "python-internal.h"`
`#include "linespec.h"`
`#include "source.h"`
`#include "version.h"`
`#include "target.h"`
`#include "gdbthread.h"`
`#include "interps.h"`
`#include "event-top.h"`
`#include "py-ref.h"`
`#include "py-event.h"`
`#include "py-event-types.def"`

Go to the source code of this file.

## Classes
struct | gdbpy_event

## Macros
#define | GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base)

## Functions
static void | gdbpy_finish_initialization (const struct extension_language_defn *)
static int | gdbpy_initialized (const struct extension_language_defn *)
static void | gdbpy_eval_from_control_command (const struct extension_language_defn *, struct command_line *cmd)
static void | gdbpy_start_type_printers (const struct extension_language_defn *, struct ext_lang_type_printers *)
static enum ext_lang_rc | gdbpy_apply_type_printers (const struct extension_language_defn *, const struct ext_lang_type_printers *, struct type *, char **)
static void | gdbpy_free_type_printers (const struct extension_language_defn *, struct ext_lang_type_printers *)
static void | gdbpy_set_quit_flag (const struct extension_language_defn *)
static int | gdbpy_check_quit_flag (const struct extension_language_defn *)
static enum ext_lang_rc | gdbpy_before_prompt_hook (const struct extension_language_defn *, const char *current_gdb_prompt)
static int | eval_python_command (const char *command)
static void | python_interactive_command (const char *arg, int from_tty)
static void | python_run_simple_file (FILE *file, const char *filename)
static std::string | compute_python_string (struct command_line *l)
static void | python_command (const char *arg, int from_tty)
PyObject * | gdbpy_parameter_value (enum var_types type, void *var)
static PyObject * | gdbpy_parameter (PyObject *self, PyObject *args)
static PyObject * | gdbpy_target_charset (PyObject *self, PyObject *args)
static PyObject * | gdbpy_target_wide_charset (PyObject *self, PyObject *args)
static PyObject * | execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
static PyObject * | gdbpy_solib_name (PyObject *self, PyObject *args)
static PyObject * | gdbpy_rbreak (PyObject *self, PyObject *args, PyObject *kw)
static PyObject * | gdbpy_decode_line (PyObject *self, PyObject *args)
static PyObject * | gdbpy_parse_and_eval (PyObject *self, PyObject *args)
static PyObject * | gdbpy_find_pc_line (PyObject *self, PyObject *args)
static PyObject * | gdbpy_invalidate_cached_frames (PyObject *self, PyObject *args)
static void | gdbpy_source_script (const struct extension_language_defn *extlang, FILE *file, const char *filename)
static void | gdbpy_run_events (int error, gdb_client_data client_data)
static PyObject * | gdbpy_post_event (PyObject *self, PyObject *args)
static int | gdbpy_initialize_events (void)
static PyObject * | gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
static PyObject * | gdbpy_flush (PyObject *self, PyObject *args, PyObject *kw)
int | gdbpy_print_python_errors_p (void)
void | gdbpy_print_stack (void)
static PyObject * | gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
static PyObject * | gdbpy_progspaces (PyObject *unused1, PyObject *unused2)
static void | gdbpy_source_objfile_script (const struct extension_language_defn *extlang, struct objfile *objfile, FILE *file, const char *filename)
static void | gdbpy_execute_objfile_script (const struct extension_language_defn *extlang, struct objfile *objfile, const char *name, const char *script)
static PyObject * | gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2)
static PyObject * | gdbpy_objfiles (PyObject *unused1, PyObject *unused2)
static void | user_set_python (const char *args, int from_tty)
static void | user_show_python (const char *args, int from_tty)
static void | finalize_python (void *ignore)
static bool | do_start_initialization ()
void | _initialize_python (void)
static bool | do_finish_initialization (const struct extension_language_defn *extlang)

## Variables
static const char | python_excp_none [] = "none"
static const char | python_excp_full [] = "full"
static const char | python_excp_message [] = "message"
static const char *const | python_excp_enums []
static const char * | gdbpy_should_print_stack = python_excp_message
const struct extension_language_script_ops | python_extension_script_ops
const struct extension_language_ops | python_extension_ops
const struct extension_language_defn | extension_language_python
int | gdb_python_initialized
PyMethodDef | python_GdbMethods []
PyObject * | gdb_module
PyObject * | gdb_python_module
PyObject * | gdbpy_to_string_cst
PyObject * | gdbpy_children_cst
PyObject * | gdbpy_display_hint_cst
PyObject * | gdbpy_doc_cst
PyObject * | gdbpy_enabled_cst
PyObject * | gdbpy_value_cst
PyObject * | gdbpy_gdberror_exc
PyObject * | gdbpy_gdb_error
PyObject * | gdbpy_gdb_memory_error
static script_sourcer_func | gdbpy_source_script
static objfile_script_sourcer_func | gdbpy_source_objfile_script
static objfile_script_executor_func | gdbpy_execute_objfile_script
struct gdbarch * | python_gdbarch
const struct language_defn * | python_language
static struct gdbpy_event * | gdbpy_event_list
static struct gdbpy_event ** | gdbpy_event_list_end
static struct serial_event * | gdbpy_serial_event
static struct objfile * | gdbpy_current_objfile
static struct cmd_list_element * | user_set_python_list
static struct cmd_list_element * | user_show_python_list

## Macro Definition Documentation

## ◆ GDB_PY_DEFINE_EVENT_TYPE [1/2]

#define GDB_PY_DEFINE_EVENT_TYPE | ( |  | name,
|  |  | py_name,
|  |  | doc,
|  |  | base
| ) |  |

Value:
if (gdbpy_initialize_event_generic (&name##_event_object_type, py_name) < 0) \
return false;
gdbpy_initialize_event_generic
int gdbpy_initialize_event_generic(PyTypeObject *type, const char *name)
Definition: py-event.c:69
name
const char *const name
Definition: aarch64-tdep.c:76

Definition at line 2143 of file python.c.

## ◆ GDB_PY_DEFINE_EVENT_TYPE [2/2]

#define GDB_PY_DEFINE_EVENT_TYPE | ( |  | name,
|  |  | py_name,
|  |  | doc,
|  |  | base
| ) |  |

Definition at line 2143 of file python.c.

## Function Documentation

## ◆ _initialize_python()

void _initialize_python | ( | void |  | ) |

Definition at line 1820 of file python.c.

References _, add_com(), add_com_alias(), add_prefix_cmd(), add_setshow_enum_cmd(), class_obscure, do_start_initialization(), gdbpy_print_stack(), gdbpy_should_print_stack, HAVE_PYTHON, no_class, python_command(), python_excp_enums, python_interactive_command(), setlist, showlist, user_set_python(), user_set_python_list, user_show_python(), and user_show_python_list.

## ◆ compute_python_string()

static std::string compute_python_string | ( | struct command_line * | l | ) |
| static

Definition at line 371 of file python.c.

References command_line::line, command_line::next, and string.

Referenced by gdbpy_eval_from_control_command().

## ◆ do_finish_initialization()

static bool do_finish_initialization | ( | const struct extension_language_defn * | extlang | ) |
| static

Definition at line 1905 of file python.c.

References _, gdb_datadir, gdb_pymodule_addobject(), gdb_python_module, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), L, arm-linux::m, PySys_GetObject, PySys_SetPath, SLASH_STRING, string, and warning().

Referenced by gdbpy_finish_initialization().

## ◆ do_start_initialization()

static bool do_start_initialization | ( |  | ) |
| static

Definition at line 1660 of file python.c.

References finalize_python(), gdb_module, gdb_pymodule_addobject(), gdb_python_initialized, gdbpy_children_cst, gdbpy_display_hint_cst, gdbpy_doc_cst, gdbpy_enabled_cst, gdbpy_gdb_error, gdbpy_gdb_memory_error, gdbpy_gdberror_exc, gdbpy_initialize_arch(), gdbpy_initialize_auto_load(), gdbpy_initialize_blocks(), gdbpy_initialize_breakpoints(), gdbpy_initialize_btrace(), gdbpy_initialize_commands(), gdbpy_initialize_event(), gdbpy_initialize_eventregistry(), gdbpy_initialize_events(), gdbpy_initialize_finishbreakpoints(), gdbpy_initialize_frames(), gdbpy_initialize_functions(), gdbpy_initialize_gdb_readline(), gdbpy_initialize_inferior(), gdbpy_initialize_instruction(), gdbpy_initialize_lazy_string(), gdbpy_initialize_linetable(), gdbpy_initialize_objfile(), gdbpy_initialize_parameters(), gdbpy_initialize_pspace(), gdbpy_initialize_py_events(), gdbpy_initialize_record(), gdbpy_initialize_symbols(), gdbpy_initialize_symtabs(), gdbpy_initialize_thread(), gdbpy_initialize_types(), gdbpy_initialize_unwind(), gdbpy_initialize_values(), gdbpy_initialize_xmethods(), gdbpy_to_string_cst, gdbpy_value_cst, host_name, ldirname(), make_final_cleanup(), PyErr_NewException, PyEval_InitThreads, PyEval_ReleaseLock, python_GdbMethods, python_libdir, PyThreadState_Swap, SLASH_STRING, string, target_name, and version.

Referenced by _initialize_python().

## ◆ eval_python_command()

static int eval_python_command | ( | const char * | command | ) |
| static

Definition at line 266 of file python.c.

References arm-linux::m.

Referenced by python_interactive_command().

## ◆ execute_gdb_command()

static PyObject* execute_gdb_command | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 553 of file python.c.

References ui::async, bpstat_do_actions(), CATCH, current_ui, current_uiout, END_CATCH, execute_command(), execute_command_to_string(), GDB_PY_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), interp::interp(), interp_lookup(), interp_ui_out(), make_scoped_restore(), prevent_dont_repeat(), RETURN_MASK_ALL, string, and TRY.

## ◆ finalize_python()

static void finalize_python | ( | void * | ignore | ) |
| static

Definition at line 1636 of file python.c.

References current_language, extension_language_python, PyGILState_Ensure, python_gdbarch, python_language, restore_active_ext_lang(), set_active_ext_lang(), and target_gdbarch().

Referenced by do_start_initialization().

## ◆ gdbpy_apply_type_printers()

static enum ext_lang_rc gdbpy_apply_type_printers | ( | const struct extension_language_defn * | extlang,
|  | const struct ext_lang_type_printers * | ext_printers,
|  | struct type * | type,
|  | char ** | prettied_type
| ) |  |
| static

Definition at line 1497 of file python.c.

References current_language, EXT_LANG_RC_ERROR, EXT_LANG_RC_NOP, EXT_LANG_RC_OK, func, gdb_python_initialized, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), get_current_arch(), if(), ext_lang_type_printers::py_type_printers, PyObject_GetAttrString, python_string_to_host_string(), and type_to_type_object().

## ◆ gdbpy_before_prompt_hook()

static enum ext_lang_rc gdbpy_before_prompt_hook | ( | const struct extension_language_defn * | extlang,
|  | const char * | current_gdb_prompt
| ) |  |
| static

Definition at line 1097 of file python.c.

References _, current_language, evpy_emit_event(), evregpy_no_listeners_p(), EXT_LANG_RC_ERROR, EXT_LANG_RC_NOP, EXT_LANG_RC_OK, gdb_py_events, gdb_python_initialized, gdb_python_module, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), get_current_arch(), PyObject_GetAttrString, PyObject_HasAttrString, python_string_to_host_string(), and set_prompt().

## ◆ gdbpy_check_quit_flag()

static int gdbpy_check_quit_flag | ( | const struct extension_language_defn * | extlang | ) |
| static

Definition at line 256 of file python.c.

## ◆ gdbpy_decode_line()

static PyObject* gdbpy_decode_line | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 830 of file python.c.

References CATCH, decode_line_1(), gdb::array_view< T >::empty(), END_CATCH, gdbpy_convert_exception(), gdb::ref_ptr< T, Policy >::get(), get_current_source_symtab_and_line(), python_language, gdb::ref_ptr< T, Policy >::release(), gdb::ref_ptr< T, Policy >::reset(), RETURN_MASK_ALL, set_default_source_symtab_and_line(), gdb::array_view< T >::size(), string_to_event_location_basic(), symtab_and_line_to_sal_object(), TRY, and WILD.

## ◆ gdbpy_eval_from_control_command()

static void gdbpy_eval_from_control_command | ( | const struct extension_language_defn * | extlang,
|  | struct command_line * | cmd
| ) |  |
| static

Definition at line 388 of file python.c.

References _, command_line::body_count, command_line::body_list, compute_python_string(), current_language, error(), get_current_arch(), and string.

## ◆ gdbpy_execute_objfile_script()

static void gdbpy_execute_objfile_script | ( | const struct extension_language_defn * | extlang,
|  | struct objfile * | objfile,
|  | const char * | name,
|  | const char * | script
| ) |  |
| static

Definition at line 1398 of file python.c.

References current_language, gdb_python_initialized, gdbpy_current_objfile, get_objfile_arch(), and objfile::objfile().

## ◆ gdbpy_find_pc_line()

static PyObject* gdbpy_find_pc_line | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 938 of file python.c.

References CATCH, END_CATCH, find_pc_line(), GDB_PY_HANDLE_EXCEPTION, GDB_PY_LLU_ARG, symtab_and_line::pc, RETURN_MASK_ALL, symtab_and_line_to_sal_object(), and TRY.

## ◆ gdbpy_finish_initialization()

static void gdbpy_finish_initialization | ( | const struct extension_language_defn * | extlang | ) |
| static

Definition at line 1970 of file python.c.

References _, current_language, do_finish_initialization(), gdbpy_print_stack(), get_current_arch(), and warning().

## ◆ gdbpy_flush()

static PyObject* gdbpy_flush | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 1221 of file python.c.

References gdb_flush(), gdb_PyArg_ParseTupleAndKeywords(), gdb_stderr, gdb_stdlog, and gdb_stdout.

## ◆ gdbpy_free_type_printers()

static void gdbpy_free_type_printers | ( | const struct extension_language_defn * | extlang,
|  | struct ext_lang_type_printers * | ext_printers
| ) |  |
| static

Definition at line 1562 of file python.c.

References current_language, gdb_python_initialized, get_current_arch(), if(), Py_DECREF, and ext_lang_type_printers::py_type_printers.

## ◆ gdbpy_get_current_objfile()

static PyObject* gdbpy_get_current_objfile | ( | PyObject * | unused1,
|  | PyObject * | unused2
| ) |  |
| static

Definition at line 1416 of file python.c.

References gdbpy_current_objfile, and objfile_to_objfile_object().

## ◆ gdbpy_get_current_progspace()

static PyObject* gdbpy_get_current_progspace | ( | PyObject * | unused1,
|  | PyObject * | unused2
| ) |  |
| static

Definition at line 1329 of file python.c.

References current_program_space, and pspace_to_pspace_object().

## ◆ gdbpy_initialize_events()

static int gdbpy_initialize_events | ( | void |  | ) |
| static

Definition at line 1081 of file python.c.

References add_file_handler(), gdbpy_event_list, gdbpy_event_list_end, gdbpy_run_events(), gdbpy_serial_event, make_serial_event(), and serial_event_fd().

Referenced by do_start_initialization().

## ◆ gdbpy_initialized()

static int gdbpy_initialized | ( | const struct extension_language_defn * | extlang | ) |
| static

Definition at line 1985 of file python.c.

References gdb_python_initialized.

## ◆ gdbpy_invalidate_cached_frames()

static PyObject* gdbpy_invalidate_cached_frames | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 967 of file python.c.

References reinit_frame_cache().

## ◆ gdbpy_objfiles()

static PyObject* gdbpy_objfiles | ( | PyObject * | unused1,
|  | PyObject * | unused2
| ) |  |
| static

Definition at line 1432 of file python.c.

References ALL_OBJFILES, gdb::ref_ptr< T, Policy >::get(), objfile_to_objfile_object(), and gdb::ref_ptr< T, Policy >::release().

## ◆ gdbpy_parameter()

static PyObject* gdbpy_parameter | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 495 of file python.c.

References _, alias, CATCH, END_CATCH, exception_none, GDB_PY_HANDLE_EXCEPTION, gdbpy_parameter_value(), lookup_cmd_composition(), cmd_list_element::prefix, RETURN_MASK_ALL, TRY, cmd_list_element::var, cmd_list_element::var_type, and xfree().

## ◆ gdbpy_parameter_value()

PyObject* gdbpy_parameter_value | ( | enum var_types | type,
|  | void * | var
| ) |  |

Definition at line 433 of file python.c.

References _, AUTO_BOOLEAN_FALSE, AUTO_BOOLEAN_TRUE, host_string_to_python_string(), INT_MAX, UINT_MAX, var_auto_boolean, var_boolean, var_enum, var_filename, var_integer, var_optional_filename, var_string, var_string_noescape, var_uinteger, and var_zinteger.

Referenced by gdbpy_parameter(), and get_attr().

## ◆ gdbpy_parse_and_eval()

static PyObject* gdbpy_parse_and_eval | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 913 of file python.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, parse_and_eval(), RETURN_MASK_ALL, TRY, and value_to_value_object().

## ◆ gdbpy_post_event()

static PyObject* gdbpy_post_event | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 1044 of file python.c.

References _, gdbpy_event::event, func, gdbpy_event_list, gdbpy_event_list_end, gdbpy_serial_event, gdbpy_event::next, serial_event_set(), and XNEW.

## ◆ gdbpy_print_python_errors_p()

int gdbpy_print_python_errors_p | ( | void |  | ) |

Definition at line 1252 of file python.c.

References gdbpy_should_print_stack, and python_excp_none.

Referenced by print_children().

## ◆ gdbpy_print_stack()

void gdbpy_print_stack | ( | void |  | ) |

Definition at line 1262 of file python.c.

References _, begin_line(), CATCH, END_CATCH, fprintf_filtered(), gdb_stderr, gdbpy_exception_to_string(), gdbpy_obj_to_string(), gdbpy_should_print_stack, python_excp_full, python_excp_none, RETURN_MASK_ALL, TRY, and type.

Referenced by _initialize_python(), add_thread_object(), bpfinishpy_detect_out_scope_cb(), bpfinishpy_out_of_scope(), bpfinishpy_post_stop_hook(), bpfinishpy_pre_stop_hook(), cmdpy_function(), construct_visualizer(), do_finish_initialization(), evpy_emit_event(), fnpy_call(), gdbpy_apply_frame_filter(), gdbpy_apply_type_printers(), gdbpy_before_prompt_hook(), gdbpy_breakpoint_cond_says_stop(), gdbpy_breakpoint_created(), gdbpy_breakpoint_deleted(), gdbpy_breakpoint_modified(), gdbpy_finish_initialization(), gdbpy_get_display_hint(), gdbpy_get_matching_xmethod_workers(), gdbpy_get_xmethod_arg_types(), gdbpy_get_xmethod_result_type(), gdbpy_invoke_xmethod(), gdbpy_rbreak(), gdbpy_start_type_printers(), get_doc_string(), get_set_value(), get_show_value(), install_default_visualizer(), print_children(), print_stack_unless_memory_error(), py_varobj_get_iterator(), py_varobj_iter_next(), python_inferior_deleted(), python_inferior_exit(), python_interactive_command(), python_new_inferior(), 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(), python_run_simple_file(), pyuw_sniffer(), varobj_set_visualizer(), varobj_value_get_print_value(), and gdbpy_enter::~gdbpy_enter().

## ◆ gdbpy_progspaces()

static PyObject* gdbpy_progspaces | ( | PyObject * | unused1,
|  | PyObject * | unused2
| ) |  |
| static

Definition at line 1342 of file python.c.

References ALL_PSPACES, gdb::ref_ptr< T, Policy >::get(), cleanup_check::ps, pspace_to_pspace_object(), and gdb::ref_ptr< T, Policy >::release().

## ◆ gdbpy_rbreak()

static PyObject* gdbpy_rbreak | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 657 of file python.c.

References _, breakpoint_object_type, symtab::fullname, FUNCTIONS_DOMAIN, gdb_PyArg_ParseTupleAndKeywords(), gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), MSYMBOL_LINKAGE_NAME, PyObject_GetAttrString, python_string_to_target_string(), gdb.frames::return_list(), search_symbols(), string, SYMBOL_LINKAGE_NAME, symbol_symtab(), symtab_to_fullname(), and xfree().

## ◆ gdbpy_run_events()

static void gdbpy_run_events | ( | int | error,
|  | gdb_client_data | client_data
| ) |  |
| static

Definition at line 1014 of file python.c.

References current_language, gdbpy_event::event, gdbpy_event_list, gdbpy_event_list_end, gdbpy_serial_event, get_current_arch(), gdbpy_event::next, Py_DECREF, serial_event_clear(), and xfree().

Referenced by gdbpy_initialize_events().

## ◆ gdbpy_set_quit_flag()

static void gdbpy_set_quit_flag | ( | const struct extension_language_defn * | extlang | ) |
| static

Definition at line 248 of file python.c.

## ◆ gdbpy_solib_name()

static PyObject* gdbpy_solib_name | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 622 of file python.c.

References current_program_space, GDB_PY_LLU_ARG, host_string_to_python_string(), and solib_name_from_address().

## ◆ gdbpy_source_objfile_script()

static void gdbpy_source_objfile_script | ( | const struct extension_language_defn * | extlang,
|  | struct objfile * | objfile,
|  | FILE * | file,
|  | const char * | filename
| ) |  |
| static

Definition at line 1376 of file python.c.

References current_language, gdb_python_initialized, gdbpy_current_objfile, get_objfile_arch(), objfile::objfile(), and python_run_simple_file().

## ◆ gdbpy_source_script()

static void gdbpy_source_script | ( | const struct extension_language_defn * | extlang,
|  | FILE * | file,
|  | const char * | filename
| ) |  |
| static

Definition at line 980 of file python.c.

References current_language, get_current_arch(), and python_run_simple_file().

## ◆ gdbpy_start_type_printers()

static void gdbpy_start_type_printers | ( | const struct extension_language_defn * | extlang,
|  | struct ext_lang_type_printers * | ext_printers
| ) |  |
| static

Definition at line 1457 of file python.c.

References current_language, func, gdb_python_initialized, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), get_current_arch(), ext_lang_type_printers::py_type_printers, and PyObject_GetAttrString.

## ◆ gdbpy_target_charset()

static PyObject* gdbpy_target_charset | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 533 of file python.c.

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

## ◆ gdbpy_target_wide_charset()

static PyObject* gdbpy_target_wide_charset | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 543 of file python.c.

References host_charset(), python_gdbarch, and target_wide_charset().

## ◆ gdbpy_write()

static PyObject* gdbpy_write | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 1179 of file python.c.

References CATCH, END_CATCH, fprintf_filtered(), GDB_PY_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), gdb_stderr, gdb_stdlog, gdb_stdout, RETURN_MASK_ALL, and TRY.

## ◆ python_command()

static void python_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 407 of file python.c.

References _, ui::async, current_language, current_ui, error(), execute_control_command_untraced(), get_command_line(), get_current_arch(), make_scoped_restore(), python_control, and skip_spaces().

Referenced by _initialize_python().

## ◆ python_interactive_command()

static void python_interactive_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 292 of file python.c.

References _, ui::async, current_language, current_ui, dont_repeat(), err, error(), eval_python_command(), gdbpy_print_stack(), get_current_arch(), ui::instream, make_scoped_restore(), skip_spaces(), xfree(), and xmalloc().

Referenced by _initialize_python().

## ◆ python_run_simple_file()

static void python_run_simple_file | ( | FILE * | file,
|  | const char * | filename
| ) |  |
| static

Definition at line 344 of file python.c.

References _, error(), and gdbpy_print_stack().

Referenced by gdbpy_source_objfile_script(), and gdbpy_source_script().

## ◆ user_set_python()

static void user_set_python | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1614 of file python.c.

References all_commands, gdb_stdout, help_list(), and user_set_python_list.

Referenced by _initialize_python().

## ◆ user_show_python()

static void user_show_python | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1623 of file python.c.

References cmd_show_list(), and user_show_python_list.

Referenced by _initialize_python().

## Variable Documentation

## ◆ extension_language_python

const struct extension_language_defn extension_language_python

Initial value:
=
{
EXT_LANG_PYTHON,
"python",
"Python",
".py",
"-gdb.py",
python_control,
&python_extension_script_ops,
&python_extension_ops
}
EXT_LANG_PYTHON
Definition: extension.h:63
python_control
Definition: cli-script.h:41
python_extension_script_ops
const struct extension_language_script_ops python_extension_script_ops
Definition: python.c:158
python_extension_ops
const struct extension_language_ops python_extension_ops
Definition: python.c:168

Definition at line 68 of file python.c.

Referenced by finalize_python(), gdbpy_enter::gdbpy_enter(), info_auto_load_python_scripts(), and new_python_xmethod_worker().

## ◆ gdb_module

PyObject* gdb_module

Definition at line 116 of file python.c.

Referenced by do_start_initialization(), gdbpy_initialize_arch(), gdbpy_initialize_blocks(), gdbpy_initialize_breakpoints(), gdbpy_initialize_commands(), gdbpy_initialize_event_generic(), gdbpy_initialize_eventregistry(), gdbpy_initialize_finishbreakpoints(), gdbpy_initialize_frames(), gdbpy_initialize_functions(), gdbpy_initialize_inferior(), gdbpy_initialize_linetable(), gdbpy_initialize_objfile(), gdbpy_initialize_parameters(), gdbpy_initialize_pspace(), gdbpy_initialize_py_events(), gdbpy_initialize_symbols(), gdbpy_initialize_symtabs(), gdbpy_initialize_thread(), gdbpy_initialize_types(), gdbpy_initialize_unwind(), and gdbpy_initialize_values().

## ◆ gdb_python_initialized

int gdb_python_initialized

Definition at line 108 of file python.c.

Referenced by add_thread_object(), delete_thread_object(), do_start_initialization(), dynamic_varobj_has_child_method(), gdbpy_apply_frame_filter(), gdbpy_apply_type_printers(), gdbpy_apply_val_pretty_printer(), gdbpy_before_prompt_hook(), gdbpy_enter::gdbpy_enter(), gdbpy_execute_objfile_script(), gdbpy_free_type_printers(), gdbpy_initialized(), gdbpy_source_objfile_script(), gdbpy_start_type_printers(), install_new_value_visualizer(), py_free_inferior(), py_varobj_iter_next(), python_inferior_deleted(), python_inferior_exit(), python_new_inferior(), python_new_objfile(), python_on_normal_stop(), python_on_resume(), save_objfile_types(), varobj_get_display_hint(), varobj_set_visualizer(), and varobj_value_get_print_value().

## ◆ gdb_python_module

PyObject* gdb_python_module

Definition at line 117 of file python.c.

Referenced by do_finish_initialization(), find_pretty_printer_from_gdb(), gdbpy_before_prompt_hook(), gdbpy_get_matching_xmethod_workers(), and pyuw_sniffer().

## ◆ gdbpy_children_cst

PyObject* gdbpy_children_cst

Definition at line 121 of file python.c.

Referenced by do_start_initialization(), dynamic_varobj_has_child_method(), print_children(), and py_varobj_get_iterator().

## ◆ gdbpy_current_objfile

struct objfile* gdbpy_current_objfile
| static

Definition at line 1367 of file python.c.

Referenced by gdbpy_execute_objfile_script(), gdbpy_get_current_objfile(), and gdbpy_source_objfile_script().

## ◆ gdbpy_display_hint_cst

PyObject* gdbpy_display_hint_cst

Definition at line 122 of file python.c.

Referenced by do_start_initialization(), and gdbpy_get_display_hint().

## ◆ gdbpy_doc_cst

PyObject* gdbpy_doc_cst

Definition at line 123 of file python.c.

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

## ◆ gdbpy_enabled_cst

PyObject* gdbpy_enabled_cst

Definition at line 124 of file python.c.

Referenced by do_start_initialization(), and search_pp_list().

## ◆ gdbpy_event_list

struct gdbpy_event* gdbpy_event_list
| static

Definition at line 1001 of file python.c.

Referenced by gdbpy_initialize_events(), gdbpy_post_event(), and gdbpy_run_events().

## ◆ gdbpy_event_list_end

struct gdbpy_event** gdbpy_event_list_end
| static

Definition at line 1003 of file python.c.

Referenced by gdbpy_initialize_events(), gdbpy_post_event(), and gdbpy_run_events().

## ◆ gdbpy_execute_objfile_script

objfile_script_executor_func gdbpy_execute_objfile_script
| static

Definition at line 138 of file python.c.

## ◆ gdbpy_gdb_error

PyObject* gdbpy_gdb_error

Definition at line 131 of file python.c.

Referenced by btrace_func_from_recpy_func(), btrace_insn_from_recpy_insn(), do_start_initialization(), gdbpy_convert_exception(), and recpy_bt_goto().

## ◆ gdbpy_gdb_memory_error

PyObject* gdbpy_gdb_memory_error

Definition at line 134 of file python.c.

Referenced by do_start_initialization(), gdbpy_convert_exception(), gdbpy_create_lazy_string_object(), print_stack_unless_memory_error(), py_varobj_iter_next(), and stpy_convert_to_value().

## ◆ gdbpy_gdberror_exc

PyObject* gdbpy_gdberror_exc

Definition at line 128 of file python.c.

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

## ◆ gdbpy_serial_event

struct serial_event* gdbpy_serial_event
| static

Definition at line 1007 of file python.c.

Referenced by gdbpy_initialize_events(), gdbpy_post_event(), and gdbpy_run_events().

## ◆ gdbpy_should_print_stack

const char* gdbpy_should_print_stack = python_excp_message
| static

Definition at line 58 of file python.c.

Referenced by _initialize_python(), gdbpy_print_python_errors_p(), and gdbpy_print_stack().

## ◆ gdbpy_source_objfile_script

objfile_script_sourcer_func gdbpy_source_objfile_script
| static

Definition at line 137 of file python.c.

## ◆ gdbpy_source_script

script_sourcer_func gdbpy_source_script
| static

Definition at line 136 of file python.c.

## ◆ gdbpy_to_string_cst

PyObject* gdbpy_to_string_cst

Definition at line 120 of file python.c.

Referenced by do_start_initialization(), pretty_print_one_value(), and varobj_value_get_print_value().

## ◆ gdbpy_value_cst

PyObject* gdbpy_value_cst

Definition at line 125 of file python.c.

Referenced by convert_value_from_python(), and do_start_initialization().

## ◆ python_excp_enums

const char* const python_excp_enums[]
| static

Initial value:
=
{
python_excp_none,
python_excp_full,
python_excp_message,
NULL
}
python_excp_message
static const char python_excp_message[]
Definition: python.c:43
python_excp_none
static const char python_excp_none[]
Definition: python.c:41
python_excp_full
static const char python_excp_full[]
Definition: python.c:42

Definition at line 46 of file python.c.

Referenced by _initialize_python().

## ◆ python_excp_full

const char python_excp_full[] = "full"
| static

Definition at line 42 of file python.c.

Referenced by gdbpy_print_stack().

## ◆ python_excp_message

const char python_excp_message[] = "message"
| static

Definition at line 43 of file python.c.

## ◆ python_excp_none

const char python_excp_none[] = "none"
| static

Definition at line 41 of file python.c.

Referenced by gdbpy_print_python_errors_p(), and gdbpy_print_stack().

## ◆ python_extension_ops

const struct extension_language_ops python_extension_ops

Definition at line 168 of file python.c.

## ◆ python_extension_script_ops

const struct extension_language_script_ops python_extension_script_ops

Initial value:
=
{
gdbpy_source_script,
gdbpy_source_objfile_script,
gdbpy_execute_objfile_script,
gdbpy_auto_load_enabled
}
gdbpy_execute_objfile_script
static objfile_script_executor_func gdbpy_execute_objfile_script
Definition: python.c:138
gdbpy_auto_load_enabled
int gdbpy_auto_load_enabled(const struct extension_language_defn *extlang)
Definition: py-auto-load.c:47
gdbpy_source_objfile_script
static objfile_script_sourcer_func gdbpy_source_objfile_script
Definition: python.c:137
gdbpy_source_script
static script_sourcer_func gdbpy_source_script
Definition: python.c:136

Definition at line 158 of file python.c.

## ◆ python_gdbarch

struct gdbarch* python_gdbarch

Definition at line 203 of file python.c.

Referenced by add_thread_object(), bpfinishpy_init(), bppy_init(), delete_thread_object(), finalize_python(), gdbpy_enter::gdbpy_enter(), gdbpy_invoke_xmethod(), gdbpy_target_charset(), gdbpy_target_wide_charset(), mbpy_str(), py_free_inferior(), python_inferior_deleted(), python_new_inferior(), typy_lookup_typename(), unicode_to_target_python_string(), unicode_to_target_string(), and gdbpy_enter::~gdbpy_enter().

## ◆ python_GdbMethods

PyMethodDef python_GdbMethods

Definition at line 1996 of file python.c.

Referenced by do_start_initialization().

## ◆ python_language

const struct language_defn* python_language

Definition at line 204 of file python.c.

Referenced by add_thread_object(), delete_thread_object(), extract_sym(), finalize_python(), gdbpy_decode_line(), gdbpy_enter::gdbpy_enter(), gdbpy_invoke_xmethod(), py_free_inferior(), python_inferior_deleted(), python_new_inferior(), typy_lookup_typename(), valpy_str(), and gdbpy_enter::~gdbpy_enter().

## ◆ user_set_python_list

struct cmd_list_element* user_set_python_list
| static

Definition at line 1608 of file python.c.

Referenced by _initialize_python(), and user_set_python().

## ◆ user_show_python_list

struct cmd_list_element* user_show_python_list
| static

Definition at line 1609 of file python.c.

Referenced by _initialize_python(), and user_show_python().