This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 2/2] Add test for user context selection sync


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]