From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8937 invoked by alias); 5 Feb 2008 06:56:56 -0000 Received: (qmail 8929 invoked by uid 22791); 5 Feb 2008 06:56:56 -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, 05 Feb 2008 06:56:31 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JMHjF-0006tV-QJ for gdb@sources.redhat.com; Tue, 05 Feb 2008 06:56:25 +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, 05 Feb 2008 06:56:25 +0000 Received: from ghost by 77.246.241.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Feb 2008 06:56:25 +0000 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Variable objects and STL containers Date: Tue, 05 Feb 2008 06:56:00 -0000 Message-ID: References: <18343.64413.689019.489727@kahikatea.snap.net.nz> <18344.836.184542.934917@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.5 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/msg00018.txt.bz2 Nick Roberts wrote: > > > 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 Well, that what I mean by 'falling over', in part ;-) I would not be suprised if attempt to increment an iterator, using the overloaded operator++, also will fail. > > 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? For each different STL implementation, you'd need different Python code to render vector. - Volodya