* macrotab.h: Do not include "obstack.h" or "bcache.h".
[deliverable/binutils-gdb.git] / gdb / corelow.c
index 59318b179a6a9ad1df5777f8fa06cdf66ec20a33..785b8e1432348d875c1c14d2a0a4210b7b86ca10 100644 (file)
@@ -169,10 +169,10 @@ gdb_check_format (bfd *abfd)
     {
       if (cf->check_format (abfd))
        {
-         return (true);
+         return (1);
        }
     }
-  return (false);
+  return (0);
 }
 
 /* Discard all vestiges of any previous core file and mark data and stack
@@ -321,7 +321,12 @@ core_open (char *filename, int from_tty)
     error ("\"%s\": Can't find sections: %s",
           bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
 
-  set_gdbarch_from_file (core_bfd);
+  /* If we have no exec file, try to set the architecture from the
+     core file.  We don't do this unconditionally since an exec file
+     typically contains more information that helps us determine the
+     architecture than a core file.  */
+  if (!exec_bfd)
+    set_gdbarch_from_file (core_bfd);
 
   ontop = !push_target (&core_ops);
   discard_cleanups (old_chain);
@@ -358,8 +363,9 @@ core_open (char *filename, int from_tty)
 
       /* Now, set up the frame cache, and print the top of stack.  */
       flush_cached_frames ();
-      select_frame (get_current_frame (), 0);
-      print_stack_frame (selected_frame, selected_frame_level, 1);
+      select_frame (get_current_frame ());
+      print_stack_frame (selected_frame,
+                        frame_relative_level (selected_frame), 1);
     }
   else
     {
This page took 0.023915 seconds and 4 git commands to generate.