Re: [PATCH v2 2/5] Further cleanup/modernization of gdb.base/commands.exp

Pedro Alves
2016-11-09T16:22:55Z

On 11/09/2016 04:09 PM, Simon Marchi wrote:
> On 2016-11-09 10:59, Pedro Alves wrote:
>> And I'm wondering whether this below as well would be a good idea,
>> or whether it'd obfuscate? If a good idea, maybe we'd put the new
>> variable in gdb.exp.
>
> ...
>
>> @@ -45,7 +50,7 @@ proc_with_prefix gdbvar_simple_if_test {} {
>> "else" \
>> " p/x 0xdeadbeef" \
>> "end"] \
>> - "\\\$\[0-9\]* = 0xdeadbeef" \
>> + "$valnum_re = 0xdeadbeef" \
>> "#1"
>
>
> That's not bad. I was going to suggest using {} instead of "" to get
> rid of most backslashes (untested):
>
> -"\\\$\[0-9\]* = 0xdeadbeef"
> +{\$[0-9]* = 0xdeadbeef}

I strikes me that I can use {}when building the input strings. I was
already doing it in the new tests added by the following patches, but
not in this one, for some reason. Let me give that a try.

>
> but with the variable it looks good as well.
>

Thanks,
Pedro Alves