This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Constify add_abbrev_prefix_cmd


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ee7ddd713206fdf02512a9fb3fe928a210200c11

commit ee7ddd713206fdf02512a9fb3fe928a210200c11
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Oct 10 17:51:52 2017 -0600

    Constify add_abbrev_prefix_cmd
    
    This changes add_abbrev_prefix_cmd to take a const-taking callback
    function and then fixes the one caller.
    
    gdb/ChangeLog
    2017-11-07  Tom Tromey  <tom@tromey.com>
    
    	* breakpoint.c (stop_command): Constify.
    	* cli/cli-decode.c (struct cmd_list_element): Constify.
    	* command.h (add_abbrev_prefix_cmd): Constify.

Diff:
---
 gdb/ChangeLog        | 6 ++++++
 gdb/breakpoint.c     | 4 +---
 gdb/cli/cli-decode.c | 2 +-
 gdb/command.h        | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e1842d6..6f103ae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-07  Tom Tromey  <tom@tromey.com>
+
+	* breakpoint.c (stop_command): Constify.
+	* cli/cli-decode.c (struct cmd_list_element): Constify.
+	* command.h (add_abbrev_prefix_cmd): Constify.
+
 2017-11-07  Pedro Alves  <palves@redhat.com>
 
 	* breakpoint.c (extract_bp_kind): New enum.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9106f09..97f704a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -193,8 +193,6 @@ static void thbreak_command (char *, int);
 static void enable_breakpoint_disp (struct breakpoint *, enum bpdisp,
 				    int count);
 
-static void stop_command (char *arg, int from_tty);
-
 static void free_bp_location (struct bp_location *loc);
 static void incref_bp_location (struct bp_location *loc);
 static void decref_bp_location (struct bp_location **loc);
@@ -9658,7 +9656,7 @@ thbreak_command (char *arg, int from_tty)
 }
 
 static void
-stop_command (char *arg, int from_tty)
+stop_command (const char *arg, int from_tty)
 {
   printf_filtered (_("Specify the type of breakpoint to set.\n\
 Usage: stop in <function | address>\n\
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 87ebed5..5fc3187 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -424,7 +424,7 @@ add_prefix_cmd (const char *name, enum command_class theclass,
 
 struct cmd_list_element *
 add_abbrev_prefix_cmd (const char *name, enum command_class theclass,
-		       cmd_cfunc_ftype *fun, const char *doc,
+		       cmd_const_cfunc_ftype *fun, const char *doc,
 		       struct cmd_list_element **prefixlist,
 		       const char *prefixname,
 		       int allow_unknown, struct cmd_list_element **list)
diff --git a/gdb/command.h b/gdb/command.h
index 32ee73a..71ad71d 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -173,7 +173,7 @@ extern struct cmd_list_element *add_prefix_cmd (const char *, enum command_class
 
 extern struct cmd_list_element *add_abbrev_prefix_cmd (const char *,
 						       enum command_class,
-						       cmd_cfunc_ftype *fun,
+						       cmd_const_cfunc_ftype *fun,
 						       const char *,
 						       struct cmd_list_element
 						       **, const char *, int,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]