Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Stan Shebs <stanshebs@earthlink.net>,
	 Marc Khouzam <marc.khouzam@ericsson.com>,
	 Stan Shebs <stan@codesourcery.com>
Subject: Re: [PATCH] No resuming while tfinding
Date: Thu, 18 Mar 2010 13:23:00 -0000	[thread overview]
Message-ID: <201003181323.30014.pedro@codesourcery.com> (raw)
In-Reply-To: <201003181219.11065.pedro@codesourcery.com>

On Thursday 18 March 2010 12:19:11, Pedro Alves wrote:
> Hmm, it seems I missed adding ensure_not_running to those then.  Also, this
> in both until_command and advance_command:
> 
>     if (!target_has_execution)
>       error (_("The program is not running."));
> 
> could be replaced by ERROR_NO_INFERIOR.

This is fixed now with the patch below.  Tested on x86_64-linux and
checked in.

-- 
Pedro Alves

2010-03-18  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* infcmd.c (until_command): Use ERROR_NO_INFERIOR.  Ensure there's
	a valid selected thread, and that it is not running.
	(advance_command): Ditto.
	(finish_command): Ditto.

	gdb/testsuite/
	* gdb.base/default.exp: Adjust.

---
 gdb/infcmd.c                       |   17 +++++++++--------
 gdb/testsuite/gdb.base/default.exp |    6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c	2010-03-18 12:33:16.000000000 +0000
+++ src/gdb/infcmd.c	2010-03-18 13:01:35.000000000 +0000
@@ -1274,10 +1274,10 @@ until_command (char *arg, int from_tty)
 {
   int async_exec = 0;
 
-  if (!target_has_execution)
-    error (_("The program is not running."));
-
+  ERROR_NO_INFERIOR;
   ensure_not_tfind_mode ();
+  ensure_valid_thread ();
+  ensure_not_running ();
 
   /* Find out whether we must run in the background. */
   if (arg != NULL)
@@ -1307,10 +1307,10 @@ advance_command (char *arg, int from_tty
 {
   int async_exec = 0;
 
-  if (!target_has_execution)
-    error (_("The program is not running."));
-
+  ERROR_NO_INFERIOR;
   ensure_not_tfind_mode ();
+  ensure_valid_thread ();
+  ensure_not_running ();
 
   if (arg == NULL)
     error_no_arg (_("a location"));
@@ -1565,7 +1565,10 @@ finish_command (char *arg, int from_tty)
 
   int async_exec = 0;
 
+  ERROR_NO_INFERIOR;
   ensure_not_tfind_mode ();
+  ensure_valid_thread ();
+  ensure_not_running ();
 
   /* Find out whether we must run in the background.  */
   if (arg != NULL)
@@ -1590,8 +1593,6 @@ finish_command (char *arg, int from_tty)
 
   if (arg)
     error (_("The \"finish\" command does not take any arguments."));
-  if (!target_has_execution)
-    error (_("The program is not running."));
 
   frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
   if (frame == 0)
Index: src/gdb/testsuite/gdb.base/default.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/default.exp	2010-03-18 12:56:43.000000000 +0000
+++ src/gdb/testsuite/gdb.base/default.exp	2010-03-18 12:58:07.000000000 +0000
@@ -250,7 +250,7 @@ gdb_expect {
 }
 
 #test finish
-gdb_test "finish" "The program is not running." "finish"
+gdb_test "finish" "The program is not being run." "finish"
 #test forward-search
 # The message here comes from the regexp library, not gdb, and so can
 # vary on different systems.
@@ -753,9 +753,9 @@ gdb_test "tbreak" "No default breakpoint
 #test tty
 gdb_test "tty" "Argument required .filename to set it to\..*" "tty"
 #test until "u" abbreviation
-gdb_test "u" "The program is not running." "until \"u\" abbreviation"
+gdb_test "u" "The program is not being run." "until \"u\" abbreviation"
 #test until
-gdb_test "until" "The program is not running." "until"
+gdb_test "until" "The program is not being run." "until"
 #test undisplay
 # FIXME -- need to dump full output to detailed log
 send_gdb "undisplay\n"


  reply	other threads:[~2010-03-18 13:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  1:59 Stan Shebs
2010-03-17 13:51 ` Marc Khouzam
2010-03-17 15:19 ` Joel Brobecker
2010-03-17 17:36   ` Michael Snyder
2010-03-17 23:40     ` Stan Shebs
2010-03-17 23:44       ` Pedro Alves
2010-03-17 15:22 ` Pedro Alves
2010-03-17 17:31   ` Stan Shebs
2010-03-18  0:59   ` Stan Shebs
2010-03-18 12:19     ` Pedro Alves
2010-03-18 13:23       ` Pedro Alves [this message]
2010-03-18 16:05 ` Tom Tromey
2010-03-18 17:47   ` Stan Shebs

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=201003181323.30014.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.com \
    --cc=stan@codesourcery.com \
    --cc=stanshebs@earthlink.net \
    /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