Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix PATH error in gdb_file_cmd
Date: Thu, 4 Jun 2020 15:05:06 +0200	[thread overview]
Message-ID: <e4a0f16b-685e-794f-dfda-4a5b97307adb@suse.de> (raw)
In-Reply-To: <1fe127b1-7238-1348-138a-58d8c5fd477d@redhat.com>

On 04-06-2020 14:18, Pedro Alves wrote:
> On 6/4/20 12:51 PM, Tom de Vries wrote:
>> On 04-06-2020 13:43, Pedro Alves wrote:
>>> On 6/4/20 11:24 AM, Tom de Vries wrote:
>>> I have no idea why this one is a fail while everywhere else
>>> in the procedure perror is used.  Seems inconsistent.
>>
>> It is locally inconsistent indeed, but it is consistent with all other
>> handling of "A problem internal to GDB has been detected" in gdb.exp.
> 
> If you look at those other spots, they are using fail/pass in the other
> surrounding -re's, and thus that's just another fail among all those.
> I.e., those cases are internally consistent.  Like e.g.:
> 
> 		    -re "${sentinel}" {
> 			fail "${test} (pattern ${index} + sentinel)"
> 			set ok 0
> 		    }
> 		    -re ".*A problem internal to GDB has been detected" {
> 			fail "${test} (GDB internal error)"
> 			set ok 0
> 			gdb_internal_error_resync
> 		    }
> 		    timeout {
> 			fail "${test} (pattern ${index} + sentinel) (timeout)"
> 			set ok 0
> 		    }
> 
> The gdb_file_cmd one started out with a message string that didn't
> even include the parens around the "GDB internal error" string in 04e7407c59a:
> 
> +       -re "A problem internal to GDB has been detected" {
> +           fail "($arg) GDB internal error"
> +           gdb_internal_error_resync
> +           return -1
> +       }
> 
> The parens were later added in 5b7d00507b9:
> 
>         -re "A problem internal to GDB has been detected" {
> -           fail "($arg) GDB internal error"
> +           fail "($arg) (GDB internal error)"
> 
> Arguably that patch should have switched to perror instead.
> A FAIL message with only text wrapped in parens is odd,
> since the trailing "(foo)" text is not supposed to count as
> test message.  So in effect, you could say that this fail has
> no test message, the same as if you wrote:
> 
>   fail ""

OK, I see your point, I'll prepare a patch for this, so let's settle on
the error message.  How about:
...
-           fail "($arg) (GDB internal error)"
+           perror "Couldn't load $arg into $GDB (GDB internal error)."
...
?

Thanks,
- Tom


  reply	other threads:[~2020-06-04 13:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 10:24 Tom de Vries
2020-06-04 10:45 ` [gdb/testsuite] Fix error handling " Tom de Vries
2020-06-04 11:51   ` Pedro Alves
2020-06-04 14:38     ` Tom de Vries
2020-06-04 11:43 ` [PATCH][gdb/testsuite] Fix PATH error " Pedro Alves
2020-06-04 11:51   ` Tom de Vries
2020-06-04 12:18     ` Pedro Alves
2020-06-04 13:05       ` Tom de Vries [this message]
2020-06-04 13:22         ` Pedro Alves
2020-06-04 14:18           ` [committed][gdb/testsuite] Fix use of fail in gdb_cmd_file Tom de Vries
2020-06-04 15:14             ` [PATCH][gdb/testsuite] Remove path names from error messages in gdb_file_cmd Tom de Vries
2020-06-04 15:27               ` 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=e4a0f16b-685e-794f-dfda-4a5b97307adb@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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