From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12687 invoked by alias); 27 Nov 2007 06:28:09 -0000 Received: (qmail 12676 invoked by uid 22791); 27 Nov 2007 06:28:08 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 Nov 2007 06:28:00 +0000 Received: from kahikatea.snap.net.nz (183.63.255.123.dynamic.snap.net.nz [123.255.63.183]) by viper.snap.net.nz (Postfix) with ESMTP id DE0DE3DA278; Tue, 27 Nov 2007 19:27:52 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 1E1A88FC6D; Tue, 27 Nov 2007 19:27:38 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18251.47321.156923.358334@kahikatea.snap.net.nz> Date: Tue, 27 Nov 2007 06:28:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [ob] unbreak MI In-Reply-To: References: <200708312244.58216.ghost@cs.msu.su> <18251.35325.929245.184830@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 23.0.50.3 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: 2007-11/txt/msg00504.txt.bz2 > > Generally, with a NULL pointer, or and address that can't be dereferenced, > > MI prints out the value field as value="". > > > > What is the problem in this case? Why isn't the right fix to add a > > check_typedef somewhere? > > check_typedef? The original problem was that check_typedef was getting > called on NULL pointer, so adding more check_typedef calls won't help. > Probably: > > if (!gdb_type) > ui_out_field_string (uiout, "value", ""); > else if (mi_print_value_p (gdb_type, print_values)) > ui_out_field_string (uiout, "value", varobj_get_value (var)); > > is the right logic? It's probably the right logic, but it seems to cure the symptom rather than the cause. What I mean't, I guess, was where/how does check_typedef is get passed a NULL pointer? And can't that call be conditioned (i.e. "add a *check* to check_typedef") , e.g., something like: if (!gdb_type) check_typedef (gdb_type) -- Nick http://www.inet.net.nz/~nickrob