From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14803 invoked by alias); 15 Mar 2010 18:00:47 -0000 Received: (qmail 14788 invoked by uid 22791); 15 Mar 2010 18:00:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Mar 2010 18:00:41 +0000 Received: (qmail 19228 invoked from network); 15 Mar 2010 18:00:40 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 Mar 2010 18:00:40 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [MI tracepoints 6/9] trace variable commands Date: Mon, 15 Mar 2010 18:00:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: Vladimir Prus References: <201003141158.36113.vladimir@codesourcery.com> In-Reply-To: <201003141158.36113.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003151800.38101.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00551.txt.bz2 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