2003-02-05 Jim Ingham <jingham@apple.com>
Keith Seitz <keiths@redhat.com>
Elena Zannoni <ezannoni@redhat.com>
Andrew Cagney <ac131313@redhat.com>
* Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o".
(SUBDIR_CLI_SRCS): Add "cli/cli-interp.c".
(SUBDIR_MI_OBS): Add "mi-interp.o".
(SUBDIR_MI_SRCS): Add "mi/mi-interp.c".
(SFILES): Add "interps.c".
(COMMON_OBS): Add "interps.o".
(interps_h, mi_main_h): Define.
(interps.o, cli-interp.o, mi-interp.o): Add dependencies.
(mi-main.o, main.o, event-top.o): Update dependencies.
* cli/cli-interp.c: New file.
* interps.h, interps.c: New files.
* top.c: (gdb_init): Don't install the default interpreter, handed
by captured_main.
* main.c: Include "interps.h".
(interpreter_p): Note that it should malloc'ed.
(captured_command_loop): Call current_interp_command_loop.
(captured_main): Initialize interpreter_p to INTERP_CONSOLE. Use
xfree and xstrdup when updating interpreter_p. Install the
default interpreter. Add hack to stop mi1's copyright notice
being encoded.
* event-top.h (gdb_setup_readline): Declare.
(gdb_disable_readline): Declare.
* event-top.c: Include "interps.h".
(display_gdb_prompt): Call current_interp_display_prompt_p.
(gdb_setup_readline): Initialize gdb_stdout, gdb_stderr,
gdb_stdlog, and gdb_stdtarg.
(_initialize_event_loop): Don't call gdb_setup_readline.
* cli-out.c (cli_out_set_stream): New function.
* cli-out.h (cli_out_set_stream): Declare.
2003-02-06 02:19:12 +01:00
|
|
|
/* MI Command Set for GDB, the GNU debugger.
|
|
|
|
|
2013-01-01 07:33:28 +01:00
|
|
|
Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
2003-02-05 Jim Ingham <jingham@apple.com>
Keith Seitz <keiths@redhat.com>
Elena Zannoni <ezannoni@redhat.com>
Andrew Cagney <ac131313@redhat.com>
* Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o".
(SUBDIR_CLI_SRCS): Add "cli/cli-interp.c".
(SUBDIR_MI_OBS): Add "mi-interp.o".
(SUBDIR_MI_SRCS): Add "mi/mi-interp.c".
(SFILES): Add "interps.c".
(COMMON_OBS): Add "interps.o".
(interps_h, mi_main_h): Define.
(interps.o, cli-interp.o, mi-interp.o): Add dependencies.
(mi-main.o, main.o, event-top.o): Update dependencies.
* cli/cli-interp.c: New file.
* interps.h, interps.c: New files.
* top.c: (gdb_init): Don't install the default interpreter, handed
by captured_main.
* main.c: Include "interps.h".
(interpreter_p): Note that it should malloc'ed.
(captured_command_loop): Call current_interp_command_loop.
(captured_main): Initialize interpreter_p to INTERP_CONSOLE. Use
xfree and xstrdup when updating interpreter_p. Install the
default interpreter. Add hack to stop mi1's copyright notice
being encoded.
* event-top.h (gdb_setup_readline): Declare.
(gdb_disable_readline): Declare.
* event-top.c: Include "interps.h".
(display_gdb_prompt): Call current_interp_display_prompt_p.
(gdb_setup_readline): Initialize gdb_stdout, gdb_stderr,
gdb_stdlog, and gdb_stdtarg.
(_initialize_event_loop): Don't call gdb_setup_readline.
* cli-out.c (cli_out_set_stream): New function.
* cli-out.h (cli_out_set_stream): Declare.
2003-02-06 02:19:12 +01:00
|
|
|
|
2000-02-23 07:19:22 +01:00
|
|
|
Contributed by Cygnus Solutions (a Red Hat company).
|
2000-02-23 01:25:43 +01:00
|
|
|
|
|
|
|
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
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2000-02-23 01:25:43 +01:00
|
|
|
(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
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2000-02-23 01:25:43 +01:00
|
|
|
|
|
|
|
#ifndef MI_CMDS_H
|
|
|
|
#define MI_CMDS_H
|
|
|
|
|
2004-01-20 01:45:29 +01:00
|
|
|
enum print_values {
|
|
|
|
PRINT_NO_VALUES,
|
|
|
|
PRINT_ALL_VALUES,
|
|
|
|
PRINT_SIMPLE_VALUES
|
|
|
|
};
|
|
|
|
|
2008-06-25 17:15:42 +02:00
|
|
|
typedef void (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
|
2000-02-23 01:25:43 +01:00
|
|
|
|
2012-03-06 23:48:53 +01:00
|
|
|
/* Declarations of the functions implementing each command. */
|
|
|
|
|
2011-10-03 23:38:31 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_ada_task_info;
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_add_inferior;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_break_insert;
|
2013-05-21 06:18:55 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_dprintf_insert;
|
2009-08-03 14:39:01 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_break_commands;
|
2010-03-23 22:48:14 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_break_passcount;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_break_watch;
|
2013-10-11 15:48:19 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_catch_assert;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_catch_exception;
|
2012-12-12 22:20:13 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_catch_load;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_catch_unload;
|
2000-02-23 01:25:43 +01:00
|
|
|
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;
|
2010-08-13 15:22:44 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_data_read_memory_bytes;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_data_write_memory;
|
2010-08-13 15:22:44 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_data_write_memory_bytes;
|
2000-03-06 23:57:52 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_data_write_register_values;
|
2007-02-03 00:01:27 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_enable_timings;
|
2002-12-13 18:00:22 +01:00
|
|
|
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;
|
2008-04-24 15:28:06 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_continue;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_finish;
|
2010-02-24 08:33:55 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_interrupt;
|
2009-04-08 08:58:37 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_jump;
|
2008-04-24 15:28:06 +02:00
|
|
|
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;
|
2010-02-24 08:33:55 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_run;
|
2008-04-24 15:28:06 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_step;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_exec_step_instruction;
|
2003-04-03 00:10:35 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
|
2004-06-10 22:05:45 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
|
2005-07-06 16:54:37 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
|
Implement GDB/MI equivalent of "info exceptions" CLI command.
This patch implements a new GDB/MI command implementing the equivalent
of the "info exceptions" CLI command. The command syntax is:
-info-ada-exceptions [REGEXP]
Here is an example of usage (slightly formatted by hand to make it
easier to read):
-info-ada-exceptions ions\.a_
^done,ada-exceptions=
{nr_rows="2",nr_cols="2",
hdr=[{width="1",alignment="-1",col_name="name",colhdr="Name"},
{width="1",alignment="-1",col_name="address",colhdr="Address"}],
body=[{name="global_exceptions.a_global_exception",
address="0x0000000000613a80"},
{name="global_exceptions.a_private_exception",
address="0x0000000000613ac0"}]}
Also, in order to allow graphical frontends to easily determine
whether this command is available or not, the output of the
"-list-features" command has been augmented to contain
"info-ada-exceptions".
gdb/Changelog:
* mi/mi-cmds.h (mi_cmd_info_ada_exceptions): Add declaration.
* mi/mi-cmds.c (mi_cmds): Add entry for -info-ada-exceptions
command.
* mi/mi-cmd-info.c: #include "ada-lang.c" and "arch-utils.c".
(mi_cmd_info_ada_exceptions): New function.
* mi/mi-main.c (mi_cmd_list_features): Add "info-ada-exceptions".
gdb/testsuite/ChangeLog:
* gdb.ada/mi_exc_info: New testcase.
2013-11-07 14:15:46 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_info_ada_exceptions;
|
New GDB/MI command "-info-gdb-mi-command"
This patch adds a new GDB/MI command meant for graphical frontends
trying to determine whether a given GDB/MI command exists or not.
Examples:
-info-gdb-mi-command unsupported-command
^done,command={exists="false"}
(gdb)
-info-gdb-mi-command symbol-list-lines
^done,command={exists="true"}
(gdb)
At the moment, this is the only piece of information that this
command returns.
Eventually, and if needed, we can extend it to provide
command-specific pieces of information, such as updates to
the command's syntax since inception. This could become,
for instance:
-info-gdb-mi-command symbol-list-lines
^done,command={exists="true",features=[]}
(gdb)
-info-gdb-mi-command catch-assert
^done,command={exists="true",features=["conditions"]}
In the first case, it would mean that no extra features,
while in the second, it announces that the -catch-assert
command in this version of the debugger supports a feature
called "condition" - exact semantics to be documented with
combined with the rest of the queried command's documentation.
But for now, we start small, and only worry about existance.
And to bootstrap the process, I have added an entry in the
output of the -list-features command as well ("info-gdb-mi-command"),
allowing the graphical frontends to go through the following process:
1. Send -list-features, collect info from there as before;
2. Check if the output contains "info-gdb-mi-command".
If it does, then support for various commands can be
queried though -info-gdb-mi-command. Newer commands
will be expected to always be checked via this new
-info-gdb-mi-command.
gdb/ChangeLog:
* mi/mi-cmds.h (mi_cmd_info_gdb_mi_command): Declare.
* mi/mi-cmd-info.c (mi_cmd_info_gdb_mi_command): New function.
* mi/mi-cmds.c (mi_cmds): Add -info-gdb-mi-command command.
* mi/mi-main.c (mi_cmd_list_features): Add "info-gdb-mi-command"
field to output of "-list-features".
* NEWS: Add entry for new -info-gdb-mi-command.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Miscellaneous Commands): Document
the new -info-gdb-mi-command GDB/MI command. Document
the meaning of "-info-gdb-mi-command" in the output of
-list-features.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-i-cmd.exp: New file.
2013-11-12 11:51:30 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_info_gdb_mi_command;
|
2012-05-24 02:33:47 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_info_os;
|
2003-02-05 Jim Ingham <jingham@apple.com>
Keith Seitz <keiths@redhat.com>
Elena Zannoni <ezannoni@redhat.com>
Andrew Cagney <ac131313@redhat.com>
* Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o".
(SUBDIR_CLI_SRCS): Add "cli/cli-interp.c".
(SUBDIR_MI_OBS): Add "mi-interp.o".
(SUBDIR_MI_SRCS): Add "mi/mi-interp.c".
(SFILES): Add "interps.c".
(COMMON_OBS): Add "interps.o".
(interps_h, mi_main_h): Define.
(interps.o, cli-interp.o, mi-interp.o): Add dependencies.
(mi-main.o, main.o, event-top.o): Update dependencies.
* cli/cli-interp.c: New file.
* interps.h, interps.c: New files.
* top.c: (gdb_init): Don't install the default interpreter, handed
by captured_main.
* main.c: Include "interps.h".
(interpreter_p): Note that it should malloc'ed.
(captured_command_loop): Call current_interp_command_loop.
(captured_main): Initialize interpreter_p to INTERP_CONSOLE. Use
xfree and xstrdup when updating interpreter_p. Install the
default interpreter. Add hack to stop mi1's copyright notice
being encoded.
* event-top.h (gdb_setup_readline): Declare.
(gdb_disable_readline): Declare.
* event-top.c: Include "interps.h".
(display_gdb_prompt): Call current_interp_display_prompt_p.
(gdb_setup_readline): Initialize gdb_stdout, gdb_stderr,
gdb_stdlog, and gdb_stdtarg.
(_initialize_event_loop): Don't call gdb_setup_readline.
* cli-out.c (cli_out_set_stream): New function.
* cli-out.h (cli_out_set_stream): Declare.
2003-02-06 02:19:12 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
|
2007-09-16 16:59:31 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_list_features;
|
2008-08-19 15:05:02 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_list_target_features;
|
2008-11-17 13:13:49 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_list_thread_groups;
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_remove_inferior;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
|
2005-06-19 05:12:15 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_info_frame;
|
2000-02-23 01:25:43 +01:00
|
|
|
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;
|
2009-09-19 11:59:29 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_list_variables;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
|
2003-05-04 05:50:13 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
|
2008-11-17 17:37:35 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_target_detach;
|
* remote.c (remote_cmdlist): New variable.
(PACKET_vFile_open, PACKET_vFile_pread, PACKET_vFile_pwrite)
(PACKET_vFile_close, PACKET_vFile_unlink): New constants.
(remote_buffer_add_string, remote_buffer_add_bytes)
(remote_buffer_add_int, remote_hostio_parse_result)
(remote_hostio_send_command, remote_hostio_open, remote_hostio_pwrite)
(remote_hostio_pread, remote_hostio_close, remote_hostio_unlink)
(remote_fileio_errno_to_host, remote_hostio_error, fclose_cleanup)
(remote_hostio_close_cleanup, remote_file_put, remote_file_get)
(remote_file_delete, remote_put_command, remote_get_command)
(remote_delete_command, remote_command): New functions.
(_initialize_remote): Register new packets and commands.
* Makefile.in (gdb_fileio_h): New variable.
(remote.o): Update.
(SUBDIR_MI_OBS): Add mi-cmd-target.o.
(SUBDIR_MI_SRCS): Add mi/mi-cmd-target.c.
(mi-cmd-target.o): New rule.
* mi/mi-cmd-target.c: New file.
* mi/mi-cmds.c (mi_cmds): Add target-file-delete, target-file-get,
and target-file-put.
* mi/mi-cmds.h (mi_cmd_target_file_get, mi_cmd_target_file_put)
(mi_cmd_target_file_delete): Declare.
* remote.h (remote_file_put, remote_file_get, remote_file_delete):
Declare.
* NEWS: Describe new file transfer support.
* gdb.texinfo (Debugging Programs with Multiple Processes): Correct
formatting.
(Remote Debugging): Add File Transfer section.
(Remote Configuration): Document Host I/O packets.
(GDB/MI): Add GDB/MI File Transfer Commands section.
(Remote Protocol): Add Host I/O Packets section.
(Packets): Add vFile.
* Makefile.in (OBS): Add hostio.o.
(hostio.o): New rule.
* server.h (handle_vFile): Declare.
* hostio.c: New file.
* server.c (handle_v_requests): Take packet_len and new_packet_len
for binary packets. Call handle_vFile.
(main): Update call to handle_v_requests.
* gdb.server/file-transfer.exp, gdb.server/transfer.txt,
gdb.mi/mi-file-transfer.exp: New.
2007-11-30 22:50:19 +01:00
|
|
|
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;
|
2008-03-15 14:53:25 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_info;
|
2000-02-23 01:25:43 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_thread_select;
|
2010-03-23 22:50:11 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_define_variable;
|
2010-03-23 23:01:47 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_find;
|
2013-06-26 10:17:27 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_frame_collected;
|
2010-03-23 22:50:11 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_list_variables;
|
2010-03-23 23:05:46 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_save;
|
2010-03-23 22:46:33 +01:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_start;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_status;
|
|
|
|
extern mi_cmd_argv_ftype mi_cmd_trace_stop;
|
2000-02-23 01:25:43 +01:00
|
|
|
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;
|
2007-08-31 20:52:05 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_var_info_path_expression;
|
2000-02-23 01:25:43 +01:00
|
|
|
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;
|
2007-04-14 11:51:30 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_frozen;
|
2009-05-28 03:09:20 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_visualizer;
|
2000-02-23 01:25:43 +01:00
|
|
|
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;
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 20:51:26 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_enable_pretty_printing;
|
2013-05-10 Phil Muldoon <pmuldoon@redhat.com>
* stack.c (backtrace_command_1): Add "no-filters", and Python frame
filter logic.
(backtrace_command): Add "no-filters" option parsing.
(_initialize_stack): Alter help to reflect "no-filters" option.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-framefilter.o
(SUBDIR_PYTHON_SRCS): Add py-framefilter.c
(py-frame.o): Add target
* data-directory/Makefile.in (PYTHON_DIR): Add Python frame
filter files.
* python/python.h: Add new frame filter constants, and flag enum.
(apply_frame_filter): Add definition.
* python/python.c (apply_frame_filter): New non-Python
enabled function.
* python/py-utils.c (py_xdecref): New function.
(make_cleanup_py_xdecref): Ditto.
* python/py-objfile.c: Declare frame_filters dictionary.
(objfpy_dealloc): Add frame_filters dealloc.
(objfpy_new): Initialize frame_filters attribute.
(objfile_to_objfile_object): Ditto.
(objfpy_get_frame_filters): New function.
(objfpy_set_frame_filters): New function.
* python/py-progspace.c: Declare frame_filters dictionary.
(pspy_dealloc): Add frame_filters dealloc.
(pspy_new): Initialize frame_filters attribute.
(pspacee_to_pspace_object): Ditto.
(pspy_get_frame_filters): New function.
(pspy_set_frame_filters): New function.
* python/py-framefilter.c: New file.
* python/lib/gdb/command/frame_filters.py: New file.
* python/lib/gdb/frames.py: New file.
* python/lib/gdb/__init__.py: Initialize global frame_filters
dictionary
* python/lib/gdb/FrameDecorator.py: New file.
* python/lib/gdb/FrameIterator.py: New file.
* mi/mi-cmds.c (mi_cmds): Add frame filters command.
* mi/mi-cmds.h: Declare.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Add
--no-frame-filter logic, and Python frame filter logic.
(stack_enable_frame_filters): New function.
(parse_no_frame_option): Ditto.
(mi_cmd_stack_list_frames): Add --no-frame-filter and Python frame
filter logic.
(mi_cmd_stack_list_locals): Ditto.
(mi_cmd_stack_list_args): Ditto.
(mi_cmd_stack_list_variables): Ditto.
* NEWS: Add frame filter note.
2013-05-10 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-framefilter.py: New File.
* gdb.python/py-framefilter-mi.exp: Ditto.
* gdb.python/py-framefilter.c: Ditto.
* gdb.python/py-framefilter-mi.exp: Ditto.
* gdb.python/py-framefilter-mi.c: Ditto,
* gdb.python/py-framefilter-gdb.py.in: Ditto.
2013-05-10 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Backtrace): Add "no-filter" argument.
(Python API): Add Frame Filters API, Frame Wrapper API,
Writing a Frame Filter/Wrapper, Managing Management of Frame
Filters chapter entries.
(Frame Filters API): New Node.
(Frame Wrapper API): New Node.
(Writing a Frame Filter): New Node.
(Managing Frame Filters): New Node.
(Progspaces In Python): Add note about frame_filters attribute.
(Objfiles in Python): Ditto.
(GDB/MI Stack Manipulation): Add -enable-frame-filters command,
@anchors and --no-frame-filters option to -stack-list-variables,
-stack-list-frames, -stack-list-locals and -stack-list-arguments
commands.
2013-05-10 12:26:03 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_enable_frame_filters;
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 20:51:26 +02:00
|
|
|
extern mi_cmd_argv_ftype mi_cmd_var_set_update_range;
|
2000-02-23 01:25:43 +01:00
|
|
|
|
2012-03-06 23:48:53 +01:00
|
|
|
/* Description of a single command. */
|
2000-02-23 01:25:43 +01:00
|
|
|
|
2003-08-05 01:18:50 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2000-02-23 01:25:43 +01:00
|
|
|
struct mi_cmd
|
2003-08-05 01:18:50 +02:00
|
|
|
{
|
2012-03-06 23:48:53 +01:00
|
|
|
/* Official name of the command. */
|
2003-08-05 01:18:50 +02:00
|
|
|
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;
|
2012-08-31 10:41:57 +02:00
|
|
|
/* If non-null, the pointer to a field in
|
|
|
|
'struct mi_suppress_notification', which will be set to true by MI
|
|
|
|
command processor (mi-main.c:mi_cmd_execute) when this command is
|
|
|
|
being executed. It will be set back to false when command has been
|
|
|
|
executed. */
|
|
|
|
int *suppress_notification;
|
2003-08-05 01:18:50 +02:00
|
|
|
};
|
2000-02-23 01:25:43 +01:00
|
|
|
|
2012-03-06 23:48:53 +01:00
|
|
|
/* Lookup a command in the MI command table. */
|
2000-02-23 01:25:43 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2013-03-12 19:50:39 +01:00
|
|
|
extern void mi_execute_command (const char *cmd, int from_tty);
|
2003-02-05 Jim Ingham <jingham@apple.com>
Keith Seitz <keiths@redhat.com>
Elena Zannoni <ezannoni@redhat.com>
Andrew Cagney <ac131313@redhat.com>
* Makefile.in (SUBDIR_CLI_OBS): Add "cli-interp.o".
(SUBDIR_CLI_SRCS): Add "cli/cli-interp.c".
(SUBDIR_MI_OBS): Add "mi-interp.o".
(SUBDIR_MI_SRCS): Add "mi/mi-interp.c".
(SFILES): Add "interps.c".
(COMMON_OBS): Add "interps.o".
(interps_h, mi_main_h): Define.
(interps.o, cli-interp.o, mi-interp.o): Add dependencies.
(mi-main.o, main.o, event-top.o): Update dependencies.
* cli/cli-interp.c: New file.
* interps.h, interps.c: New files.
* top.c: (gdb_init): Don't install the default interpreter, handed
by captured_main.
* main.c: Include "interps.h".
(interpreter_p): Note that it should malloc'ed.
(captured_command_loop): Call current_interp_command_loop.
(captured_main): Initialize interpreter_p to INTERP_CONSOLE. Use
xfree and xstrdup when updating interpreter_p. Install the
default interpreter. Add hack to stop mi1's copyright notice
being encoded.
* event-top.h (gdb_setup_readline): Declare.
(gdb_disable_readline): Declare.
* event-top.c: Include "interps.h".
(display_gdb_prompt): Call current_interp_display_prompt_p.
(gdb_setup_readline): Initialize gdb_stdout, gdb_stderr,
gdb_stdlog, and gdb_stdtarg.
(_initialize_event_loop): Don't call gdb_setup_readline.
* cli-out.c (cli_out_set_stream): New function.
* cli-out.h (cli_out_set_stream): Declare.
2003-02-06 02:19:12 +01:00
|
|
|
|
2000-02-23 01:25:43 +01:00
|
|
|
#endif
|