From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2140 invoked by alias); 30 Jul 2007 20:41:48 -0000 Received: (qmail 2117 invoked by uid 22791); 30 Jul 2007 20:41:46 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jul 2007 20:41:42 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l6UKfdp0004933 for ; Mon, 30 Jul 2007 16:41:39 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6UKfdn8007954 for ; Mon, 30 Jul 2007 16:41:39 -0400 Received: from [172.16.57.153] (multics.rdu.redhat.com [172.16.57.153]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6UKfcYn003481 for ; Mon, 30 Jul 2007 16:41:38 -0400 Subject: Re: dereferencing pointers from frysk.value From: Stan Cox To: Frysk List In-Reply-To: <46AA1512.3040908@redhat.com> References: <1185548524.11775.27.camel@multics.rdu.redhat.com> <46AA1512.3040908@redhat.com> Content-Type: text/plain Date: Mon, 30 Jul 2007 20:41:00 -0000 Message-Id: <1185828018.11775.71.camel@multics.rdu.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-1.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00229.txt.bz2 On Fri, 2007-07-27 at 11:53 -0400, Andrew Cagney wrote: > So at present a "pointer" value is seen as a pair: > type: pointer->char > location: byte-buffer with size==sizeof(void*) and > contents=="pointer value" > and there's nothing for the "pointer" to point into? Right. Pointer operators are special cased so pointer class members were the primary culprits. Good idea to parameterize printing with the buffer. Now char* pointers get expanded similar to gdb (the formatting is a little rough around the edges): (fhpd) what mb extern Type at (fhpd) what Type (inherits from Base1 and Base2) {{byte * msg;void Base1 (byte * ) ;void ~Base1 () ;} Base1;{byte * msg;void Base2 (byte * ) ;void ~Base2 () ;} Base2;byte * note;void Type (byte * ,byte * ,byte * ) ;void ~Type () ;} at /home/scox/accu/src/tstctors0.cc#33 (fhpd) print mb {Base1={msg=0x401240 "static",Base1,~Base1},Base2={msg=0x40123b "main",Base2,~Base2},note=0x401238 "mb",Type,~Type} By the way here is an early template example (very rough formatting): (fhpd) what xyz Derived at /home/scox/accu/src/tstctors0.cc#79 (fhpd) what Derived {{void * * _vptr.Base3;void Base3 () ;void Base3 () ;char do_this (char ) ;short int do_this (short int ) ;int do_this (int ) ;float do_this (float ) ;} Base3;void Derived () ;void Derived () ;char do_this (char ) ;short int do_this (short int ) ;int do_this (int ) ;float do_this (float ) ;char do_this_impl (char ) ;short int do_this_impl (short int ) ;int do_this_impl (int ) ;float do_this_impl (float ) ;} at /home/scox/accu/src/tstctors0.cc#57 (fhpd) print xyz void* {Base3={_vptr.Base3=0x401290,Base3,Base3,do_this,do_this,do_this,do_this},Derived,Derived,do_this,do_this,do_this,do_this,do_this_impl,do_this_impl,do_this_impl,do_this_impl}