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] skip "attach" tests when testing against stub-like targets


On 01/07/2015 04:17 PM, Pedro Alves wrote:
> On 01/05/2015 07:01 PM, Breazeal, Don wrote:
>>>  # Start a set of programs running and then wait for a bit, to be sure
>>>  # that they can be attached to.  Return a list of the processes' PIDs.
>>>
>>>  proc spawn_wait_for_attach { executable_list } {
>>>      set pid_list {}
>>>
>>> +    if ![can_spawn_for_attach] {
>>> +	error "can't spawn for attach with this target/board"
>>> +    }
>>
>> Should this be calling "error", or should it call something like
>> "untested" or "unsupported", since it isn't expected to work in these cases?
> 
> The idea is that all .exp files that use spawn_wait_for_attach
> would have already checked can_spawn_for_attach early, and skipped the
> tests if false.  That makes is a test bug to see a call to
> spawn_wait_for_attach if can_spawn_for_attach is false.
> 
> I should have really split those hunks out to a separate patch and
> added calls to can_spawn_for_attach in all tests that are using
> spawn_wait_for_attach already.  Like below.  WDYT?
> 
> (There are probably other attach tests that don't use
> spawn_wait_for_attach that need the can_spawn_for_attach too.
> We can do this incrementally.)

I went ahead and pushed this to unblock the parent series.

> gdb/testsuite/
> 2015-01-09  Pedro Alves  <palves@redhat.com>
>
>         * lib/gdb.exp (can_spawn_for_attach): New procedure.
>         (spawn_wait_for_attach): Error out if can_spawn_for_attach returns
>         false.
> 	* gdb.base/attach.exp: Use can_spawn_for_attach instead of
> 	checking whether the target board is remote.
> 	* gdb.multi/multi-attach.exp: Likewise.
> 	* gdb.python/py-sync-interp.exp: Likewise.
> 	* gdb.server/ext-attach.exp: Likewise.
> 	* gdb.python/py-prompt.exp: Use can_spawn_for_attach before the
> 	tests that need to attach, instead of checking whether the target
> 	board is remote at the top of the file.

Thanks,
Pedro Alves


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