From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5908 invoked by alias); 16 Jun 2009 07:22:44 -0000 Received: (qmail 5896 invoked by uid 22791); 16 Jun 2009 07:22:42 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp.nokia.com (HELO mgw-mx09.nokia.com) (192.100.105.134) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Jun 2009 07:22:36 +0000 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n5G7M7rL018335 for ; Tue, 16 Jun 2009 02:22:34 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 16 Jun 2009 10:22:22 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 16 Jun 2009 10:22:21 +0300 Received: from gar.localnet (bettdhcp167194.europe.nokia.com [172.25.167.194]) by mgw-da01.ext.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n5G7MHo5017409 for ; Tue, 16 Jun 2009 10:22:18 +0300 From: =?iso-8859-1?q?Andr=E9_P=F6nitz?= To: gdb@sourceware.org Subject: Re: Robustifying pretty-printers Date: Tue, 16 Jun 2009 07:22:00 -0000 User-Agent: KMail/1.11.2 (Linux/2.6.28-11-generic; KDE/4.2.2; i686; ; ) References: <200906131411.34204.vladimir@codesourcery.com> <20090615125509.GA20779@caradoc.them.org> <200906151725.31749.vladimir@codesourcery.com> In-Reply-To: <200906151725.31749.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906160922.33025.andre.poenitz@nokia.com> X-Nokia-AV: Clean Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00170.txt.bz2 On Monday 15 June 2009 15:25:31 Vladimir Prus wrote: > On Monday 15 June 2009 Daniel Jacobowitz wrote: > > > On Mon, Jun 15, 2009 at 04:38:57PM +0400, Vladimir Prus wrote: > > > On Monday 15 June 2009 Phil Muldoon wrote: > > > > + return self.val['_M_dataplus']['_M_p'].string (encoding, length = len) > > > > > > Great, this is exactly what I was looking for. > > > > Is it? This uses the length from the (possibly uninitialized) > > std::string as a maximum. I think we want something higher level, > > similar to today's "set print elements", to apply. > > That's a separate matter, which I raise in the topic starter. Yes, we want > some safety net. As it stands, any IDE that automatically displays local > variables is totally broken if pretty-printing is enabled. The decision whether a std::string display should be limited to 100 or 10000 characters or maybe whether it should be risked to show "all" is nothing that should be done on the gdb side, as all are valid choices under certain circumstances. So, please, don't make that kind of "high level" decision on the gdb side, and also, please, generally take into account that other IDEs might have other preferences than your IDE. At least from my point of view having a minimal(-ish) set of MI commands providing fast and robust access to the data gdb can provide on the CLI is a lot more desirable than having a bigger part of _one_ IDE's logic hardwired into gdb MI. Andre'