From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8254 invoked by alias); 27 Nov 2007 06:17:22 -0000 Received: (qmail 8245 invoked by uid 22791); 27 Nov 2007 06:17:21 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 Nov 2007 06:16:57 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Iwthx-0000EQ-3y for gdb-patches@sources.redhat.com; Tue, 27 Nov 2007 06:14:39 +0000 Received: from 77.246.241.246 ([77.246.241.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Nov 2007 06:14:09 +0000 Received: from ghost by 77.246.241.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Nov 2007 06:14:09 +0000 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: [ob] unbreak MI Date: Tue, 27 Nov 2007 06:17:00 -0000 Message-ID: References: <200708312244.58216.ghost@cs.msu.su> <18251.35325.929245.184830@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.4 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/msg00503.txt.bz2 Nick Roberts wrote: > > It appears that some of recent cleanups broke MI, because > > check_typedef is getting passed a NULL pointer -- this > > suggest someone did not run a testsuite prior to commit ;-). > > > > It does not matter which particular patch broke it, because > > it's trivially fixable by the attached patch, checked in > > as obvious. > > This fix (now in GDB 6.7) breaks watch expressions of C++ objects on Emacs > because the MI command "-var-list-children --all-values" no longer always > includes the value field: > > - if (mi_print_value_p (varobj_get_gdb_type (var), print_values)) > + gdb_type = varobj_get_gdb_type (var); > + if (gdb_type && mi_print_value_p (gdb_type, print_values)) > ui_out_field_string (uiout, "value", varobj_get_value (var)); > > > 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? - Volodya