From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26809 invoked by alias); 23 Apr 2008 08:55:33 -0000 Received: (qmail 26799 invoked by uid 22791); 23 Apr 2008 08:55:33 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Apr 2008 08:55:06 +0000 Received: from kahikatea.snap.net.nz (135.31.255.123.static.snap.net.nz [123.255.31.135]) by viper.snap.net.nz (Postfix) with ESMTP id 0CEA13DA450; Wed, 23 Apr 2008 20:55:04 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id E82F08FC6D; Wed, 23 Apr 2008 20:54:58 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18446.63842.82964.950574@kahikatea.snap.net.nz> Date: Wed, 23 Apr 2008 10:12:00 -0000 To: =?ISO-8859-1?Q?Vincent_B=E9nony?= Cc: Daniel Jacobowitz , gdb-patches@sourceware.org Subject: Re: Using STL containers with GDB In-Reply-To: References: <1208857199.6213.15.camel@bsr-desktop> <18446.23053.860176.935315@kahikatea.snap.net.nz> <20080422215146.GA3156@caradoc.them.org> X-Mailer: VM 7.19 under Emacs 22.2.50.2 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/msg00505.txt.bz2 > >> The Python branch appears to work for executables compiled with Gcc > >> only. I'm > >> curious to know if this approach will work for executables built > >> using other > >> compilers? > > > > Vincent's implementation has the layout of the GNU STL implementation > > hardcoded into it - so even less portable than the Python > > implementation, which uses the field names. > > You are right, this patch is very hardcoded. I assume that fields of > STL containers are always in the same order. I ask GDB the size of > "void *", and I compute fields offsets using this information to read > things I need. If you use another compiler, but with GNU STL headers, > this patch *should* continue to work... Thar's what I wonder: would your approach, implemented as a Python script, give the best of both worlds? -- Nick http://www.inet.net.nz/~nickrob