From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14877 invoked by alias); 29 Sep 2010 14:43:33 -0000 Received: (qmail 14861 invoked by uid 22791); 29 Sep 2010 14:43:32 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Sep 2010 14:43:21 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8TEhJva022643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Sep 2010 10:43:19 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8TEhH8T010561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Sep 2010 10:43:19 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o8TEhH6N017355 for ; Wed, 29 Sep 2010 16:43:17 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o8TEhGTF017354 for gdb-patches@sourceware.org; Wed, 29 Sep 2010 16:43:16 +0200 Date: Wed, 29 Sep 2010 16:44:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] regression: Quit should not ask with core (PR 12071) Message-ID: <20100929144316.GA16519@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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-09/txt/msg00488.txt.bz2 Hi, my former patch Make core files the process_stratum. commit aa2614659d7863f1afe4da2251312f7da9236ea5 http://sourceware.org/ml/gdb-cvs/2010-07/msg00107.html has a regression as it asks while it did not in GDB-7.2: Regression: just a core file started to ask on quit http://sourceware.org/bugzilla/show_bug.cgi?id=12071 ./gdb -nx -c core -ex q -> A debugging session is active. Inferior 1 [process 27943] will be killed. Quit anyway? (y or n) _ No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu. Thanks, Jan gdb/ 2010-09-29 Jan Kratochvil * inferior.c (have_live_inferiors): Test also TO_HAS_EXECUTION. gdb/testsuite/ 2010-09-29 Jan Kratochvil * gdb.base/corefile.exp (quit with a process, no question: load core) (quit with a core file): New tests. --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -467,7 +467,7 @@ have_live_inferiors (void) multiple target interfaces. */ if (have_inferiors ()) for (t = current_target.beneath; t != NULL; t = t->beneath) - if (t->to_stratum == process_stratum) + if (t->to_stratum == process_stratum && t->to_has_execution (t)) return 1; return 0; --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -201,8 +201,33 @@ gdb_test_multiple "info files" $test { } } +set test "quit with a process" +gdb_test_multiple "quit" $test { + -re "A debugging session is active.\r\n.*\r\nQuit anyway\\? \\(y or n\\) $" { + pass $test + gdb_test "n" {Not confirmed\.} "quit with processes: n" + } +} + gdb_exit +# Verify there is no question if only a core file is loaded. + +gdb_start +gdb_test "core-file $corefile" "Core was generated by .*" "no question: load core" + +set test "quit with a core file" +gdb_test_multiple "quit" $test { + -re "A debugging session is active.\r\n.*\r\nQuit anyway\\? \\(y or n\\) $" { + fail $test + gdb_test "n" {Not confirmed\.} "quit with processes: n" + } + eof { + pass $test + } +} + +gdb_exit # Test an attach command will clear any loaded core file.