GDB (xrefs)
|
#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 "gdbsupport/event-loop.h"
#include "readline/tilde.h"
#include "python.h"
#include "extension-priv.h"
#include "cli/cli-utils.h"
#include <ctype.h>
#include "location.h"
#include "run-on-main-thread.h"
#include "gdbsupport/selftest.h"
#include "observable.h"
#include "cli/cli-decode.h"
#include "charset.h"
#include "top.h"
#include "python-internal.h"
#include "linespec.h"
#include "source.h"
#include "gdbsupport/version.h"
#include "target.h"
#include "gdbthread.h"
#include "interps.h"
#include "event-top.h"
#include "py-event.h"
#include "py-event-types.def"
Go to the source code of this file.
Classes | |
class | gdbpy_gil |
struct | gdbpy_event |
Macros | |
#define | GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) |
#define | GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) |
Functions | |
static void | gdbpy_initialize (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 gdb::optional< std::string > | gdbpy_colorize (const std::string &filename, const std::string &contents) |
static gdb::optional< std::string > | gdbpy_colorize_disasm (const std::string &content, gdbarch *gdbarch) |
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 (const setting &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 * | gdbpy_host_charset (PyObject *self, PyObject *args) |
static PyObject * | execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) |
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_invalidate_cached_frames (PyObject *self, PyObject *args) |
static void | gdbpy_source_script (const struct extension_language_defn *extlang, FILE *file, const char *filename) |
static PyObject * | gdbpy_post_event (PyObject *self, PyObject *args) |
static PyObject * | gdbpy_format_address (PyObject *self, PyObject *args, PyObject *kw) |
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) |
void | gdbpy_print_stack_or_quit () |
static PyObject * | gdbpy_progspaces (PyObject *unused1, PyObject *unused2) |
static PyObject * | gdbpy_current_language (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 void | show_python_ignore_environment (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | set_python_ignore_environment (const char *args, int from_tty, struct cmd_list_element *c) |
static void | show_python_dont_write_bytecode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static int | python_write_bytecode () |
static void | set_python_dont_write_bytecode (const char *args, int from_tty, struct cmd_list_element *c) |
static void | finalize_python (void *ignore) |
PyMODINIT_FUNC | init__gdb_module (void) |
static int | emit_exiting_event (int exit_code) |
static void | gdbpy_gdb_exiting (int exit_code) |
static bool | do_start_initialization () |
void | _initialize_python () |
static bool | do_initialize (const struct extension_language_defn *extlang) |
#define GDB_PY_DEFINE_EVENT_TYPE | ( | name, | |
py_name, | |||
doc, | |||
base | |||
) |
#define GDB_PY_DEFINE_EVENT_TYPE | ( | name, | |
py_name, | |||
doc, | |||
base | |||
) |
void _initialize_python | ( | ) |
Definition at line 2272 of file python.c.
Referenced by initialize_all_files().
|
static |
Definition at line 406 of file python.c.
References command_line::line, and command_line::next.
Referenced by gdbpy_eval_from_control_command().
|
static |
Definition at line 2389 of file python.c.
References gdb_datadir, gdb_pymodule_addobject(), gdb_python_module, gdbpy_print_stack(), L, PySys_GetObject, and PySys_SetPath.
Referenced by gdbpy_initialize().
|
static |
Definition at line 2001 of file python.c.
References finalize_python(), gdb::observers::gdb_exiting, gdb_module, gdb_pymodule_addobject(), gdb_python_initialized, gdbpy_children_cst, gdbpy_display_hint_cst, gdbpy_doc_cst, gdbpy_enabled_cst, gdbpy_events_mod_func(), gdbpy_gdb_error, gdbpy_gdb_exiting(), gdbpy_gdb_memory_error, gdbpy_gdberror_exc, gdbpy_initialize_arch(), gdbpy_initialize_auto_load(), gdbpy_initialize_blocks(), gdbpy_initialize_breakpoint_locations(), gdbpy_initialize_breakpoints(), gdbpy_initialize_btrace(), gdbpy_initialize_commands(), gdbpy_initialize_connection(), gdbpy_initialize_disasm(), gdbpy_initialize_event(), gdbpy_initialize_eventregistry(), 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_membuf(), gdbpy_initialize_micommands(), gdbpy_initialize_objfile(), gdbpy_initialize_parameters(), gdbpy_initialize_pspace(), gdbpy_initialize_record(), gdbpy_initialize_registers(), gdbpy_initialize_symbols(), gdbpy_initialize_symtabs(), gdbpy_initialize_thread(), gdbpy_initialize_tui(), gdbpy_initialize_types(), gdbpy_initialize_unwind(), gdbpy_initialize_values(), gdbpy_initialize_xmethods(), gdbpy_to_string_cst, gdbpy_value_cst, host_name, init__gdb_module(), ldirname(), PyErr_NewException, PyEval_InitThreads, python_ignore_environment, python_libdir, python_write_bytecode(), status, target_name, and version.
Referenced by gdbpy_initialize().
|
static |
Definition at line 1969 of file python.c.
References code, create_event_object(), evpy_add_attribute(), evpy_emit_event(), evregpy_no_listeners_p(), gdb_py_events, and gdb_py_object_from_longest().
Referenced by gdbpy_gdb_exiting().
|
static |
Definition at line 307 of file python.c.
Referenced by python_interactive_command().
|
static |
Definition at line 603 of file python.c.
References ui::async, async_enable_stdin(), bpstat_do_actions(), current_ui, current_uiout, execute_control_commands(), execute_control_commands_to_string(), GDB_PY_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), interp_lookup(), interp::interp_ui_out(), prevent_dont_repeat(), and read_command_lines_1().
|
static |
Definition at line 1917 of file python.c.
References extension_language_python, gdbpy_enter::finalize(), gdb_python_initialized, gdbpy_finalize_micommands(), PyGILState_Ensure, restore_active_ext_lang(), and set_active_ext_lang().
Referenced by do_start_initialization().
|
static |
Definition at line 1688 of file python.c.
References EXT_LANG_RC_ERROR, EXT_LANG_RC_NOP, EXT_LANG_RC_OK, func, gdb_python_initialized, gdbpy_print_stack(), if(), ext_lang_type_printers::py_type_printers, python_string_to_host_string(), and type_to_type_object().
|
static |
Definition at line 1073 of file python.c.
References 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(), python_string_to_host_string(), and set_prompt().
|
static |
Definition at line 293 of file python.c.
References gdb_python_initialized.
|
static |
Definition at line 1149 of file python.c.
References gdb_python_initialized, and gdbpy_print_stack().
|
static |
Definition at line 1226 of file python.c.
References gdb_python_initialized, gdbarch_to_arch_object(), and gdbpy_print_stack().
|
static |
Definition at line 1579 of file python.c.
References current_language, host_string_to_python_string(), and language_defn::name().
|
static |
Definition at line 866 of file python.c.
References current_language, decode_line_1(), gdbpy_convert_exception(), get_current_source_symtab_and_line(), set_default_source_symtab_and_line(), string_to_location_spec_basic(), symtab_and_line_to_sal_object(), and WILD.
|
static |
Definition at line 423 of file python.c.
References command_line::body_list_0, command_line::body_list_1, and compute_python_string().
|
static |
Definition at line 1617 of file python.c.
References objfile::arch(), gdb_python_initialized, and gdbpy_current_objfile.
|
static |
Definition at line 1443 of file python.c.
References gdb_flush(), gdb_PyArg_ParseTupleAndKeywords(), gdb_stderr, gdb_stdlog, and gdb_stdout.
|
static |
Definition at line 1299 of file python.c.
References arch_object_to_gdbarch(), string_file::c_str(), current_inferior(), gdb_PyArg_ParseTupleAndKeywords(), inferior::gdbarch, gdbpy_is_architecture(), gdbpy_is_progspace(), get_addr_from_python(), print_address(), progspace_object_to_program_space(), inferior::pspace, and set_current_program_space().
|
static |
Definition at line 1753 of file python.c.
References gdb_python_initialized, if(), and ext_lang_type_printers::py_type_printers.
|
static |
Definition at line 1989 of file python.c.
References emit_exiting_event(), gdb_python_initialized, and gdbpy_print_stack().
Referenced by do_start_initialization().
|
static |
Definition at line 1634 of file python.c.
References gdbpy_current_objfile, and objfile_to_objfile_object().
|
static |
Definition at line 593 of file python.c.
References host_charset().
|
static |
Definition at line 2459 of file python.c.
References do_initialize(), do_start_initialization(), and gdbpy_print_stack().
|
static |
Definition at line 2477 of file python.c.
References gdb_python_initialized.
|
static |
Definition at line 975 of file python.c.
References reinit_frame_cache().
|
static |
Definition at line 539 of file python.c.
References alias, GDB_PY_HANDLE_EXCEPTION, gdbpy_parameter_value(), lookup_cmd_composition(), prefix, and cmd_list_element::var.
PyObject * gdbpy_parameter_value | ( | const setting & | var | ) |
Definition at line 468 of file python.c.
References AUTO_BOOLEAN_FALSE, AUTO_BOOLEAN_TRUE, gdb_py_object_from_longest(), gdb_py_object_from_ulongest(), setting::get(), host_string_to_python_string(), INT_MAX, setting::type(), UINT_MAX, var_auto_boolean, var_boolean, var_enum, var_filename, var_integer, var_optional_filename, var_string, var_string_noescape, var_uinteger, var_zinteger, var_zuinteger, and var_zuinteger_unlimited.
Referenced by gdbpy_parameter(), and get_attr().
|
static |
Definition at line 951 of file python.c.
References GDB_PY_HANDLE_EXCEPTION, parse_and_eval(), and value_to_value_object().
|
static |
Definition at line 1047 of file python.c.
References func, and run_on_main_thread().
int gdbpy_print_python_errors_p | ( | void | ) |
Definition at line 1474 of file python.c.
References gdbpy_should_print_stack, and python_excp_none.
Referenced by print_children().
void gdbpy_print_stack | ( | void | ) |
Definition at line 1484 of file python.c.
References begin_line(), gdb_printf(), gdb_stderr, gdbpy_should_print_stack, python_excp_full, python_excp_none, gdbpy_err_fetch::to_string(), and gdbpy_err_fetch::type_to_string().
Referenced by add_thread_object(), bpfinishpy_detect_out_scope_cb(), bpfinishpy_out_of_scope(), bpfinishpy_post_stop_hook(), bpfinishpy_pre_stop_hook(), cmdpy_function(), connpy_connection_removed(), construct_visualizer(), python_xmethod_worker::do_get_arg_types(), python_xmethod_worker::do_get_result_type(), do_initialize(), evpy_emit_event(), fnpy_call(), gdbpy_apply_type_printers(), gdbpy_before_prompt_hook(), gdbpy_breakpoint_cond_says_stop(), gdbpy_breakpoint_created(), gdbpy_breakpoint_deleted(), gdbpy_breakpoint_modified(), gdbpy_colorize(), gdbpy_colorize_disasm(), gdbpy_gdb_exiting(), gdbpy_get_display_hint(), gdbpy_get_matching_xmethod_workers(), gdbpy_handle_exception(), gdbpy_initialize(), gdbpy_print_insn(), gdbpy_print_stack_or_quit(), gdbpy_rbreak(), gdbpy_start_type_printers(), get_doc_string(), get_set_value(), get_show_value(), install_default_visualizer(), python_xmethod_worker::invoke(), py_varobj_iter::next(), gdbpy_event::operator()(), print_children(), print_stack_unless_memory_error(), py_varobj_get_iterator(), python_free_objfile(), 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(), pyuw_sniffer(), varobj_set_visualizer(), varobj_value_get_print_value(), and gdbpy_enter::~gdbpy_enter().
void gdbpy_print_stack_or_quit | ( | ) |
Definition at line 1544 of file python.c.
References gdbpy_print_stack().
Referenced by gdbpy_apply_frame_filter(), and pyuw_sniffer().
|
static |
Definition at line 1559 of file python.c.
References program_spaces, and pspace_to_pspace_object().
|
static |
Definition at line 708 of file python.c.
References breakpoint_object_type, global_symbol_searcher::filenames, symtab::fullname, FUNCTIONS_DOMAIN, gdb_PyArg_ParseTupleAndKeywords(), gdbpy_print_stack(), interp::next, python_string_to_target_string(), global_symbol_searcher::search(), symtab_to_fullname(), and xfree().
|
static |
|
static |
Definition at line 1596 of file python.c.
References objfile::arch(), gdb_python_initialized, gdbpy_current_objfile, and python_run_simple_file().
|
static |
Definition at line 988 of file python.c.
References python_run_simple_file().
|
static |
Definition at line 1648 of file python.c.
References func, gdb_python_initialized, gdbpy_print_stack(), and ext_lang_type_printers::py_type_printers.
|
static |
Definition at line 573 of file python.c.
References gdbpy_enter::get_gdbarch(), host_charset(), and target_charset().
|
static |
Definition at line 583 of file python.c.
References gdbpy_enter::get_gdbarch(), host_charset(), and target_wide_charset().
|
static |
Definition at line 1402 of file python.c.
References gdb_printf(), GDB_PY_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), gdb_stderr, gdb_stdlog, and gdb_stdout.
PyMODINIT_FUNC init__gdb_module | ( | void | ) |
Definition at line 1960 of file python.c.
References python_GdbModuleDef.
Referenced by do_start_initialization().
|
static |
Definition at line 442 of file python.c.
References ui::async, current_ui, execute_control_command_untraced(), get_command_line(), and python_control.
|
static |
Definition at line 328 of file python.c.
References ui::async, current_ui, dont_repeat(), err, eval_python_command(), gdbpy_print_stack(), and ui::instream.
|
static |
Definition at line 373 of file python.c.
References gdb_python_module, and PyObject_CallMethod.
Referenced by gdbpy_source_objfile_script(), and gdbpy_source_script().
|
static |
Definition at line 1861 of file python.c.
References AUTO_BOOLEAN_AUTO, AUTO_BOOLEAN_TRUE, python_dont_write_bytecode, and python_ignore_environment.
Referenced by do_start_initialization(), and set_python_dont_write_bytecode().
|
static |
Definition at line 1888 of file python.c.
References python_write_bytecode().
|
static |
Definition at line 1816 of file python.c.
References python_ignore_environment.
|
static |
Definition at line 1837 of file python.c.
References AUTO_BOOLEAN_AUTO, gdb_printf(), python_dont_write_bytecode, and python_ignore_environment.
|
static |
Definition at line 1803 of file python.c.
References gdb_printf().
const struct extension_language_defn extension_language_python |
Definition at line 177 of file python.c.
Referenced by finalize_python(), gdbpy_enter::gdbpy_enter(), and info_auto_load_python_scripts().
PyObject* gdb_module |
Definition at line 84 of file python.c.
Referenced by do_start_initialization(), gdbpy_initialize_arch(), gdbpy_initialize_blocks(), gdbpy_initialize_breakpoint_locations(), gdbpy_initialize_breakpoints(), gdbpy_initialize_commands(), gdbpy_initialize_connection(), gdbpy_initialize_disasm(), gdbpy_initialize_event_generic(), gdbpy_initialize_eventregistry(), gdbpy_initialize_finishbreakpoints(), gdbpy_initialize_frames(), gdbpy_initialize_functions(), gdbpy_initialize_inferior(), gdbpy_initialize_linetable(), gdbpy_initialize_membuf(), gdbpy_initialize_micommands(), gdbpy_initialize_objfile(), gdbpy_initialize_parameters(), gdbpy_initialize_pspace(), gdbpy_initialize_registers(), gdbpy_initialize_symbols(), gdbpy_initialize_symtabs(), gdbpy_initialize_thread(), gdbpy_initialize_types(), gdbpy_initialize_unwind(), and gdbpy_initialize_values().
int gdb_python_initialized |
Definition at line 80 of file python.c.
Referenced by add_thread_object(), connpy_connection_removed(), delete_thread_object(), do_start_initialization(), dynamic_varobj_has_child_method(), finalize_python(), gdbpy_apply_frame_filter(), gdbpy_apply_type_printers(), gdbpy_apply_val_pretty_printer(), gdbpy_before_prompt_hook(), gdbpy_check_quit_flag(), gdbpy_colorize(), gdbpy_colorize_disasm(), gdbpy_enter::gdbpy_enter(), gdbpy_execute_objfile_script(), gdbpy_free_type_printers(), gdbpy_gdb_exiting(), gdbpy_initialized(), gdbpy_print_insn(), gdbpy_source_objfile_script(), gdbpy_start_type_printers(), install_new_value_visualizer(), py_varobj_iter::next(), infpy_deleter::operator()(), typy_deleter::operator()(), python_free_objfile(), python_inferior_deleted(), python_inferior_exit(), python_new_inferior(), python_new_objfile(), python_on_normal_stop(), python_on_resume(), varobj_get_display_hint(), varobj_set_visualizer(), and varobj_value_get_print_value().
PyObject* gdb_python_module |
Definition at line 85 of file python.c.
Referenced by do_initialize(), find_pretty_printer_from_gdb(), gdbpy_before_prompt_hook(), gdbpy_get_matching_xmethod_workers(), python_run_simple_file(), and pyuw_sniffer().
PyObject* gdbpy_children_cst |
Definition at line 89 of file python.c.
Referenced by do_start_initialization(), dynamic_varobj_has_child_method(), print_children(), and py_varobj_get_iterator().
struct objfile* gdbpy_current_objfile |
Definition at line 1587 of file python.c.
Referenced by gdbpy_execute_objfile_script(), gdbpy_get_current_objfile(), gdbpy_lookup_objfile(), and gdbpy_source_objfile_script().
PyObject* gdbpy_display_hint_cst |
Definition at line 90 of file python.c.
Referenced by do_start_initialization(), and gdbpy_get_display_hint().
PyObject* gdbpy_doc_cst |
Definition at line 91 of file python.c.
Referenced by cmdpy_init(), do_start_initialization(), and get_doc_string().
PyObject* gdbpy_enabled_cst |
Definition at line 92 of file python.c.
Referenced by do_start_initialization(), and search_pp_list().
|
static |
PyObject* gdbpy_gdb_error |
Definition at line 99 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().
PyObject* gdbpy_gdb_memory_error |
Definition at line 102 of file python.c.
Referenced by disasmpy_set_memory_error_for_address(), do_start_initialization(), gdbpy_convert_exception(), gdbpy_create_lazy_string_object(), gdbpy_print_insn(), py_varobj_iter::next(), print_stack_unless_memory_error(), gdbpy_disassembler::read_memory_func(), and stpy_convert_to_value().
PyObject* gdbpy_gdberror_exc |
Definition at line 96 of file python.c.
Referenced by disasmpy_builtin_disassemble(), do_start_initialization(), gdbpy_handle_exception(), and gdbpy_print_insn().
|
static |
Definition at line 59 of file python.c.
Referenced by gdbpy_print_python_errors_p(), and gdbpy_print_stack().
|
static |
|
static |
PyObject* gdbpy_to_string_cst |
Definition at line 88 of file python.c.
Referenced by do_start_initialization(), pretty_print_one_value(), and varobj_value_get_print_value().
PyObject* gdbpy_value_cst |
Definition at line 93 of file python.c.
Referenced by convert_value_from_python(), and do_start_initialization().
cmd_list_element* python_cmd_element = nullptr |
Definition at line 2268 of file python.c.
Referenced by process_next_line().
|
static |
Definition at line 1832 of file python.c.
Referenced by python_write_bytecode(), and show_python_dont_write_bytecode().
|
static |
|
static |
Definition at line 43 of file python.c.
Referenced by gdbpy_print_stack().
|
static |
Definition at line 42 of file python.c.
Referenced by gdbpy_print_python_errors_p(), and gdbpy_print_stack().
|
static |
|
static |
|
static |
Definition at line 1942 of file python.c.
Referenced by init__gdb_module().
|
static |
Definition at line 1798 of file python.c.
Referenced by do_start_initialization(), python_write_bytecode(), set_python_ignore_environment(), and show_python_dont_write_bytecode().
|
static |
|
static |