Re: [cplus] An initial use of the canonicalizer

Daniel Jacobowitz
2003-12-31T00:59:17Z

On Tue, Dec 30, 2003 at 04:15:02PM -0500, Michael Chastain wrote:
> Uh, I don't like parts of this.

That's why I'm not submitting it for mainline yet. Sorry if I wasn't
clear. The [cplus] tag means it's going on my branch.

>
> - -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char.* \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
> + -re "type = (class |)Foo<.*char.* ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char.* \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
>
> You dropped the "volatile" from the expected test pattern.
> Can you do something like:
>
> (volatile char ?*|char volatile ?*)

What's going to happen in the end is that we won't need any of this
garbage. You'll be able to say:
char volatile\\*
and no matter what debug info format or compiler generated the object,
that's what GDB will print. For now I'm just kludging around things so
that I can see when I introduce regressions on my branch.

> Here is why: sometimes, I need to run the current test suite with gdb 6.0,
> because the 6.0 test suite no longer works with the current compiler.
> So it helps me a lot if the current test suite accepts the output
> of both gdb 6.0 and gdb HEAD.
>
> Sometimes this is painful but in cases like this it's easy and cheap.

Not when I'm done with my project, it won't be. Let's talk about the
problem. Which is more important - checking GDB 6.0 against GCC HEAD,
or being able to verify that I've successfully canonicalized _all_ of
GDB's output patterns?

I'd like to consider "volatile char *" a bug when we're expecting to
see "char volatile*", not accept both. As a general issue. (I
personally consider the former more natural, but the latter seems to be
more common C++ style and matches the demangler, for this specific
example).