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.
|
|
|
|
|
2009-01-03 06:58:08 +01:00
|
|
|
Copyright (C) 2000, 2003, 2004, 2005, 2007, 2008, 2009
|
2008-01-01 23:53:26 +01:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2005-07-15 06:12:19 +02:00
|
|
|
extern const char mi_no_values[];
|
|
|
|
extern const char mi_simple_values[];
|
|
|
|
extern const char mi_all_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
|
|
|
|
|
|
|
/* 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;
|
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;
|
|
|
|
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;
|
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;
|
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;
|
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;
|
|
|
|
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;
|
|
|
|
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;
|
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;
|
|
|
|
|
|
|
|
/* Description of a single command. */
|
|
|
|
|
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
|
|
|
{
|
|
|
|
/* 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;
|
|
|
|
};
|
2000-02-23 01:25:43 +01:00
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
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 void mi_execute_command (char *cmd, int from_tty);
|
|
|
|
|
2000-02-23 01:25:43 +01:00
|
|
|
#endif
|