Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Andrew STUBBS <andrew.stubbs@st.com>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] command trace / source verbose mode
Date: Thu, 06 Jul 2006 13:16:00 -0000	[thread overview]
Message-ID: <20060706131559.GA18827@nevyn.them.org> (raw)
In-Reply-To: <437C9C07.4020707@st.com>

Hi Andrew,

Sorry for not getting back to you on this.  Never made it back here
when reviewing patches in reverse.  Trying in patch tracker order
today.

On Thu, Nov 17, 2005 at 03:04:39PM +0000, Andrew STUBBS wrote:
> +/* Command tracing state.  */
> +
> +int source_verbose = 0;
> +int commandtrace = 0;

You've got two of these, but you always check them together.  One
variable and incrementing/decrementing the trace level around source
would work too, right?

> +  char *minusv=NULL;

Spaces around operators please.

> +  int old_source_verbose = source_verbose;

You do this in a couple places, at least here and for control_level.
Given the way GDB handles errors with longjmp, this isn't safe.  I
recommend you use cleanups instead.  Either one to decrement
commandtrace (trace_commands?) and one to decrement control_level,
or write a general function in utils.c to make a cleanup which
decrements an integer.

> +  /* Is there a '-v' in the string somewhere?  */
> +  if (args && (minusv = strstr(args,"-v")))

Is there any benefit to supporting this at the end?  We've already got
some other commands that are strictly command [options] [args], I
think, or at least we do in MI; I would recommend following the same
model here.  If it starts with -v it's an option.

> +  add_setshow_boolean_cmd ("commandtrace", no_class, &commandtrace, _("\

I don't feel too strongly about this, just personal bias, but how about
something other than run-together words for this?  We have a lot of
those in the existing code e.g. remotetimeout, but we've been trying to
either use hyphens or use spaces and sub-menus lately, I think. 
Something like "set trace-commands".  Or, alternatively "set debug
cli-commands".

>      case continue_control:
> +      if (source_verbose || commandtrace)
> +	printf_unfiltered ("Command issued: loop_continue %s\n", cmd->line);

If we do this, we should also use _() so that "Command issued" can be
translated.  Another alternative would be to use the time-honored shell
syntax for this: prefix with plusses up to the nesting level, like sh
-x.  What do you think?

:REVIEWMAIL:

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-07-06 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16 18:01 Andrew STUBBS
2005-11-16 20:11 ` Eli Zaretskii
2005-11-17 16:21   ` Andrew STUBBS
2006-07-06 13:16     ` Daniel Jacobowitz [this message]
2006-07-06 17:23       ` Andrew STUBBS
2006-07-06 17:33         ` Daniel Jacobowitz
2006-07-07 16:18           ` Andrew STUBBS
2006-07-08 12:02             ` Eli Zaretskii
2006-07-20 16:46               ` Andrew STUBBS
2006-07-20 19:24                 ` Eli Zaretskii
2006-07-21 14:48                   ` Andrew STUBBS
2006-07-21 14:49                     ` Daniel Jacobowitz
2006-07-20 19:38                 ` Daniel Jacobowitz

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=20060706131559.GA18827@nevyn.them.org \
    --to=drow@false.org \
    --cc=andrew.stubbs@st.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /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