From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] Make language setting tests more robust
Date: Wed, 01 Feb 2017 21:50:00 -0000 [thread overview]
Message-ID: <58925832.8050306@redhat.com> (raw)
In-Reply-To: <331062ebcc7352d7731347260b56dee7@polymtl.ca>
Not to belabor the point, but...
On 02/01/2017 10:38 AM, Simon Marchi wrote:
>>
>> +# Set the language and handle possible warnings output by GDB if we
>> select a
>> +# language that differs from the current frame's language.
>> +#
>> +# The first argument is the language to set.
>> +# The second argument is an optional message to be output by the test.
>> +
>> +proc set_language { args } {
>
> Instead of "args", it might be clearer to use a default argument for the
> second arg:
>
> proc set_language { language { message "" } } {
>
> And lower:
>
> if { $message == "" } {
> set message $command
> }
>
> Not sure about the exact TCL syntax, but I think you get the point :).
>
Yes, your syntax looks correct to me. [I was in the process of writing
exactly the same thing.]
Regarding gdb_test_no_output et al, this grokking of args needs to be
banished from the test suite. It adds unnecessary complexity. I would
encourage maintainers to request revision when such a thing is proposed
for the test suite.
As a heads up/reminder, we also have parse_args, which is suitable for
more advanced use cases, involving multiple optional arguments and
flags. mi_make_breakpoint is one such place that demonstrates the use of
this facility.
Keith
next prev parent reply other threads:[~2017-02-01 21:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 15:17 Luis Machado
2017-02-01 18:38 ` Simon Marchi
2017-02-01 19:22 ` Luis Machado
2017-02-01 19:25 ` Simon Marchi
2017-02-01 21:50 ` Keith Seitz [this message]
2017-02-01 23:29 ` Luis Machado
2017-02-02 1:24 ` Simon Marchi
2017-02-01 20:21 ` [PATCH,v2] " Luis Machado
2017-02-02 1:33 ` Simon Marchi
2017-02-03 0:37 ` Pedro Alves
2017-02-06 14:54 ` Luis Machado
2017-02-06 15:09 ` Luis Machado
2017-02-06 16:51 ` Pedro Alves
2017-02-06 18:04 ` Luis Machado
2017-02-06 18:08 ` Pedro Alves
2017-02-06 18:22 ` Luis Machado
2017-02-06 18:24 ` Pedro Alves
2017-02-06 19:56 ` Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58925832.8050306@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).