This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 2/2] Add test for user context selection sync
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Pedro Alves <palves at redhat dot com>, Simon Marchi <simon dot marchi at polymtl dot ca>, <gdb-patches at sourceware dot org>
- Cc: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Date: Mon, 3 Oct 2016 13:47:58 -0400
- Subject: Re: [PATCH v3 2/2] Add test for user context selection sync
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <20160924201331.23605-1-simon.marchi@polymtl.ca> <20160924201331.23605-2-simon.marchi@polymtl.ca> <22ae2259-f47d-4ea0-53fc-510aa9b6f45c@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 16-10-03 01:10 PM, Pedro Alves wrote:
> On 09/24/2016 09:13 PM, Simon Marchi wrote:
>
>> +set main_break_line [gdb_get_line_number "main break line"]
>> +set thread_loop_line [gdb_get_line_number "thread loop line"]
>> +set thread_caller_line [gdb_get_line_number "thread caller line"]
>> +
>> +# Call PROCNAME with the given arguments, inside a with_test_prefix $procname
>> +# block.
>> +
>> +proc with_test_prefix_procname { procname args } {
>> + with_test_prefix $procname {
>> + # Note: this syntax requires TCL 8.5, if we need to support 8.4,
>> + # we'll need to find an alternative.
>> + $procname {*}$args
>> + }
>> +}
>
> An alternative (not talking about TCL 8.5 here), would be to
> go the gdb_caching_proc way. That is, something like:
>
> proc prefixed_proc {name body} {
> ...
> }
>
> .. and then define the procs that you want to prefix with
> prefixed_proc instead of proc.
Interesting, I hadn't thought of that.
> But either way is fine with me.
>
> I mildly dislike using the proc names as prefix strings as it feels
> like implementation details leaking, but as long as the proc names are
> clear enough, I won't really complain about it. Who knows, I may even
> grow to like it. :-)
I agree about the principle. While developing though, I found it was very
useful since it allowed to jump directly to the right procedure.
>> + # When using mi_expect_stop, we don't expect a prompt after the *stopped
>> + # event, since the blocking commands are done from the CLI. Seting async to
>> + # 1 makes it not expect the prompt.
>> + set async 1
>
> "Setting".
Fixed.
Thanks,
Simon