From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31549 invoked by alias); 13 Aug 2009 05:43:05 -0000 Received: (qmail 31519 invoked by uid 22791); 13 Aug 2009 05:43:03 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Aug 2009 05:42:55 +0000 Received: (qmail 2935 invoked from network); 13 Aug 2009 05:42:53 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Aug 2009 05:42:53 -0000 From: Vladimir Prus To: Jan Kratochvil Subject: Re: [patch] MI: Error out on -var-create invalid FRAME-ADDR Date: Thu, 13 Aug 2009 15:03:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) Cc: gdb-patches@sources.redhat.com References: <20090810162949.GA9704@host0.dyn.jankratochvil.net> <20090810170045.GA15882@host0.dyn.jankratochvil.net> In-Reply-To: <20090810170045.GA15882@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200908130942.55574.vladimir@codesourcery.com> 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: 2009-08/txt/msg00177.txt.bz2 On Monday 10 August 2009 Jan Kratochvil wrote: > On Mon, 10 Aug 2009 18:54:52 +0200, Vladimir Prus wrote: > > Jan Kratochvil wrote: > > > > > - if (innermost_block && fi != NULL) > > > + if (innermost_block) > > > { > > > + /* User could specify explicit FRAME-ADDR which was not found but > > > + EXPRESSION is frame specific and we would not be able to evaluate > > > + it correctly next time. With VALID_BLOCK set we must also set > > > + FRAME and THREAD_ID. */ > > > + if (fi == NULL) > > > + { > > > + fprintf_unfiltered (gdb_stderr, "Failed to find the specified" > > > + " frame.\n"); > > > + return NULL; > > > + } > > > > Why is this fprintf + NULL return, as opposed to error? > > I had there error before but changed it to match the code several lines above: > > /* Don't allow variables to be created for types. */ > if (var->root->exp->elts[0].opcode == OP_TYPE) > { > do_cleanups (old_chain); > fprintf_unfiltered (gdb_stderr, "Attempt to use a type name" > " as an expression.\n"); > return NULL; > } > + > mi_gdb_test "-var-create int * int" \ > "&\"Attempt to use a type name as an expression.\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ > "create int" > > Expecting this former case cannot be changed due to MI2 compatibility but I am > free to change the new error "Failed to find the specified frame." to use > error(). Check it in with or without error()? I'd prefer error for all new code. Thanks! - Volodya