This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][gdb/testsuite] Add -lbl option in gdb_test_multiple
- From: Pedro Alves <palves at redhat dot com>
- To: Tom de Vries <tdevries at suse dot de>, gdb-patches at sourceware dot org
- Date: Mon, 2 Mar 2020 13:34:10 +0000
- Subject: Re: [RFC][gdb/testsuite] Add -lbl option in gdb_test_multiple
- References: <20200219174014.GA28126@delia> <851a18b0-b172-4b59-e411-ce3379c95c76@redhat.com> <0208e698-e2e1-c13f-486f-caa3f7766d6a@suse.de> <883bfb0f-c8e7-ae6c-aa94-2486b3c76362@redhat.com> <80d69419-60df-8308-9587-295a86c5041b@suse.de> <946e4070-8328-3ff1-eb45-1532a8782acd@redhat.com> <4acd7ab7-7aae-c816-8fd9-830980888ac2@suse.de>
On 3/1/20 9:08 AM, Tom de Vries wrote:
> On 27-02-2020 17:02, Pedro Alves wrote:
>> Alternatively, if you don't like the -lbl within the {} block, and if
>> we're going to use "-" options, how about supporting them before
>> the {} user code block, so that the user code block is always
>> at the end? Like:
>>
>> gdb_test_multiple "command" "testname" -lbl {
>> ...
>> }
>>
>> gdb_test_multiple "command" "testname" -prompt $prompt_regexp {
>> ...
>> }
>>
>> That should be doable with:
>>
>> -proc gdb_test_multiple { command message user_code { prompt_regexp "" } } {
>> +proc gdb_test_multiple { command message args } {
>>
>> and then walking the $args list, processing "-" arguments, and interpreting
>> the first non-"-" argument as the user code block (and erroring out if there
>> are more arguments). I think the gdb_test_multiple code would look quite similar
>> to your patch, except that the user_code parameter would no longer be a parameter,
>> instead it would be a local variable set to the first non-"-" element of $args.
>
> Yes, I like that suggestion.
>
> Implemented and attached below.
>
> OK for trunk.
OK.
Thanks,
Pedro Alves