[PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp
Pedro Alves
pedro@palves.net
Fri Dec 10 22:01:22 GMT 2021
On 2021-11-22 17:33, Lancelot SIX wrote:
> On Mon, Nov 22, 2021 at 02:13:59PM +0000, Pedro Alves wrote:
>> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
>>> # Regression test for crash when an exception occurs in mi_parse.
>>> -gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
>>> - "regression test for mi_parse crash" {
>>> +set cmd "interpreter-exec mi \"-break-insert --thread a\""
>>> +gdb_test_multiple $cmd "regression test for mi_parse crash" {
>>
>> This "regression test for mi_parse crash" message is used if this
>> gdb_test_multiple detects an internal error, a timeout, etc.
>>
>>> -re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
>>> pass "$cmd"
>>
>> ... while here we use $cmd.
>>
>> This means that this test can have its result oscillate like this:
>>
>> -FAIL: regression test for mi_parse crash"
>> +PASS: interpreter-exec mi "-break-insert --thread a"
>> ...
>> +PASS: interpreter-exec mi "-break-insert --thread a"
>> -FAIL: regression test for mi_parse crash"
>>
>>
>> The "modern" pattern would be to not have a $cmd variable at all, pass an empty
>> string as second argument to gdb_test_multiple, and then passing $gdb_test_name
>> to "pass". Like:
>>
>> gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" "" {
>> -re .... {
>> pass $gdb_test_multiple
>> }
>> }
>>
>>
>> Though simplest is to pass $cmd as second argument too like other
>> gdb_test_multiple invocations in the file:
>>
>> gdb_test_multiple $cmd $cmd {
>> ...
>>
>>
>>
>> Could you take care of this while at it?
>>
>> Pedro Alves
>
> Hi,
>
> Thanks for the inputs.
>
> I have updated the patch as follows.
Thanks, this is OK.
More information about the Gdb-patches
mailing list