public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Delete unnecessary code from kill_command
@ 2020-01-10 20:08 Pedro Alves
0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2020-01-10 20:08 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bd420a2dfff64978feb1659d3b77c7601b98463f
commit bd420a2dfff64978feb1659d3b77c7601b98463f
Author: Pedro Alves <palves@redhat.com>
Date: Fri Jan 10 20:05:46 2020 +0000
Delete unnecessary code from kill_command
I believe this comment:
/* Killing off the inferior can leave us with a core file. If
so, print the state we are left in. */
Referred to the fact that a decade ago, by design, GDB would let you
type "run" when debugging a core dump, keeping the core open. That
"run" would push a process_stratum target on the target stack for the
live process, and, the core would remain open -- we used to have a
core_stratum. When the live process was killed/detached or exited,
GDB would go back to debugging the core, since the core_stratum target
was now at the top of the stack. That design had a number of
problems, see here for example:
https://sourceware.org/ml/gdb-patches/2008-08/msg00290.html
In 2010, core_stratum was finaly eliminated and cores now have
process_stratum too, with commit c0edd9edadfe ("Make core files the
process_stratum."). Pushing a live process on the stack while you're
debugging a core discards the core completely.
I also thought that this might be in use with checkpoints, but it does
not -- "kill" when you have multiple checkpoints kills all the
checkpoints.
gdb/ChangeLog:
2020-01-10 Pedro Alves <palves@redhat.com>
* infcmd.c (kill_command): Remove dead code.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/infcmd.c | 14 --------------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ff1bc14..3b5f9aa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2020-01-10 Pedro Alves <palves@redhat.com>
+ * infcmd.c (kill_command): Remove dead code.
+
+2020-01-10 Pedro Alves <palves@redhat.com>
+
* remote.c (remote_target::mourn_inferior): No longer check
whether the target is running.
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index a1f9d4e..aea977f 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2511,20 +2511,6 @@ kill_command (const char *arg, int from_tty)
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
- with their threads. */
- if (!have_inferiors ())
- {
- init_thread_list (); /* Destroy thread info. */
-
- /* Killing off the inferior can leave us with a core file. If
- so, print the state we are left in. */
- if (target_has_stack)
- {
- printf_filtered (_("In %s,\n"), target_longname);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
- }
- }
bfd_cache_close_all ();
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-10 20:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 20:08 [binutils-gdb] Delete unnecessary code from kill_command Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).