This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: RFC: fix PR c++/9197


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.


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