[PATCH][gdb/testsuite] Add -cooked pattern flag to gdb_test_multiple

Tom de Vries tdevries@suse.de
Sun Oct 6 06:37:00 GMT 2019


On 05-10-19 17:38, Andrew Burgess wrote:
> * Tom de Vries <tdevries@suse.de> [2019-10-05 08:05:03 +0200]:
> 
>> [ was: Re: [PATCH][gdb/testsuite] Introduce gdb_test_ext ]
>>
>> On 19-09-19 21:24, Andrew Burgess wrote:
>>> On further thought, I actually think there's no need for an extra
>>> function at all, we can get all the benefit (as I see it) by possibly
>>> updating gdb_test_multiple.  I'm travelling right now so can't code
>>> this up, but I think a solution that does something like this:
>>>
>>>      gdb_test_multiple "command" "test name" {
>>>        -re "full regexp here$gdb_prompt" {
>>>          pass $gdb_test_multiple_name
>>>        }
>>>        -output "pattern without prompt" {
>>>          fail $gdb_test_multiple_name
>>>        }
>>>      }
>>>
>>> So using '-re' and '-output' to specialise the behaviour of
>>> gdb_test_multiple, and adding in the $gdb_test_multiple_name variable.
>>>
>>> When I get back to my desk I'll try to code this up.
>>
>> Hi,
>>
>> I took a stab at this. I'm not sure about the naming though.
>>
>> For the pattern flag I used the name -cooked. Perhaps -wrap is better?
>> Any better suggestions?
>>
>> I used gdb_test_multiple_message (using the 'message' postfix because it
>> matched the name of the gdb_test_multiple argument) for the convenience
>> variable, but it's a tad long, perhaps we could abbreviate to
>> 'gtm_message'?
> 
> This duplicates work in this patch:
> 
>   https://sourceware.org/ml/gdb-patches/2019-10/msg00023.html
> 

I see, that's unfortunate. [ FWIW, it would have helped me if you would
have submitted continuing this thread, or cc-ed me on the new thread, or
mentioned the new thread at this thread. ]

> I was just about to merge that patch, but I'll leave it for a couple
> of days in case you'd like to provide feedback.
> 
> Pedro's suggestion, which I was going to adopt was 'gdb_test_name'.

OK, I'll take a look and follow up at the new thread if I have any comments.

Thanks,
- Tom



More information about the Gdb-patches mailing list