From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14643 invoked by alias); 23 Apr 2008 11:54:14 -0000 Received: (qmail 14634 invoked by uid 22791); 23 Apr 2008 11:54:14 -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; Wed, 23 Apr 2008 11:53:54 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 2FBD5983E4; Wed, 23 Apr 2008 11:53:53 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id DCE11980F7; Wed, 23 Apr 2008 11:53:52 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JodXs-0004IN-2l; Wed, 23 Apr 2008 07:53:52 -0400 Date: Wed, 23 Apr 2008 12:22:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Vincent =?iso-8859-1?Q?B=E9nony?= , gdb-patches@sourceware.org Subject: Re: Using STL containers with GDB Message-ID: <20080423115352.GB16165@caradoc.them.org> Mail-Followup-To: Nick Roberts , Vincent =?iso-8859-1?Q?B=E9nony?= , gdb-patches@sourceware.org References: <1208857199.6213.15.camel@bsr-desktop> <18446.23053.860176.935315@kahikatea.snap.net.nz> <20080422215146.GA3156@caradoc.them.org> <18446.63842.82964.950574@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18446.63842.82964.950574@kahikatea.snap.net.nz> 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/msg00513.txt.bz2 On Wed, Apr 23, 2008 at 08:54:58PM +1200, Nick Roberts wrote: > > 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? If you're talking about another compiler, in what way is this better than doing it by field name? If you're using the GNU STL, you'll get the same field names and class layout regardless of the compiler. If you're not, then both the field names and class layout will be different. -- Daniel Jacobowitz CodeSourcery