From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6846 invoked by alias); 4 Jan 2004 17:09:00 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6839 invoked from network); 4 Jan 2004 17:08:59 -0000 Received: from unknown (HELO moutvdomng.kundenserver.de) (212.227.126.249) by sources.redhat.com with SMTP; 4 Jan 2004 17:08:59 -0000 Received: from [212.227.126.223] (helo=mrelayng.kundenserver.de) by moutvdomng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AdBkJ-0001kl-00 for gdb@sources.redhat.com; Sun, 04 Jan 2004 18:08:59 +0100 Received: from [80.131.66.238] (helo=onlinehome.de) by mrvdomng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AdBkI-0007dg-00 for gdb@sources.redhat.com; Sun, 04 Jan 2004 18:08:59 +0100 Message-ID: <3FF853B5.7020107@onlinehome.de> Date: Sun, 04 Jan 2004 17:09:00 -0000 From: Christoph Jaeschke Reply-To: no.spam.cjaeschke@onlinehome.de User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6a) Gecko/20031029 MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: Proposal: offset based member name (or type) lookup Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-01/txt/msg00033.txt.bz2 Hi, I would like to propose a offset based member name lookup of structs/classes. Assume: struct X { int a; int b; }; struct Y { struct X x[4]; int c; }; struct Z { Y y; }; If you apply a patch for gdb 6.0 I've prepared, you can ask gdb by ptype Z + 28 about Z's relative name at offset 28 .y.x[3].b using ptype Z+28, typechain gdb will append also the typechain .y.x[3].b, typechain = ::Y::X[4]::int There may be a better suited command than 'ptype' for it, it was choosen just because it was the simplest way to add it. The patch contains also a caching mechanism, speeding up a lot if you do many lookups in big nested structures. It has a minimal memory requirement and will not hurt for single lookups. The patch can be send if you are interested in. Christoph Jaeschke