aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-file.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-05-10 16:09:35 -0600
committerTom Tromey <tom@tromey.com>2023-05-25 19:00:02 -0600
commit9158e49a70386c3e883ad429d93fe31aa59c0918 (patch)
treee020360e60c608bfabdd498bb0e60ae7811a199a /gdb/mi/mi-cmd-file.c
parentfb7cd8ccfedbfe349c84ce0393da39b8b7ee9b94 (diff)
downloadgdb-9158e49a70386c3e883ad429d93fe31aa59c0918.zip
gdb-9158e49a70386c3e883ad429d93fe31aa59c0918.tar.gz
gdb-9158e49a70386c3e883ad429d93fe31aa59c0918.tar.bz2
Make MI commands const-correct
I've had this patch for a while now and figured I'd update it and send it. It changes MI commands to use a "const char * const" for their argv parameter. Regression tested on x86-64 Fedora 36. Acked-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/mi/mi-cmd-file.c')
-rw-r--r--gdb/mi/mi-cmd-file.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c
index 70c0a78..0883cb6 100644
--- a/gdb/mi/mi-cmd-file.c
+++ b/gdb/mi/mi-cmd-file.c
@@ -34,7 +34,8 @@
current file being executed. */
void
-mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_file (const char *command,
+ const char *const *argv, int argc)
{
struct symtab_and_line st;
struct ui_out *uiout = current_uiout;
@@ -65,7 +66,8 @@ mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
/* Implement -file-list-exec-source-files command. */
void
-mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_files (const char *command,
+ const char *const *argv, int argc)
{
enum opt
{
@@ -83,7 +85,7 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
/* Parse arguments. */
int oind = 0;
- char *oarg;
+ const char *oarg;
bool group_by_objfile = false;
bool match_on_basename = false;
@@ -131,7 +133,8 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
/* See mi-cmds.h. */
void
-mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
+mi_cmd_file_list_shared_libraries (const char *command,
+ const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
const char *pattern;