aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/infcmd.c7
-rw-r--r--gdb/remote.c4
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/hook-stop.exp2
-rw-r--r--gdb/testsuite/gdb.base/kill-after-signal.exp2
-rw-r--r--gdb/testsuite/gdb.threads/kill.exp2
7 files changed, 26 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2cd21ed..a5cb3bb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2018-04-25 Pedro Alves <palves@redhat.com>
+
+ * infcmd.c (kill_command): Print the pid as string, not the whole
+ thread's ptid. Add comment. s/has been killed/killed/ in output
+ message.
+ * remote.c (remote_detach_1): Print the pid as string, not the
+ whole thread's ptid.
+
2018-04-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 6c9f885..21772b6 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2596,13 +2596,16 @@ kill_command (const char *arg, int from_tty)
if (!query (_("Kill the program being debugged? ")))
error (_("Not confirmed."));
- std::string pid_str = target_pid_to_str (inferior_ptid);
+ int pid = current_inferior ()->pid;
+ /* Save the pid as a string before killing the inferior, since that
+ may unpush the current target, and we need the string after. */
+ std::string pid_str = target_pid_to_str (pid_to_ptid (pid));
int infnum = current_inferior ()->num;
target_kill ();
if (print_inferior_events)
- printf_unfiltered (_("[Inferior %d (%s) has been killed]\n"),
+ printf_unfiltered (_("[Inferior %d (%s) killed]\n"),
infnum, pid_str.c_str ());
/* If we still have other inferiors to debug, then don't mess with
diff --git a/gdb/remote.c b/gdb/remote.c
index 61d1dcb..193037b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5138,7 +5138,9 @@ remote_detach_1 (int from_tty, inferior *inf)
breakpoints that should be available for the followed inferior. */
if (!is_fork_parent)
{
- std::string infpid = target_pid_to_str (inferior_ptid);
+ /* Save the pid as a string before mourning, since that will
+ unpush the remote target, and we need the string after. */
+ std::string infpid = target_pid_to_str (pid_to_ptid (pid));
target_mourn_inferior (inferior_ptid);
if (print_inferior_events)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 19735fc..9ee7606 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2018-04-25 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/hook-stop.exp: Expect "killed" instead of "has been
+ killed".
+ * gdb.base/kill-after-signal.exp: Likewise.
+ * gdb.threads/kill.exp: Likewise.
+
2018-04-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
diff --git a/gdb/testsuite/gdb.base/hook-stop.exp b/gdb/testsuite/gdb.base/hook-stop.exp
index 5717f94..b3f4084 100644
--- a/gdb/testsuite/gdb.base/hook-stop.exp
+++ b/gdb/testsuite/gdb.base/hook-stop.exp
@@ -86,7 +86,7 @@ proc hook_stop_kill {} {
set test "run hook-stop"
gdb_test_multiple "continue" "$test" {
- -re "Continuing.\r\n\\\[Inferior $decimal \\(.*\\) has been killed\\\]\r\n${gdb_prompt} $" {
+ -re "Continuing.\r\n\\\[Inferior $decimal \\(.*\\) killed\\\]\r\n${gdb_prompt} $" {
pass $test
}
}
diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
index 67e6f62..8830d49 100644
--- a/gdb/testsuite/gdb.base/kill-after-signal.exp
+++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
@@ -39,6 +39,6 @@ gdb_test "continue" "Program received signal SIGUSR1, .*"
gdb_test "stepi" "\r\nhandler .*"
gdb_test_multiple "kill" "kill" {
-re "Kill the program being debugged\\? \\(y or n\\) $" {
- gdb_test "y" "\\\[Inferior $decimal \\(.*\\) has been killed\\\]" "kill"
+ gdb_test "y" "\\\[Inferior $decimal \\(.*\\) killed\\\]" "kill"
}
}
diff --git a/gdb/testsuite/gdb.threads/kill.exp b/gdb/testsuite/gdb.threads/kill.exp
index aea4a98..82f221e 100644
--- a/gdb/testsuite/gdb.threads/kill.exp
+++ b/gdb/testsuite/gdb.threads/kill.exp
@@ -70,7 +70,7 @@ proc test {threaded} {
gdb_test_multiple "kill" "kill" {
-re "Kill the program being debugged\\? \\(y or n\\) $" {
- gdb_test "y" "\\\[Inferior $decimal \\(.*\\) has been killed\\\]" "kill"
+ gdb_test "y" "\\\[Inferior $decimal \\(.*\\) killed\\\]" "kill"
}
}
}