This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: fix PR c++/9197
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat 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:18:08 -0700
- 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> <87ppyu9lrn dot fsf at fleche dot redhat dot com>
On Wed, Mar 20, 2013 at 7:41 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "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.
Ah.
Getting back to another thing I said, can we take this opportunity to
give it one?
Also, I guess another question to ask is: What is the definition of
EVAL_AVOID_SIDE_EFFECTS?
[since that's what ptype ultimately uses, and since it is used elsewhere]
If it means "no side effects, except that reading memory is ok" I
think we need to write that down somewhere.
> 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.
Note to self: Need to check that the pr (or another pr) states that
"ptype s" is also ambiguous.