Re: [PATCH v3 31/34] Add testing infrastruture bits for running with MI on a separate UI

Pedro Alves
2016-06-29T10:50:34Z

On 06/28/2016 09:19 PM, Simon Marchi wrote:

> I think this commit breaks MI tests with native-gdbserver:
>
> $ make check RUNTESTFLAGS="--target_board=native-gdbserver mi-var-child.exp"
> ...
> Running /home/emaisin/build/binutils-gdb/gdb/testsuite/../../../../src/binutils-gdb/gdb/testsuite/gdb.mi/mi-var-child.exp ...
> can't unset "inferior_spawn_id": no such variable
> while executing
> "unset inferior_spawn_id"
> (procedure "close_gdbserver" line 20)
> invoked from within
> "close_gdbserver"
> ...
>

I can reproduce this. Odd, maybe I made some last minute change
that went untested, not sure. I'll take a look.

Thanks,
Pedro Alves

> I added a few traces to understand what's happening, and it seems that inferior_spawn_id
> is being unset at two places:
>
>>>> gdbserver-support.exp:gdb_exit called
>>>> gdb.exp:default_gdb_exit called
>>>> mi-support.exp:default_mi_gdb_start called
> *** set inferior_spawn_id to gdb_spawn_id exp8 in mi-support.exp:default_mi_gdb_start
>>>> gdbserver-support.exp:gdbserver_start called
> *** set server_spawn_id in gdbserver-support.exp:gdbserver_start
> *** set inferior_spawn_id to server_spawn_id exp9 in gdbserver-support.exp.exp:gdbserver_start
>>>> gdbserver-support.exp:gdbserver_start called
> *** set server_spawn_id in gdbserver-support.exp:gdbserver_start
> *** set inferior_spawn_id to server_spawn_id exp10 in gdbserver-support.exp.exp:gdbserver_start
>>>> mi-support.exp:mi_uncatched_gdb_exit called
> *** unset inferior_spawn_id in mi-support.exp:mi_uncatched_gdb_exit
>>>> gdbserver-support.exp:gdb_exit called
> *** unset server_spawn_id in gdbserver-support.exp:close_gdbserver
> *** unset inferior_spawn_id in gdbserver-support.exp:close_gdbserver <--- This is the one that breaks.
>
> The easy way would be to add a "info exists" check before unsetting it, but I don't know if
> that would only hide a real problem.
>
> Simon
>