From: Stan Cox <scox@redhat.com>
To: Frysk List <frysk@sourceware.org>
Subject: Re: dereferencing pointers from frysk.value
Date: Mon, 30 Jul 2007 20:41:00 -0000 [thread overview]
Message-ID: <1185828018.11775.71.camel@multics.rdu.redhat.com> (raw)
In-Reply-To: <46AA1512.3040908@redhat.com>
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>}
prev parent reply other threads:[~2007-07-30 20:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 15:02 Stan Cox
2007-07-27 15:53 ` Andrew Cagney
2007-07-30 20:41 ` Stan Cox [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1185828018.11775.71.camel@multics.rdu.redhat.com \
--to=scox@redhat.com \
--cc=frysk@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).