Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Ulrich Weigand" <uweigand@de.ibm.com>
Subject: Re: [rfc] Handle lack of non-stop support more gracefully
Date: Mon, 14 Jun 2010 15:01:00 -0000	[thread overview]
Message-ID: <201006141600.45583.pedro@codesourcery.com> (raw)
In-Reply-To: <201006141413.o5EEDTXT013028@d12av02.megacenter.de.ibm.com>

On Monday 14 June 2010 15:13:29, Ulrich Weigand wrote:
> Hello,
> 
> on spu-elf I'm now seeing:
> 
> ERROR: mi-ns-stale-regcache.exp tests suppressed
> UNRESOLVED: gdb.mi/mi-nsintrall.exp: Couldn't compile /home/uweigand/fsf/gdb-head/gdb/testsuite/gdb.mi/nsintrall.c: unrecognized error
> 
> Now, on the SPU we don't support non-stop execution (in fact, the SPU
> is always single-threaded anyway).  Therefore, all the non-stop tests
> ought to be marked as UNSUPPORTED.  And in fact, the mi_run_to_main
> routine does that.
> 
> However, various test cases, *in addition* to the actions done by
> the mi_run_to_main routine, themselves call "perror":
>     perror "mi-ns-stale-regcache.exp tests suppressed"
> 
> This seems wrong to me: First of all, an ERROR is supposed to mark some
> sort of unexpected failure of the test harness itself, with unpredictable
> results on the test outcome.  This is not the case for a feature that is
> simply not supported on a target.  Second, because of that, the DejaGNU
> main test harness will use the presence of any perror call as signal to
> mark the next regular test result as UNRESOLVED instead of whatever the
> actual result was -- even if this happens to be in a completely different
> test!  (See the example above.)
> 
> [ Note that the reason this doesn't show up with any of the other non-stop
> tests on SPU is that they already fail during the compile stage due to
> the absence of pthreads support.  mi-ns-stale-regcache is the only non-stop
> test that does not require pthreads.  ]
> 
> It seems to me the correct way to handle this is for mi_run_to_main to
> detect the case where the non-stop feature is unsupported, generate an
> appropriate test result (UNSUPPORTED), which it already does, and then
> have the main test just terminate with no further message.
> 
> The following patch implements this, and fixes the above problems on SPU.
> 
> Pedro, it seems you originally added the perror calls -- was there any
> reason I may be missing why we should need them anyway?

Sorry, I don't recall.  There was probably no good reason.  I probably
copied it from what some CLI tests do:

 if ![runto_main] then {
   perror "Couldn't run to main"
   return -1
 }

I've no objections to your patch.

I took a quick look over mi-support, and I can see how I got a bit confused
about what do the different return codes leading up to mi_run_to_main mean.
It looks like some non-gdbserver targets will still trip on
this problem:

    } elseif { [target_info gdb_protocol] == "remote" } {
	# remote targets
	if { [mi_gdb_target_cmd "remote" [target_info netport]] != 0 } {
	    perror "Unable to connect to remote target"
	    return -1
	}

?

Maybe mi_gdb_target_cmd should return a different error code for
not-supported vs connection error.

I'm still a bit confused over how the non-stop MI handle this.  If
mi_gdb_target_cmd fails to connect, it seems to return 0 anyway, so
the following tests will just cascade in FAILs.  For other, non-remote
targets, mi_gdb_target_load will call perror on connection fail, but
the gdbserver branch at the top doesn't.

-- 
Pedro Alves


  reply	other threads:[~2010-06-14 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 14:13 Ulrich Weigand
2010-06-14 15:01 ` Pedro Alves [this message]
2010-06-14 15:50   ` Ulrich Weigand
2010-06-14 15:59     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006141600.45583.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox