Re: [PATCHv2 4/4] gdb: Allow struct fields named double

Tom Tromey
2018-12-21T17:19:48Z

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> gdb/ChangeLog:

Andrew> * c-exp.y (field_name): Allow DOUBLE_KEYWORD, INT_KEYWORD, LONG,
Andrew> SHORT, SIGNED_KEYWORD, and UNSIGNED tokens to act as a field
Andrew> names.
Andrew> (typename_stoken): New function.

Andrew> gdb/testsuite/ChangeLog:

Andrew> * gdb.dwarf2/dw2-unusual-field-names.c: New file.
Andrew> * gdb.dwarf2/dw2-unusual-field-names.exp: New file.

Thanks for doing this. This is ok. I wanted to mention that I think
it's a good idea to do this because the C language also serves as a
fallback either when language support isn't available or when one wants
to inspect things in a low-level way, and in this case it can be useful
to have some extensions to C.

Andrew> +foreach field_name { double float char byte long int short unsigned signed } {
Andrew> + run_test $field_name
Andrew> +}

I'd like to verify that there aren't any duplicate test names resulting
from this approach. If there aren't, this is fine; if there are, I
think run_test could be wrapped in a with_test_prefix.

thanks,
Tom