From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] regression: Quit should not ask with core (PR 12071)
Date: Wed, 29 Sep 2010 16:44:00 -0000 [thread overview]
Message-ID: <20100929144316.GA16519@host1.dyn.jankratochvil.net> (raw)
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 <jan.kratochvil@redhat.com>
* inferior.c (have_live_inferiors): Test also TO_HAS_EXECUTION.
gdb/testsuite/
2010-09-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* 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.
next reply other threads:[~2010-09-29 14:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-29 16:44 Jan Kratochvil [this message]
2010-09-29 17:00 ` Pedro Alves
2010-09-30 1:56 ` Jan Kratochvil
2010-09-30 14:02 ` Pedro Alves
2010-09-30 14:43 ` Jan Kratochvil
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=20100929144316.GA16519@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
/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