This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Rename some trace functions
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Thu, 1 Dec 2016 14:21:43 +0000
- Subject: Re: [PATCH 1/3] Rename some trace functions
- Authentication-results: sourceware.org; auth=none
- References: <20161013210728.18756-1-simon.marchi@ericsson.com>
Loos like this one never made it in.
On 10/13/2016 10:07 PM, Simon Marchi wrote:
> This patch renames a few trace-related functions, so that they adhere to
> the de facto standard of naming command entry point functions
> <command>_command. I like the ease of looking up a command entry point
> if they all follow that rule.
Me too.
>
> An enum label "tstop_command" conflicts with a new function name, so I
> renamed this one trace_stop_command.
> Save the trace data to a file.\n\
> Use the '-ctf' option to save the data to CTF format.\n\
> Use the '-r' option to direct the target to save directly to the file,\n\
> diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
> index e5c353c..27c8b20 100644
> --- a/gdb/tracepoint.c
> +++ b/gdb/tracepoint.c
> @@ -166,10 +166,10 @@ char *trace_notes = NULL;
> char *trace_stop_notes = NULL;
>
> /* ======= Important command functions: ======= */
> -static void trace_actions_command (char *, int);
> -static void trace_start_command (char *, int);
> -static void trace_stop_command (char *, int);
> -static void trace_status_command (char *, int);
> +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 trace_find_command (char *, int);
> static void trace_find_pc_command (char *, int);
> static void trace_find_tracepoint_command (char *, int);
Surprised you didn't do the same to "trace_find" -> "tfind" ?
> @@ -648,7 +648,7 @@ decode_agent_options (const char *exp, int *trace_string)
> --- a/gdb/tracepoint.h
> +++ b/gdb/tracepoint.h
> @@ -74,7 +74,7 @@ enum trace_stop_reason
> {
> trace_stop_reason_unknown,
> trace_never_run,
> - tstop_command,
> + trace_stop_command,
> trace_buffer_full,
> trace_disconnected,
> tracepoint_passcount,
Meanwhile we have C++11, so we could consider making this
an "enum class" instead. Then we could keep using
tstop_command here.
But LGTM as is, too.
Thanks,
Pedro Alves