Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 40/67] Constify some commands in tracepoint.c
Date: Thu, 21 Sep 2017 05:42:00 -0000	[thread overview]
Message-ID: <20170921051023.19023-41-tom@tromey.com> (raw)
In-Reply-To: <20170921051023.19023-1-tom@tromey.com>

ChangeLog
2017-09-20  Tom Tromey  <tom@tromey.com>

	* tracepoint.c (delete_trace_variable_command)
	(tfind_end_command, tfind_start_command, tfind_pc_command)
	(tfind_tracepoint_command, tfind_line_command)
	(tfind_range_command, tfind_outside_command): Constify.
---
 gdb/ChangeLog    |  7 +++++++
 gdb/tracepoint.c | 42 ++++++++++++++++--------------------------
 2 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 52a449a..30e3a3a 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -165,18 +165,6 @@ char *trace_notes = NULL;
 
 char *trace_stop_notes = NULL;
 
-/* ======= Important command functions: ======= */
-static void actions_command (char *, int);
-static void tstart_command (char *, int);
-static void tstop_command (char *, int);
-static void tstatus_command (char *, int);
-static void tfind_pc_command (char *, int);
-static void tfind_tracepoint_command (char *, int);
-static void tfind_line_command (char *, int);
-static void tfind_range_command (char *, int);
-static void tfind_outside_command (char *, int);
-static void tdump_command (char *, int);
-
 /* support routines */
 
 struct collection_list;
@@ -442,7 +430,7 @@ trace_variable_command (char *args, int from_tty)
 }
 
 static void
-delete_trace_variable_command (char *args, int from_tty)
+delete_trace_variable_command (const char *args, int from_tty)
 {
   if (args == NULL)
     {
@@ -2362,21 +2350,21 @@ tfind_command (char *args, int from_tty)
 
 /* tfind end */
 static void
-tfind_end_command (char *args, int from_tty)
+tfind_end_command (const char *args, int from_tty)
 {
   tfind_command_1 ("-1", from_tty);
 }
 
 /* tfind start */
 static void
-tfind_start_command (char *args, int from_tty)
+tfind_start_command (const char *args, int from_tty)
 {
   tfind_command_1 ("0", from_tty);
 }
 
 /* tfind pc command */
 static void
-tfind_pc_command (char *args, int from_tty)
+tfind_pc_command (const char *args, int from_tty)
 {
   CORE_ADDR pc;
 
@@ -2392,7 +2380,7 @@ tfind_pc_command (char *args, int from_tty)
 
 /* tfind tracepoint command */
 static void
-tfind_tracepoint_command (char *args, int from_tty)
+tfind_tracepoint_command (const char *args, int from_tty)
 {
   int tdp;
   struct tracepoint *tp;
@@ -2428,7 +2416,7 @@ tfind_tracepoint_command (char *args, int from_tty)
    corresponding to a source line OTHER THAN THE CURRENT ONE.  */
 
 static void
-tfind_line_command (char *args, int from_tty)
+tfind_line_command (const char *args, int from_tty)
 {
   check_trace_running (current_trace_status ());
 
@@ -2486,10 +2474,10 @@ tfind_line_command (char *args, int from_tty)
 
 /* tfind range command */
 static void
-tfind_range_command (char *args, int from_tty)
+tfind_range_command (const char *args, int from_tty)
 {
   static CORE_ADDR start, stop;
-  char *tmp;
+  const char *tmp;
 
   check_trace_running (current_trace_status ());
 
@@ -2501,9 +2489,10 @@ tfind_range_command (char *args, int from_tty)
 
   if (0 != (tmp = strchr (args, ',')))
     {
-      *tmp++ = '\0';	/* Terminate start address.  */
+      std::string start_addr (args, tmp);
+      ++tmp;
       tmp = skip_spaces (tmp);
-      start = parse_and_eval_address (args);
+      start = parse_and_eval_address (start_addr.c_str ());
       stop = parse_and_eval_address (tmp);
     }
   else
@@ -2517,10 +2506,10 @@ tfind_range_command (char *args, int from_tty)
 
 /* tfind outside command */
 static void
-tfind_outside_command (char *args, int from_tty)
+tfind_outside_command (const char *args, int from_tty)
 {
   CORE_ADDR start, stop;
-  char *tmp;
+  const char *tmp;
 
   if (current_trace_status ()->running
       && current_trace_status ()->filename == NULL)
@@ -2534,9 +2523,10 @@ tfind_outside_command (char *args, int from_tty)
 
   if (0 != (tmp = strchr (args, ',')))
     {
-      *tmp++ = '\0';	/* Terminate start address.  */
+      std::string start_addr (args, tmp);
+      ++tmp;
       tmp = skip_spaces (tmp);
-      start = parse_and_eval_address (args);
+      start = parse_and_eval_address (start_addr.c_str ());
       stop = parse_and_eval_address (tmp);
     }
   else
-- 
2.9.4


  parent reply	other threads:[~2017-09-21  5:42 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21  5:16 [RFA 00/67] Simple add_cmd constification Tom Tromey
2017-09-21  5:11 ` [RFA 05/67] Constify two functions in valprint.c Tom Tromey
2017-09-21  5:13 ` [RFA 07/67] Constify two functions in cp-abi.c Tom Tromey
2017-09-21  5:13 ` [RFA 03/67] Constify not_just_help_class_command Tom Tromey
2017-09-21  5:13 ` [RFA 16/67] Constify some functions in memattr.c Tom Tromey
2017-09-21  5:13 ` [RFA 12/67] Constify maintenance_cplus_namespace Tom Tromey
2017-09-21  5:13 ` [RFA 09/67] Constify display_tib Tom Tromey
2017-09-21  5:13 ` [RFA 14/67] Constify core_file_command Tom Tromey
2017-09-21  5:13 ` [RFA 10/67] Constify some functions in psymtab.c Tom Tromey
2017-09-21  5:13 ` [RFA 04/67] Constify info_probes_dtrace_command Tom Tromey
2017-09-21 12:48   ` Sergio Durigan Junior
2017-09-21  5:13 ` [RFA 28/67] Constify some commands in record-btrace.c Tom Tromey
2017-09-21  7:02   ` Metzger, Markus T
2017-09-21  5:13 ` [RFA 25/67] Constify some commands in symfile.c Tom Tromey
2017-09-21  5:13 ` [RFA 18/67] Constify interpreter_exec_cmd Tom Tromey
2017-09-21  5:15 ` [RFA 20/67] Constify some commands in cli-cmds.c Tom Tromey
2017-09-21  5:15 ` [RFA 21/67] Constify commands in cli-dump.c Tom Tromey
2017-09-21  5:15 ` [RFA 15/67] Constify show_convenience Tom Tromey
2017-09-21  5:16 ` [RFA 02/67] Constify add_cmd gdb_bfd.c Tom Tromey
2017-09-21  5:16 ` [RFA 22/67] Constify user_defined_command Tom Tromey
2017-09-21  5:16 ` [RFA 26/67] Constify new_ui_command Tom Tromey
2017-09-21  5:16 ` [RFA 11/67] Constify first_component_command Tom Tromey
2017-09-21  5:16 ` [RFA 01/67] Add add_cmd function overloads Tom Tromey
2017-09-21  7:02   ` Metzger, Markus T
2017-09-21 10:25     ` Pedro Alves
2017-09-23  4:14       ` Tom Tromey
2017-09-23  4:14     ` Tom Tromey
2017-09-26 12:11       ` Pedro Alves
2017-09-27 14:44         ` Tom Tromey
2017-09-21 10:25   ` Pedro Alves
2017-09-23  4:18     ` Tom Tromey
2017-09-23  4:30     ` Tom Tromey
2017-09-23  4:49       ` Tom Tromey
2017-09-26 12:12         ` Pedro Alves
2017-09-27 14:42           ` Tom Tromey
2017-09-21  5:17 ` [RFA 27/67] Constify some commands in symmisc.c Tom Tromey
2017-09-21  5:17 ` [RFA 29/67] Constify some commands in skip.c Tom Tromey
2017-09-21  5:17 ` [RFA 08/67] Constify two functions in linux-fork.c Tom Tromey
2017-09-21  5:17 ` [RFA 06/67] Constify dump_arc_instruction_command Tom Tromey
2017-09-21  5:17 ` [RFA 13/67] Constify maintenance_print_user_registers Tom Tromey
2017-09-21  5:17 ` [RFA 17/67] Constify cmd_record_full_restore Tom Tromey
2017-09-21  7:02   ` Metzger, Markus T
2017-09-21  5:17 ` [RFA 23/67] Constify some commands in cli-logging.c Tom Tromey
2017-09-21  5:31 ` [RFA 24/67] Constify some commands in spu-tdep.c Tom Tromey
2017-09-21  5:31 ` [RFA 19/67] Constify maintenance_print_target_stack Tom Tromey
2017-09-21  5:39 ` [RFA 51/67] Constify info_probes_stap_command Tom Tromey
2017-09-21 12:48   ` Sergio Durigan Junior
2017-09-21  5:39 ` [RFA 33/67] Constify some commands in target-descriptions.c Tom Tromey
2017-09-21  5:39 ` [RFA 50/67] Constify unset_exec_wrapper_command Tom Tromey
2017-09-21  5:39 ` [RFA 32/67] Constify maintenance_print_dummy_frames Tom Tromey
2017-09-21  5:39 ` [RFA 31/67] Constify some commands in tui.c Tom Tromey
2017-09-21  5:39 ` [RFA 52/67] Constify save_gdb_index_command Tom Tromey
2017-09-21  5:39 ` [RFA 49/67] Constify some commands in btrace.c Tom Tromey
2017-09-21  7:02   ` Metzger, Markus T
2017-09-21 11:11     ` Pedro Alves
2017-09-21 13:06       ` Metzger, Markus T
2017-09-21 13:47         ` Pedro Alves
2017-09-21 16:53           ` Metzger, Markus T
2017-09-23  4:28           ` Tom Tromey
2017-09-26  8:15             ` Metzger, Markus T
2017-09-21  5:39 ` [RFA 48/67] Constify delete_bookmark_command Tom Tromey
2017-09-21  5:40 ` [RFA 65/67] Constify some commands in symtab.c Tom Tromey
2017-09-21  5:40 ` [RFA 34/67] Constify unwind_command Tom Tromey
2017-09-21  5:40 ` [RFA 66/67] Constify some commands in ada-tasks.c Tom Tromey
2017-09-21  5:40 ` [RFA 44/67] Constify some commands in thread.c Tom Tromey
2017-09-21  5:40 ` [RFA 63/67] Constify some commands in regcache.c Tom Tromey
2017-09-21  5:40 ` [RFA 47/67] Constify some commands in remote.c Tom Tromey
2017-09-21  5:40 ` [RFA 37/67] Constify some commands in record.c Tom Tromey
2017-09-21  7:02   ` Metzger, Markus T
2017-09-23  4:05     ` Tom Tromey
2017-09-21 10:00   ` Pedro Alves
2017-09-23  4:05     ` Tom Tromey
2017-09-23  4:29     ` Tom Tromey
2017-09-21  5:40 ` [RFA 38/67] Constify some linespec functions Tom Tromey
2017-09-21 10:04   ` Pedro Alves
2017-09-23  4:03     ` Tom Tromey
2017-09-26 12:17       ` Pedro Alves
2017-09-21  5:40 ` [RFA 54/67] Constify some commands in compile.c Tom Tromey
2017-09-21  5:40 ` [RFA 46/67] Constify some commands in mips-tdep.c Tom Tromey
2017-09-21  5:40 ` [RFA 35/67] Constify commands maint.c, plus maintenance_print_type Tom Tromey
2017-09-21 10:06   ` Pedro Alves
2017-09-23  4:32     ` Tom Tromey
2017-09-21  5:40 ` [RFA 55/67] Constify maintenance_info_program_spaces_command Tom Tromey
2017-09-21  5:40 ` [RFA 45/67] Constify cd_command Tom Tromey
2017-09-21 12:48   ` Sergio Durigan Junior
2017-09-21  5:40 ` [RFA 36/67] Constify some commands in source.c Tom Tromey
2017-09-21  5:40 ` [RFA 56/67] Constify demangle_command Tom Tromey
2017-09-21  5:40 ` [RFA 64/67] Constify some commands in inferior.c Tom Tromey
2017-09-21  5:40 ` [RFA 67/67] Constify find_command Tom Tromey
2017-09-21  5:40 ` [RFA 62/67] Constify some commands in printcmd.c Tom Tromey
2017-09-21  5:40 ` [RFA 53/67] Constify maintenance_print_reggroups Tom Tromey
2017-09-21  5:41 ` [RFA 60/67] Constify some commands in macrocmd.c Tom Tromey
2017-09-21  5:41 ` [RFA 58/67] Constify some commands in i386-tdep.c Tom Tromey
2017-09-21  5:41 ` [RFA 41/67] Constify some commands in remote-fileio.c Tom Tromey
2017-09-21  5:41 ` [RFA 39/67] Constify some commands in ax-gdb.c Tom Tromey
2017-09-21  5:41 ` [RFA 43/67] Constify some commands in probes.c Tom Tromey
2017-09-21 12:47   ` Sergio Durigan Junior
2017-09-21  5:41 ` [RFA 59/67] Constify some commands in infcmd.c Tom Tromey
2017-09-21  9:56   ` Pedro Alves
2017-09-21  5:42 ` [RFA 30/67] Constify tui_reg_command Tom Tromey
2017-09-21  5:42 ` [RFA 42/67] Constify some commands in exec.c, plus symbol_file_command Tom Tromey
2017-09-21  5:42 ` Tom Tromey [this message]
2017-09-21 10:03   ` [RFA 40/67] Constify some commands in tracepoint.c Pedro Alves
2017-09-23  4:34     ` Tom Tromey
2017-09-21  5:42 ` [RFA 57/67] Constify add_symbol_file_from_memory_command Tom Tromey
2017-09-21  5:42 ` [RFA 61/67] Constify some commands in breakpoint.c Tom Tromey
2017-09-21  9:56   ` Pedro Alves
2017-09-21 13:20     ` Patrick Monnerat
2017-09-21 10:26 ` [RFA 00/67] Simple add_cmd constification Pedro Alves
2017-09-26 12:19   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170921051023.19023-41-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox