This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dereferencing pointers from frysk.value


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 <unknown>
(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> (char ) ;short int
do_this_impl<short int> (short int ) ;int do_this_impl<int>
(int ) ;float do_this_impl<float> (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<char>,do_this_impl<short int>,do_this_impl<int>,do_this_impl<float>}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]