Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Pedro Alves <palves@redhat.com>,
	Daniel Jacobowitz <drow@false.org>,	<gdb-patches@sourceware.org>,
	Richard Sandiford <rdsandiford@googlemail.com>
Subject: Re: gdb_test_multiple and empty $message
Date: Fri, 27 Apr 2012 20:23:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1204272040030.19835@tp.orcam.me.uk> (raw)
In-Reply-To: <87y5pi8tnm.fsf@fleche.redhat.com>

On Thu, 26 Apr 2012, Tom Tromey wrote:

> Pedro> My impression gdb_test without a message string is used at places
> Pedro> we're sending some commands that just prepare the real test.
> Pedro> It's a bit arguable whether we should do that, but there you go.
> Pedro> But I think that hiding an internal fail in such preparation
> Pedro> steps, which are never ever expected to fail (otherwise you'd
> Pedro> pass down a message string to begin with) would be actively
> Pedro> harmful, and make it harder to grok and debug testsuite results.
> 
> Yeah, I agree.
> 
> I remember thinking sometimes that it would be nice to have something
> like gdb_test_multiple that just returns a status instead of also
> logging a pass/fail as a side effect.  I can't remember my scenario now.

 Actually I thought it could be useful for my mips16-thunks.exp test, but 
there is some uncertainty about what should be considered an internal 
error for this purpose.  As you can see the test already makes use of the 
return code from gdb_test_multiple; the test could be extended to tell 
internal errors apart from other failures in the preparatory steps where 
it wants to ignore most responses that would normally score as failures.  

 And:

".*A problem internal to GDB has been detected"

is undoubtedly a bug in GDB the test would rather not ignore (but it does 
now), as is the EOF condition, but:

"Ending remote debugging.*$gdb_prompt $"

may or may not be -- if it's `gdbserver' being used, then it's our bug, if 
it's some other stub, then it may be they just do not support MIPS16 
debugging.

 So for this to work for my case I think gdb_test_multiple would have to 
define a list of distinct return codes covering individual cases of 
suspected internal errors (these could be short strings rather than 
numbers for easier handling, it's TCL not C after all) alongside the 
message gdb_test_multiple would print should the caller have not requested 
it to stay silent.  And then the caller could decide on a case-by-case 
basis if to output this message or to ignore the potential failure.

 Currently the test overrides most of gdb_test_multiple's predefined 
patterns by supplying "$gdb_prompt $" (and caller's code is prepended so 
takes precedence).  That may be good enough though as it won't let an EOF 
or "problem internal to GDB" slip through.

> Pedro> So I suggest just removing the dead empty string tests from
> Pedro> gdb_test_multiple, making the non-empty paths unconditional.
> 
> Yes please.

 Erm, they're not dead as I noted, merely inconsistent as only applied 
selectively to some cases, as calling gdb_test_multiple with empty command 
and message both at a time is valid and perhaps useful sometimes.  That's 
not an objection of any kind though, just an observation for the avoidance 
of doubt.

  Maciej


      parent reply	other threads:[~2012-04-27 20:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 22:36 [RFA] MIPS/GDB: Fix the handling of MIPS16 thunks Maciej W. Rozycki
2012-04-11 19:16 ` Richard Sandiford
2012-04-12 13:09   ` Maciej W. Rozycki
2012-04-12 19:39     ` Richard Sandiford
2012-04-13 20:46       ` Maciej W. Rozycki
2012-04-20 14:54 ` Pedro Alves
2012-04-20 16:01   ` Maciej W. Rozycki
2012-04-21 18:55     ` Daniel Jacobowitz
2012-04-26  0:10     ` Maciej W. Rozycki
2012-04-26 13:10       ` Pedro Alves
2012-04-26 17:27         ` Maciej W. Rozycki
2012-04-26 13:23       ` gdb_test_multiple and empty $message Pedro Alves
2012-04-26 13:34         ` Pedro Alves
2012-04-26 14:31         ` Tom Tromey
2012-04-26 14:42           ` Joel Brobecker
2012-04-27 20:23           ` Maciej W. Rozycki [this message]

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=alpine.DEB.1.10.1204272040030.19835@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=rdsandiford@googlemail.com \
    --cc=tromey@redhat.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