From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3758 invoked by alias); 5 Feb 2008 06:34:26 -0000 Received: (qmail 3749 invoked by uid 22791); 5 Feb 2008 06:34:25 -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, 05 Feb 2008 06:33:59 +0000 Received: from kahikatea.snap.net.nz (136.62.255.123.dynamic.snap.net.nz [123.255.62.136]) by viper.snap.net.nz (Postfix) with ESMTP id C0A603DA0AF; Tue, 5 Feb 2008 19:33:51 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id CEB4D8FC6D; Tue, 5 Feb 2008 19:33:40 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18344.836.184542.934917@kahikatea.snap.net.nz> Date: Tue, 05 Feb 2008 06:34:00 -0000 To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Variable objects and STL containers In-Reply-To: References: <18343.64413.689019.489727@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.1.50.23 X-IsSubscribed: yes 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: 2008-02/txt/msg00017.txt.bz2 > > 2) _M_impl, _M_start are gcc internals and I guess they could change (like > > CLI!) Is it meaningful to ask on the gcc list for a formal interface > > to these details? > > Technically, there is formal interface, called iterators, provided by the > C++ standard. I don't have the slightest confidence in gdb not falling over > if you try to use them, though. Are iterators available to GDB, or just the executable? I only seem able to access those methods which are used by my program, e.g., (gdb) p v.size () $3 = 3 but (gdb) p v.rbegin () Cannot evaluate function -- may be inlined > We discussed using Python scripting for that; in fact, I have a patch locally > that will make > > -var-evaluate-expression V > > for a vector print something like: > > [1,2,3] Does this work for programs compiled by any compiler, or just gcc? -- Nick http://www.inet.net.nz/~nickrob