From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27316 invoked by alias); 18 Mar 2010 13:23:41 -0000 Received: (qmail 27307 invoked by uid 22791); 18 Mar 2010 13:23:40 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 13:23:35 +0000 Received: (qmail 9207 invoked from network); 18 Mar 2010 13:23:33 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Mar 2010 13:23:33 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] No resuming while tfinding Date: Thu, 18 Mar 2010 13:23:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: Stan Shebs , Marc Khouzam , Stan Shebs References: <4BA0377C.1040000@codesourcery.com> <4BA17AF9.9030107@earthlink.net> <201003181219.11065.pedro@codesourcery.com> In-Reply-To: <201003181219.11065.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003181323.30014.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00658.txt.bz2 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 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"