Re: [PATCH RFA] New constvars.exp tests

Daniel Jacobowitz
2002-10-10T20:39:58Z

On Thu, Oct 10, 2002 at 01:32:59PM -0700, Kevin Buettner wrote:
> I am about to submit a patch which causes ptype to print a struct with
> qualifiers correctly. E.g, for the "crass" test, gdb currently
> exhibits the following behavior:
>
> (gdb) ptype crass
> type = struct crass {
> char * constptr;
> }
>
> This is incorrect because gdb failed to print a space in between
> "const" and "ptr".
>
> Unfortunately, if you don't use Dwarf 2, you'll simply end up seeing
>
> type = struct crass {
> char *ptr;
> }
>
> ...which is also wrong, but not unexpected (hence the xfail).

Not necessarily. Recent versions of GCC will emit const qualifiers in
stabs, leading to a horde of XPASS's in our testsuite... but that's a
problem for another patch.

Nice to see someone working on the type printer. I'm planning to
submit a "hit it over the head with a board" patch in a couple of days,
to let us simulate the output of the various demangling styles.

> * gdb.base/constvars.c (struct crass, struct crisp): New structs.
> * gdb.base/constvars.exp (ptype crass, ptype crisp): New tests.

FWIW, these test cases look correct to me.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer