From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: pedro@codesourcery.com (Pedro Alves)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Handle lack of non-stop support more gracefully
Date: Mon, 14 Jun 2010 15:50:00 -0000 [thread overview]
Message-ID: <201006141549.o5EFnuGE029348@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <201006141600.45583.pedro@codesourcery.com> from "Pedro Alves" at Jun 14, 2010 04:00:45 PM
Pedro Alves wrote:
> On Monday 14 June 2010 15:13:29, Ulrich Weigand wrote:
> > 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.
OK, thanks. I've checked the patch in now.
> 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.
I would suggest that just about any use of perror is wrong here. If
the underlying library routine detects any condition that makes the
rest of the test execution impossible, it should itself issue an
appropriate test status, which would usually be FAIL (if the condition
is due to a GDB bug), UNSUPPORTED (if it is due to some feature not
available on the platform), or UNRESOLVED (if it is due to some setup
or other external issue, like the target connection failing).
Then, the library should return an error code that causes the main
test case to silently stop any further test execution.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2010-06-14 15:50 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
2010-06-14 15:50 ` Ulrich Weigand [this message]
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=201006141549.o5EFnuGE029348@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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