This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: fix PR c++/9197
- From: Tom Tromey <tromey at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 20 Mar 2013 08:41:16 -0600
- Subject: Re: RFC: fix PR c++/9197
- References: <87d2xcvjny dot fsf at fleche dot redhat dot com> <20130203052021 dot GA16948 at host2 dot jankratochvil dot net> <87wquo11ej dot fsf at fleche dot redhat dot com> <20130206195920 dot GA2797 at host2 dot jankratochvil dot net> <87y5dxpryn dot fsf at fleche dot redhat dot com> <CADPb22QYpJaeUaWT9JZ1hT7+QM-wNBkBq0absFyXQT76zQ=BdA at mail dot gmail dot com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> For my own education, setting aside however broken gdb currently is,
Doug> what's the right answer?
Doug> IOW, how is ptype *defined* to work?
I don't think it has a definition.
I suppose ideally ptype ought to work purely symbolically. That is,
without reference to the target's state. However, this isn't what it
actually does, and AFAIK nobody has ever complained about this.
Doug> class s { public: int x; };
Doug> int s;
Doug> Also, for reference sake,
Doug> (gdb) p s
Doug> Attempt to use a type name as an expression
Doug> How do I print s the variable? [maybe there's a way but it escapes me]
There's a PR about this.
I'm not sure there is a way.
Tom