This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 4/6] testsuite: Don't use expect_background to reap gdbserver
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 13 Apr 2015 13:09:42 +0100
- Subject: Re: [PATCH 4/6] testsuite: Don't use expect_background to reap gdbserver
- Authentication-results: sourceware.org; auth=none
- References: <1424699660-11727-1-git-send-email-palves at redhat dot com> <1424699660-11727-5-git-send-email-palves at redhat dot com> <864mokuuep dot fsf at gmail dot com>
On 04/13/2015 12:42 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> +proc gdb_exit {} {
>> + global gdb_spawn_id server_spawn_id
>> + global gdb_prompt
>> +
>> + if {[info exists gdb_spawn_id] && [info exists server_spawn_id]} {
>> + send_gdb "monitor exit\n";
>> + gdb_expect {
>> + -re "$gdb_prompt $" {
>> + exp_continue
>> + }
>> + -i "$server_spawn_id" eof {
>> + wait -i $expect_out(spawn_id)
>> + unset server_spawn_id
>> + }
>> + }
>> + }
>
> Do we need to catch exception here?
Whoops, yes, looks like it.
> I wrap the send_gdb and gdb_expect statement above by "catch",
> testing looks fine, although error messages are still shown in the
> console and gdb.log.
Why not suppress the error message? I think you just need to pass
a var name as second parameter to "catch".
Thanks,
Pedro Alves