From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] More suggestive error_is_running message
Date: Wed, 11 Apr 2012 15:35:00 -0000 [thread overview]
Message-ID: <20120411152531.GD2852@adacore.com> (raw)
In-Reply-To: <20120410191907.GA31331@host2.jankratochvil.net>
> gdb/
> 2012-04-10 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Provide more specific error_is_running error message.
> * infrun.c (error_is_running): Extend the error message text.
>
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -3038,7 +3045,9 @@ void
> error_is_running (void)
> {
> error (_("Cannot execute this command while "
> - "the selected thread is running."));
> + "the selected thread is running. "
> + "(You may want to use 'interrupt' "
> + "and wait for '[Thread N] #1 stopped.'.)"));
> }
Just my two cents on this, I don't really have a strong opinion.
I'd put the new output on a second line, and also avoid duplicating
the actual notification. That way, if we change its format, it doesn't
become inconsistent. There's also the case of being in GDB/MI mode, as
well as the case where the ptid is displayed differently on non-Linux
platforms. Similarly, I think we want to avoid the "interrupt" command
name, because I suspect that many users will be using a graphical
frontend and that's not going to be very helpful to them.
Trying to come up with a concise error message, I couldn't really
find something all that great. I think that it's OK to drop the part
that talks about waiting for the stop notification. Once you've used
it once, you'll know, and for the first time, even if you are fast
enough to send the interrupt and emit the command again before the
thread stopped, you'll get the same message, followed by the stop
notification. That should be enough to understand that you had to wait?
So how about:
Cannot execute this command while the selected thread is running.
You need to interrupt this thread's execution first.
?
--
Joel
next prev parent reply other threads:[~2012-04-11 15:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 19:20 Jan Kratochvil
2012-04-10 21:30 ` Sergio Durigan Junior
2012-04-11 2:16 ` Jan Kratochvil
2012-04-11 4:55 ` Sergio Durigan Junior
2012-04-12 15:28 ` Tom Tromey
2012-04-11 15:35 ` Joel Brobecker [this message]
2012-04-11 15:48 ` [cancel] " Jan Kratochvil
2012-04-11 17:17 ` Joel Brobecker
2012-04-17 21:26 ` Jan Kratochvil
2012-04-17 23:01 ` Joel Brobecker
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=20120411152531.GD2852@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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