Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: [MI tracepoints 6/9] trace variable commands
Date: Mon, 15 Mar 2010 18:00:00 -0000	[thread overview]
Message-ID: <201003151800.38101.pedro@codesourcery.com> (raw)
In-Reply-To: <201003141158.36113.vladimir@codesourcery.com>

On Sunday 14 March 2010 08:58:36, Vladimir Prus wrote:
> +  name = argv[0];
> +  if (name[0] != '$')
> +    error (_("Name of trace variable should start with '$'"));
> +  ++name;
> +
> +  expr = parse_expression (argv[0]);
> +  back_to = make_cleanup (xfree, expr);
> +
> +  if (expr->nelts == 3 && expr->elts[0].opcode == OP_INTERNALVAR)
> +    {
> +      struct internalvar *intvar = expr->elts[1].internalvar;
> +      if (intvar)
> +       name = internalvar_name (intvar);
> +    }
> +
> +  if (!name || *name == '\0')
> +    error (_("Invalid name of trace variable"));

Waitaminute.  Is there a merge error here?

Repeating the snippet:

> +  name = argv[0];
> +  if (name[0] != '$')
> +    error (_("Name of trace variable should start with '$'"));
> +  ++name;
> +

I think this whole bit above shouldn't be here.

> +  expr = parse_expression (argv[0]);
> +  back_to = make_cleanup (xfree, expr);
> +
> +  if (expr->nelts == 3 && expr->elts[0].opcode == OP_INTERNALVAR)
> +    {
> +      struct internalvar *intvar = expr->elts[1].internalvar;
> +      if (intvar)
> +       name = internalvar_name (intvar);  <<<<<<<< (1)
> +    }
> +
> +  if (!name || *name == '\0')
> +    error (_("Invalid name of trace variable"));

Otherwise, it looks like you can get here with an invalid name, if
the expression did parse sucessfully, but (1) wasn't reached at all.

-- 
Pedro Alves


  parent reply	other threads:[~2010-03-15 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14  8:58 Vladimir Prus
2010-03-15 17:52 ` Stan Shebs
2010-03-15 18:00 ` Pedro Alves [this message]
2010-03-16 13:17   ` Vladimir Prus
2010-03-16 13:50     ` 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=201003151800.38101.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vladimir@codesourcery.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