This is the mail archive of the gdb@sources.redhat.com 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] xfailed tests in gdb.c++/classes.exp


> 1) GDB prints "class X { public: ... }" when the programmer originally
>    wrote "struct X { ... }".

We talked about this about two years ago, and the consensus was
that this is a bug in gdb.  I did not agree with that consensus.

> 2) GDB prints "class X { private: int x; ... }" when the programmer
>    originally wrote "class X { int x; ... }".

I don't recall discussing this in particular.

> The arguments for treating them as passes is as follows: GDB's goal
> isn't to print out exactly what the programmer typed: it's to print
> out a type that's equivalent to what the programmer typed, one that
> gives all the information that the programmer needs.

I believe in this.

> And, in both of the cases above, programmers could replace their
> definitions by the definitions that GDB prints out without changing the
> behavior of their programs.

I believe this is a good operational test.

As a user, it's perfectly fine with me that GDB canonicalizes the
class/struct when printing it out.  It's vital that GDB prints
_correct_ information.  It's important that GDB prints _complete_
information.  We have so many problems at this level with C++,
it's a crying shame that we devote bug-handling resources to
"class X { public: ... }".

> Personally, I'd treat both these cases as passes.  On the other hand,
> Daniel's the C++ maintainer; if he thinks one or both of these cases
> should be considered a bug in GDB, then I'll file PR's and KFAIL them
> as appropriate.

Ditto.

Michael C


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