From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32461 invoked by alias); 22 Apr 2008 12:14:27 -0000 Received: (qmail 32451 invoked by uid 22791); 22 Apr 2008 12:14:27 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Apr 2008 12:14:07 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6837A983DB; Tue, 22 Apr 2008 12:14:05 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 4489598060; Tue, 22 Apr 2008 12:14:05 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JoHNs-00009x-0x; Tue, 22 Apr 2008 08:14:04 -0400 Date: Tue, 22 Apr 2008 14:41:00 -0000 From: Daniel Jacobowitz To: Vincent Benony Cc: gdb-patches@sourceware.org Subject: Re: Using STL containers with GDB Message-ID: <20080422121403.GA314@caradoc.them.org> Mail-Followup-To: Vincent Benony , gdb-patches@sourceware.org References: <1208857199.6213.15.camel@bsr-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1208857199.6213.15.camel@bsr-desktop> User-Agent: Mutt/1.5.17 (2007-12-11) 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: 2008-04/txt/msg00468.txt.bz2 On Tue, Apr 22, 2008 at 11:39:59AM +0200, Vincent Benony wrote: > Hi, > > I use gdb at work for some time now. We currently develop a > multiplatform software which heavily use STL templates. As a result, > it's always difficult to me to debug such code. > > I tried to find a way to debug more efficiently by using gdb scripts > that were able to dump std::vector or std::list, but it was always > painful. > > So, yesterday, I decided myself to look at the code of GDB. After a > quick look, I wrote this patch. I know that it's not very clean, and > that it makes many assumptions about STL containers, and that it cannot > be considered as a long term feature for GDB, but, believe me, it's very > very usefull ! Thanks for doing this. As for a long term solution, please take a look at the in-progress Python branch, in Volodya's git repository. STL support is a big missing feature, but we'd like to add it by external scripts so that they can be distributed along with the library, modified without recompiling GDB, and so forth. I think Vladimir's got it printing std::vector already. I really hope we'll have it included in the next release! -- Daniel Jacobowitz CodeSourcery