binutils-gdb/gdb/mi/mi-cmd-target.c

95 lines
2.5 KiB
C
Raw Normal View History

* 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
/* MI Command Set - target commands.
Copyright (C) 2007-2018 Free Software Foundation, Inc.
* 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
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/>. */
#include "defs.h"
#include "mi-cmds.h"
#include "mi-getopt.h"
#include "remote.h"
/* Get a file from the target. */
void
-Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter -Wwrite-strings flags this attempt to pass a literal to a "char *": mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2); Fix that by constifying mi_cmd_argv_ftype's 'command' parameter and adjusting all MI commands. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert) (mi_cmd_dprintf_insert, mi_cmd_break_passcount) (mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command' parameter. * mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception) (mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command' parameter. * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path) (mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show) * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) (mi_cmd_file_list_exec_source_files) (mi_cmd_file_list_shared_libraries): Constify 'command' parameter. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions) (mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command' parameter. * mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters) (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth) (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables, mi_cmd_stack_select_frame) (mi_cmd_stack_info_frame): Constify 'command' parameter. * mi/mi-cmd-target.c (mi_cmd_target_file_get) (mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify 'command' parameter. * mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete) (mi_cmd_var_set_format, mi_cmd_var_set_visualizer) (mi_cmd_var_set_frozen, mi_cmd_var_show_format) (mi_cmd_var_info_num_children, mi_cmd_var_list_children) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_show_attributes) (mi_cmd_var_evaluate_expression, mi_cmd_var_assign) (mi_cmd_var_update, mi_cmd_enable_pretty_printing) (mi_cmd_var_set_update_range): Constify 'command' parameter. * mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter. * mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command' parameter. * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next) (mi_cmd_exec_next_instruction, mi_cmd_exec_step) (mi_cmd_exec_step_instruction, mi_cmd_exec_finish) (mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue) (mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach) (mi_cmd_target_flash_erase, mi_cmd_thread_select) (mi_cmd_thread_list_ids, mi_cmd_thread_info) (mi_cmd_list_thread_groups, mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers) (mi_cmd_data_write_register_values) (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory) (mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings) (mi_cmd_list_features, mi_cmd_list_target_features) (mi_cmd_add_inferior, mi_cmd_remove_inferior) (mi_cmd_trace_define_variable, mi_cmd_trace_list_variables) (mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start) (mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info) (mi_cmd_trace_frame_collected): Constify 'command' parameter. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify 'command' parameter.
2017-04-05 20:21:34 +02:00
mi_cmd_target_file_get (const char *command, char **argv, int argc)
* 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
{
int oind = 0;
char *oarg;
* 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
const char *remote_file, *local_file;
static const struct mi_opt opts[] =
{
{ 0, 0, 0 }
};
static const char prefix[] = "-target-file-get";
* 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
if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
|| oind != argc - 2)
gdb * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Fix error messages. * mi/mi-main.c (mi_cmd_thread_select): Fix error messages. (mi_cmd_thread_list_ids): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_list_register_values): Likewise. (mi_cmd_data_write_register_values): Likewise. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory): Likewise. (mi_cmd_enable_timings): Likewise. * mi/mi-interp.c (mi_cmd_interpreter_exec): Fix error messages. * mi/mi-cmd-var.c (mi_cmd_var_create): Fix error messages. (mi_cmd_var_delete): Likewise. (mi_cmd_var_set_format): Likewise. (mi_cmd_var_show_format): Likewise. (mi_cmd_var_info_num_children): Likewise. (mi_cmd_var_list_children): Likewise. (mi_cmd_var_info_type): Likewise. (mi_cmd_var_info_expression): Likewise. (mi_cmd_var_show_attributes): Likewise. (mi_cmd_var_assign): Likewise. (mi_cmd_var_update): Likewise. (mi_cmd_enable_pretty_printing): Likewise. (mi_cmd_var_set_update_range): Likewise. * mi/mi-cmd-target.c (mi_cmd_target_file_get): Fix error messages. (mi_cmd_target_file_put): Likewise. (mi_cmd_target_file_delete): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Fix error messages. (mi_cmd_stack_info_depth): Likewise. (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_args): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_info_frame): Likewise. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Fix error messages. (mi_cmd_file_list_exec_source_files): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_pwd): Fix error messages. (mi_cmd_env_cd): Likewise. (mi_cmd_env_path): Likewise. (mi_cmd_env_dir): Likewise. (mi_cmd_inferior_tty_show): Likewise. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Fix error messages. * mi/mi-cmd-break.c (mi_cmd_break_insert): Fix error messages. (mi_cmd_break_watch): Likewise. gdb/testsuite * gdb.mi/gdb2549.exp: Update for error message changes. * gdb.mi/mi-cli.exp: Likewise. * gdb.mi/mi-disassemble.exp: Likewise. * gdb.mi/mi-pthreads.exp: Likewise. * gdb.mi/mi-regs.exp: Likewise. * gdb.mi/mi-stack.exp: Likewise. * gdb.mi/mi-var-block.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-disassemble.exp: Likewise. * gdb.mi/mi2-pthreads.exp: Likewise. * gdb.mi/mi2-regs.exp: Likewise. * gdb.mi/mi2-stack.exp: Likewise. * gdb.mi/mi2-var-block.exp: Likewise. * gdb.mi/mi2-var-cmd.exp: Likewise.
2011-01-12 22:09:39 +01:00
error (_("-target-file-get: Usage: REMOTE_FILE LOCAL_FILE"));
* 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
remote_file = argv[oind];
local_file = argv[oind + 1];
* 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
remote_file_get (remote_file, local_file, 0);
}
/* Send a file to the target. */
void
-Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter -Wwrite-strings flags this attempt to pass a literal to a "char *": mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2); Fix that by constifying mi_cmd_argv_ftype's 'command' parameter and adjusting all MI commands. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert) (mi_cmd_dprintf_insert, mi_cmd_break_passcount) (mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command' parameter. * mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception) (mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command' parameter. * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path) (mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show) * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) (mi_cmd_file_list_exec_source_files) (mi_cmd_file_list_shared_libraries): Constify 'command' parameter. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions) (mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command' parameter. * mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters) (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth) (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables, mi_cmd_stack_select_frame) (mi_cmd_stack_info_frame): Constify 'command' parameter. * mi/mi-cmd-target.c (mi_cmd_target_file_get) (mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify 'command' parameter. * mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete) (mi_cmd_var_set_format, mi_cmd_var_set_visualizer) (mi_cmd_var_set_frozen, mi_cmd_var_show_format) (mi_cmd_var_info_num_children, mi_cmd_var_list_children) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_show_attributes) (mi_cmd_var_evaluate_expression, mi_cmd_var_assign) (mi_cmd_var_update, mi_cmd_enable_pretty_printing) (mi_cmd_var_set_update_range): Constify 'command' parameter. * mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter. * mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command' parameter. * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next) (mi_cmd_exec_next_instruction, mi_cmd_exec_step) (mi_cmd_exec_step_instruction, mi_cmd_exec_finish) (mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue) (mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach) (mi_cmd_target_flash_erase, mi_cmd_thread_select) (mi_cmd_thread_list_ids, mi_cmd_thread_info) (mi_cmd_list_thread_groups, mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers) (mi_cmd_data_write_register_values) (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory) (mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings) (mi_cmd_list_features, mi_cmd_list_target_features) (mi_cmd_add_inferior, mi_cmd_remove_inferior) (mi_cmd_trace_define_variable, mi_cmd_trace_list_variables) (mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start) (mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info) (mi_cmd_trace_frame_collected): Constify 'command' parameter. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify 'command' parameter.
2017-04-05 20:21:34 +02:00
mi_cmd_target_file_put (const char *command, char **argv, int argc)
* 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
{
int oind = 0;
char *oarg;
* 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
const char *remote_file, *local_file;
static const struct mi_opt opts[] =
{
{ 0, 0, 0 }
};
static const char prefix[] = "-target-file-put";
* 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
if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
|| oind != argc - 2)
gdb * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Fix error messages. * mi/mi-main.c (mi_cmd_thread_select): Fix error messages. (mi_cmd_thread_list_ids): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_list_register_values): Likewise. (mi_cmd_data_write_register_values): Likewise. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory): Likewise. (mi_cmd_enable_timings): Likewise. * mi/mi-interp.c (mi_cmd_interpreter_exec): Fix error messages. * mi/mi-cmd-var.c (mi_cmd_var_create): Fix error messages. (mi_cmd_var_delete): Likewise. (mi_cmd_var_set_format): Likewise. (mi_cmd_var_show_format): Likewise. (mi_cmd_var_info_num_children): Likewise. (mi_cmd_var_list_children): Likewise. (mi_cmd_var_info_type): Likewise. (mi_cmd_var_info_expression): Likewise. (mi_cmd_var_show_attributes): Likewise. (mi_cmd_var_assign): Likewise. (mi_cmd_var_update): Likewise. (mi_cmd_enable_pretty_printing): Likewise. (mi_cmd_var_set_update_range): Likewise. * mi/mi-cmd-target.c (mi_cmd_target_file_get): Fix error messages. (mi_cmd_target_file_put): Likewise. (mi_cmd_target_file_delete): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Fix error messages. (mi_cmd_stack_info_depth): Likewise. (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_args): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_info_frame): Likewise. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Fix error messages. (mi_cmd_file_list_exec_source_files): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_pwd): Fix error messages. (mi_cmd_env_cd): Likewise. (mi_cmd_env_path): Likewise. (mi_cmd_env_dir): Likewise. (mi_cmd_inferior_tty_show): Likewise. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Fix error messages. * mi/mi-cmd-break.c (mi_cmd_break_insert): Fix error messages. (mi_cmd_break_watch): Likewise. gdb/testsuite * gdb.mi/gdb2549.exp: Update for error message changes. * gdb.mi/mi-cli.exp: Likewise. * gdb.mi/mi-disassemble.exp: Likewise. * gdb.mi/mi-pthreads.exp: Likewise. * gdb.mi/mi-regs.exp: Likewise. * gdb.mi/mi-stack.exp: Likewise. * gdb.mi/mi-var-block.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-disassemble.exp: Likewise. * gdb.mi/mi2-pthreads.exp: Likewise. * gdb.mi/mi2-regs.exp: Likewise. * gdb.mi/mi2-stack.exp: Likewise. * gdb.mi/mi2-var-block.exp: Likewise. * gdb.mi/mi2-var-cmd.exp: Likewise.
2011-01-12 22:09:39 +01:00
error (_("-target-file-put: Usage: LOCAL_FILE REMOTE_FILE"));
* 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
local_file = argv[oind];
remote_file = argv[oind + 1];
* 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
remote_file_put (local_file, remote_file, 0);
}
/* Delete a file on the target. */
void
-Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter -Wwrite-strings flags this attempt to pass a literal to a "char *": mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2); Fix that by constifying mi_cmd_argv_ftype's 'command' parameter and adjusting all MI commands. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert) (mi_cmd_dprintf_insert, mi_cmd_break_passcount) (mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command' parameter. * mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception) (mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command' parameter. * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path) (mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show) * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) (mi_cmd_file_list_exec_source_files) (mi_cmd_file_list_shared_libraries): Constify 'command' parameter. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions) (mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command' parameter. * mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters) (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth) (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables, mi_cmd_stack_select_frame) (mi_cmd_stack_info_frame): Constify 'command' parameter. * mi/mi-cmd-target.c (mi_cmd_target_file_get) (mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify 'command' parameter. * mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete) (mi_cmd_var_set_format, mi_cmd_var_set_visualizer) (mi_cmd_var_set_frozen, mi_cmd_var_show_format) (mi_cmd_var_info_num_children, mi_cmd_var_list_children) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_show_attributes) (mi_cmd_var_evaluate_expression, mi_cmd_var_assign) (mi_cmd_var_update, mi_cmd_enable_pretty_printing) (mi_cmd_var_set_update_range): Constify 'command' parameter. * mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter. * mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command' parameter. * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next) (mi_cmd_exec_next_instruction, mi_cmd_exec_step) (mi_cmd_exec_step_instruction, mi_cmd_exec_finish) (mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue) (mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach) (mi_cmd_target_flash_erase, mi_cmd_thread_select) (mi_cmd_thread_list_ids, mi_cmd_thread_info) (mi_cmd_list_thread_groups, mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers) (mi_cmd_data_write_register_values) (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory) (mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings) (mi_cmd_list_features, mi_cmd_list_target_features) (mi_cmd_add_inferior, mi_cmd_remove_inferior) (mi_cmd_trace_define_variable, mi_cmd_trace_list_variables) (mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start) (mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info) (mi_cmd_trace_frame_collected): Constify 'command' parameter. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify 'command' parameter.
2017-04-05 20:21:34 +02:00
mi_cmd_target_file_delete (const char *command, char **argv, int argc)
* 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
{
int oind = 0;
char *oarg;
const char *remote_file;
static const struct mi_opt opts[] =
{
{ 0, 0, 0 }
};
static const char prefix[] = "-target-file-delete";
* 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
if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
|| oind != argc - 1)
gdb * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Fix error messages. * mi/mi-main.c (mi_cmd_thread_select): Fix error messages. (mi_cmd_thread_list_ids): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_list_register_values): Likewise. (mi_cmd_data_write_register_values): Likewise. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory): Likewise. (mi_cmd_enable_timings): Likewise. * mi/mi-interp.c (mi_cmd_interpreter_exec): Fix error messages. * mi/mi-cmd-var.c (mi_cmd_var_create): Fix error messages. (mi_cmd_var_delete): Likewise. (mi_cmd_var_set_format): Likewise. (mi_cmd_var_show_format): Likewise. (mi_cmd_var_info_num_children): Likewise. (mi_cmd_var_list_children): Likewise. (mi_cmd_var_info_type): Likewise. (mi_cmd_var_info_expression): Likewise. (mi_cmd_var_show_attributes): Likewise. (mi_cmd_var_assign): Likewise. (mi_cmd_var_update): Likewise. (mi_cmd_enable_pretty_printing): Likewise. (mi_cmd_var_set_update_range): Likewise. * mi/mi-cmd-target.c (mi_cmd_target_file_get): Fix error messages. (mi_cmd_target_file_put): Likewise. (mi_cmd_target_file_delete): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Fix error messages. (mi_cmd_stack_info_depth): Likewise. (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_args): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_select_frame): Likewise. (mi_cmd_stack_info_frame): Likewise. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Fix error messages. (mi_cmd_file_list_exec_source_files): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_pwd): Fix error messages. (mi_cmd_env_cd): Likewise. (mi_cmd_env_path): Likewise. (mi_cmd_env_dir): Likewise. (mi_cmd_inferior_tty_show): Likewise. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Fix error messages. * mi/mi-cmd-break.c (mi_cmd_break_insert): Fix error messages. (mi_cmd_break_watch): Likewise. gdb/testsuite * gdb.mi/gdb2549.exp: Update for error message changes. * gdb.mi/mi-cli.exp: Likewise. * gdb.mi/mi-disassemble.exp: Likewise. * gdb.mi/mi-pthreads.exp: Likewise. * gdb.mi/mi-regs.exp: Likewise. * gdb.mi/mi-stack.exp: Likewise. * gdb.mi/mi-var-block.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-disassemble.exp: Likewise. * gdb.mi/mi2-pthreads.exp: Likewise. * gdb.mi/mi2-regs.exp: Likewise. * gdb.mi/mi2-stack.exp: Likewise. * gdb.mi/mi2-var-block.exp: Likewise. * gdb.mi/mi2-var-cmd.exp: Likewise.
2011-01-12 22:09:39 +01:00
error (_("-target-file-delete: Usage: REMOTE_FILE"));
* 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
remote_file = argv[oind];
* 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
remote_file_delete (remote_file, 0);
}