This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] skip "attach" tests when testing against stub-like targets
- From: Pedro Alves <palves at redhat dot com>
- To: "Breazeal, Don" <donb at codesourcery dot com>, Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 09 Jan 2015 11:24:43 +0000
- Subject: Re: [PATCH] skip "attach" tests when testing against stub-like targets
- Authentication-results: sourceware.org; auth=none
- References: <1418748834-27545-1-git-send-email-palves at redhat dot com> <1418748834-27545-6-git-send-email-palves at redhat dot com> <87wq5qsfaf dot fsf at codesourcery dot com> <54921989 dot 4060005 at redhat dot com> <54AADFA1 dot 9040003 at codesourcery dot com> <54AD5BFC dot 2030906 at redhat dot com>
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