arm, objdump: print obsolote warning when 26-bit set in instructions
[binutils-gdb.git] / gdb / mi / mi-cmd-target.c
blobfbc6d6c07c8f6c2cb6f5ba9d089f2c137865c604
1 /* MI Command Set - target commands.
2 Copyright (C) 2007-2024 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 #include "mi-cmds.h"
20 #include "mi-getopt.h"
21 #include "remote.h"
23 /* Get a file from the target. */
25 void
26 mi_cmd_target_file_get (const char *command, const char *const *argv, int argc)
28 int oind = 0;
29 const char *oarg;
30 const char *remote_file, *local_file;
31 static const struct mi_opt opts[] =
33 { 0, 0, 0 }
35 static const char prefix[] = "-target-file-get";
37 if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
38 || oind != argc - 2)
39 error (_("-target-file-get: Usage: REMOTE_FILE LOCAL_FILE"));
41 remote_file = argv[oind];
42 local_file = argv[oind + 1];
44 remote_file_get (remote_file, local_file, 0);
47 /* Send a file to the target. */
49 void
50 mi_cmd_target_file_put (const char *command, const char *const *argv, int argc)
52 int oind = 0;
53 const char *oarg;
54 const char *remote_file, *local_file;
55 static const struct mi_opt opts[] =
57 { 0, 0, 0 }
59 static const char prefix[] = "-target-file-put";
61 if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
62 || oind != argc - 2)
63 error (_("-target-file-put: Usage: LOCAL_FILE REMOTE_FILE"));
65 local_file = argv[oind];
66 remote_file = argv[oind + 1];
68 remote_file_put (local_file, remote_file, 0);
71 /* Delete a file on the target. */
73 void
74 mi_cmd_target_file_delete (const char *command, const char *const *argv,
75 int argc)
77 int oind = 0;
78 const char *oarg;
79 const char *remote_file;
80 static const struct mi_opt opts[] =
82 { 0, 0, 0 }
84 static const char prefix[] = "-target-file-delete";
86 if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
87 || oind != argc - 1)
88 error (_("-target-file-delete: Usage: REMOTE_FILE"));
90 remote_file = argv[oind];
92 remote_file_delete (remote_file, 0);