From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11393 invoked by alias); 10 Aug 2009 17:00:59 -0000 Received: (qmail 11382 invoked by uid 22791); 10 Aug 2009 17:00:58 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Aug 2009 17:00:51 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7AH0mg8020479 for ; Mon, 10 Aug 2009 13:00:48 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7AH0mO2014312 for ; Mon, 10 Aug 2009 13:00:48 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7AH0lWE007993; Mon, 10 Aug 2009 13:00:47 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n7AH0k7m016623; Mon, 10 Aug 2009 19:00:46 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n7AH0jeU016620; Mon, 10 Aug 2009 19:00:45 +0200 Date: Mon, 10 Aug 2009 17:47:00 -0000 From: Jan Kratochvil To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] MI: Error out on -var-create invalid FRAME-ADDR Message-ID: <20090810170045.GA15882@host0.dyn.jankratochvil.net> References: <20090810162949.GA9704@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) 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: 2009-08/txt/msg00144.txt.bz2 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()? Thanks, Jan