diff options
author | Pedro Alves <palves@redhat.com> | 2018-04-25 17:28:25 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2018-04-25 17:28:25 +0100 |
commit | 249b57335279b1051456884f1a908cdec907f43a (patch) | |
tree | e3e415217119d5da845708bd4b8de2e34debca85 /gdb/testsuite | |
parent | bacd145775e3ca1a9d1a6d0b65c4ba10b307e167 (diff) | |
download | gdb-249b57335279b1051456884f1a908cdec907f43a.zip gdb-249b57335279b1051456884f1a908cdec907f43a.tar.gz gdb-249b57335279b1051456884f1a908cdec907f43a.tar.bz2 |
Fix new inferior events output
Since f67c0c917150 ("Enable 'set print inferior-events' and improve
detach/fork/kill/exit messages"), when detaching a remote process, we
get, for detach against a remote target:
(gdb) detach
Detaching from program: ...., process 5388
Ending remote debugging.
[Inferior 1 (Thread 5388.5388) detached]
^^^^^^^^^^^^^^^^
That is incorrect, for it is printing a thread id as string while we
should be printing the process id instead. I.e., either one of:
[Inferior 1 (process 5388) detached]
[Inferior 1 (Remote target) detached]
depending on remote stub support for the multi-process extensions.
Similarly, after killing a process, we're printing thread ids while we
should be printing process ids. E.g., on native GNU/Linux:
(gdb) k
Kill the program being debugged? (y or n) y
[Inferior 1 (Thread 0x7ffff7faa8c0 (LWP 30721)) has been killed]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
while it should have been:
Kill the program being debugged? (y or n) y
[Inferior 1 (process 30721) has been killed]
^^^^^^^^^^^^^
There's a wording inconsistency between detach and kill:
[Inferior 1 (process 30721) has been killed]
[Inferior 1 (process 30721) detached]
Given we were already saying "detached" instead of "has been
detached", and we used to say just "exited", and given that the "has
been" doesn't really add any information, this commit changes the
message to just "killed":
[Inferior 1 (process 30721) killed]
gdb/ChangeLog:
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.
gdb/testsuite/ChangeLog:
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/hook-stop.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/kill-after-signal.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/kill.exp | 2 |
4 files changed, 10 insertions, 3 deletions
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" } } } |