b631324398
2009-05-27 Vladimir Prus <vladimir@codesourcery.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * mi/mi-main.c (mi_cmd_list_features): List "python" feature. * varobj.h (varobj_set_visualizer): Declare. (varobj_get_display_hint): Likewise. (varobj_update_result_t) <children_changed, value_installed>: New fields. * mi/mi-cmds.c (mi_cmds): Add var-set-visualizer. * mi/mi-cmds.h (mi_cmd_var_set_visualizer, mi_cmd_var_set_child_range): Declare. * mi/mi-cmd-var.c (mi_cmd_var_set_visualizer): New function. (mi_cmd_var_list_children): Emit display hint. (varobj_update_one): Emit display hint. Handle dynamic children. * python/python.c (GdbMethods): Add "default_visualizer". * python/python-internal.h (apply_varobj_pretty_printer, gdbpy_get_varobj_pretty_printer, gdbpy_get_display_hint): Declare. (gdbpy_default_visualizer): Likewise. * varobj.c: Include python.h, python-internal.h. (PyObject): New typedef. (struct varobj) <children_requested, pretty_printer>: New fields. (varobj_create): Call install_default_visualizer. (instantiate_pretty_printer): New function. (varobj_set_display_format): Update. (varobj_get_display_hint): New function. (update_dynamic_varobj_children): New function. (varobj_get_num_children): Handle dynamic children. (varobj_list_children): Likewise. (install_new_value): Likewise. (varobj_add_child): New function. (install_visualizer): Likewise. (install_default_visualizer): Likewise. (varobj_set_visualizer): Likewise. (varobj_update): Handle dynamic children. (create_child): Use create_child_with_value. (create_child_with_value): New function. (value_get_print_value): Call pretty printer. Add value_formatter argument. (c_value_of_variable): Update. (varobj_invalidate): Always free all_rootvarobj. * python/python-prettyprint.c (apply_varobj_pretty_printer): New function. (gdbpy_get_varobj_pretty_printer): Likewise. (gdbpy_default_visualizer): Likewise. gdb/doc 2009-05-27 Tom Tromey <tromey@redhat.com> * gdb.texinfo (GDB/MI Miscellaneous Commands): Document "python" feature. (GDB/MI Variable Objects): Document -var-set-visualizer. gdb/testsuite 2009-05-27 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * lib/mi-support.exp (mi_varobj_update_dynamic): New proc. (mi_child_regexp): Likewise. (mi_list_varobj_children_range): Likewise. (mi_get_features): Likewise. (mi_list_varobj_children): Rewrite. * gdb.python/python-mi.exp: New file.
135 lines
5 KiB
C
135 lines
5 KiB
C
/* MI Command Set for GDB, the GNU debugger.
|
|
|
|
Copyright (C) 2000, 2003, 2004, 2005, 2007, 2008, 2009
|
|
Free Software Foundation, Inc.
|
|
|
|
Contributed by Cygnus Solutions (a Red Hat company).
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef MI_CMDS_H
|
|
#define MI_CMDS_H
|
|
|
|
enum print_values {
|
|
PRINT_NO_VALUES,
|
|
PRINT_ALL_VALUES,
|
|
PRINT_SIMPLE_VALUES
|
|
};
|
|
|
|
extern const char mi_no_values[];
|
|
extern const char mi_simple_values[];
|
|
extern const char mi_all_values[];
|
|
|
|
typedef void (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
|
|
|
|
/* Function implementing each command */
|
|
extern mi_cmd_argv_ftype mi_cmd_break_insert;
|
|
extern mi_cmd_argv_ftype mi_cmd_break_watch;
|
|
extern mi_cmd_argv_ftype mi_cmd_disassemble;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_evaluate_expression;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_list_register_names;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_list_register_values;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_list_changed_registers;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_read_memory;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_write_memory;
|
|
extern mi_cmd_argv_ftype mi_cmd_data_write_register_values;
|
|
extern mi_cmd_argv_ftype mi_cmd_enable_timings;
|
|
extern mi_cmd_argv_ftype mi_cmd_env_cd;
|
|
extern mi_cmd_argv_ftype mi_cmd_env_dir;
|
|
extern mi_cmd_argv_ftype mi_cmd_env_path;
|
|
extern mi_cmd_argv_ftype mi_cmd_env_pwd;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_continue;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_finish;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_jump;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_next;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_next_instruction;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_return;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_step;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_step_instruction;
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_interrupt;
|
|
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
|
|
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files;
|
|
extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
|
|
extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set;
|
|
extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
|
|
extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
|
|
extern mi_cmd_argv_ftype mi_cmd_list_features;
|
|
extern mi_cmd_argv_ftype mi_cmd_list_target_features;
|
|
extern mi_cmd_argv_ftype mi_cmd_list_thread_groups;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_info_frame;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
|
|
extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
|
|
extern mi_cmd_argv_ftype mi_cmd_target_detach;
|
|
extern mi_cmd_argv_ftype mi_cmd_target_file_get;
|
|
extern mi_cmd_argv_ftype mi_cmd_target_file_put;
|
|
extern mi_cmd_argv_ftype mi_cmd_target_file_delete;
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_info;
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_select;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_assign;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_create;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_delete;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_evaluate_expression;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_info_expression;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_info_path_expression;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_info_num_children;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_info_type;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_list_children;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_format;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_frozen;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_visualizer;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_show_format;
|
|
extern mi_cmd_argv_ftype mi_cmd_var_update;
|
|
|
|
/* Description of a single command. */
|
|
|
|
struct mi_cli
|
|
{
|
|
/* Corresponding CLI command. If ARGS_P is non-zero, the MI
|
|
command's argument list is appended to the CLI command. */
|
|
const char *cmd;
|
|
int args_p;
|
|
};
|
|
|
|
struct mi_cmd
|
|
{
|
|
/* official name of the command. */
|
|
const char *name;
|
|
/* The corresponding CLI command that can be used to implement this
|
|
MI command (if cli.lhs is non NULL). */
|
|
struct mi_cli cli;
|
|
/* If non-null, the function implementing the MI command. */
|
|
mi_cmd_argv_ftype *argv_func;
|
|
};
|
|
|
|
/* Lookup a command in the mi comand table */
|
|
|
|
extern struct mi_cmd *mi_lookup (const char *command);
|
|
|
|
/* Debug flag */
|
|
extern int mi_debug_p;
|
|
|
|
/* Raw console output - FIXME: should this be a parameter? */
|
|
extern struct ui_file *raw_stdout;
|
|
|
|
extern void mi_execute_command (char *cmd, int from_tty);
|
|
|
|
#endif
|