aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-08-18 23:12:40 +0000
committerPedro Alves <palves@redhat.com>2008-08-18 23:12:40 +0000
commit87ab71f0a047c034c71d26d7c4ff4fa2b35b22cd (patch)
tree4c3483ad72a8489f300fe5037298600edca5ee1e /gdb/corelow.c
parent2008-08-18 Pedro Alves <pedro@codesourcery.com> (diff)
downloadbinutils-gdb-87ab71f0a047c034c71d26d7c4ff4fa2b35b22cd.tar.gz
binutils-gdb-87ab71f0a047c034c71d26d7c4ff4fa2b35b22cd.tar.bz2
binutils-gdb-87ab71f0a047c034c71d26d7c4ff4fa2b35b22cd.zip
* corelow.c (core_open): Assume there was no upper layer left
behind from a previous inferior. * target.c (pop_all_targets): Rename to ... (pop_all_targets_above): ... this. Add a target stratum parameter. Use it instead of hardcoding the dummy_stratum. (pop_all_targets): New, defer to pop_all_targets_above. (target_preopen): Use pop_all_targets_above. * target.h (pop_all_targets_above): Declare.
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 7c3a3984279..ce8d6285a18 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -258,7 +258,6 @@ core_open (char *filename, int from_tty)
struct cleanup *old_chain;
char *temp;
bfd *temp_bfd;
- int ontop;
int scratch_chan;
int flags;
@@ -341,7 +340,7 @@ core_open (char *filename, int from_tty)
if (!exec_bfd)
set_gdbarch_from_file (core_bfd);
- ontop = !push_target (&core_ops);
+ push_target (&core_ops);
discard_cleanups (old_chain);
/* This is done first, before anything has a chance to query the
@@ -368,21 +367,12 @@ core_open (char *filename, int from_tty)
bfd_map_over_sections (core_bfd, add_to_thread_list,
bfd_get_section_by_name (core_bfd, ".reg"));
- if (ontop)
- {
- /* Fetch all registers from core file. */
- target_fetch_registers (get_current_regcache (), -1);
+ /* Fetch all registers from core file. */
+ target_fetch_registers (get_current_regcache (), -1);
- /* Now, set up the frame cache, and print the top of stack. */
- reinit_frame_cache ();
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
- }
- else
- {
- warning (
- "you won't be able to access this core file until you terminate\n\
-your %s; do ``info files''", target_longname);
- }
+ /* Now, set up the frame cache, and print the top of stack. */
+ reinit_frame_cache ();
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
}
static void