gas: fix a few omissions in .cfi_label handling
[deliverable/binutils-gdb.git] / gdb / corelow.c
index 42af7f44753dd4309bc07cd3a122ccca38888fba..c7d4318e0014b61354752381758e6e5a4dcfb760 100644 (file)
@@ -1,6 +1,6 @@
 /* Core dump and executable file functions below target vector, for GDB.
 
-   Copyright (C) 1986-2014 Free Software Foundation, Inc.
+   Copyright (C) 1986-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,7 +38,6 @@
 #include "symfile.h"
 #include "exec.h"
 #include "readline/readline.h"
-#include "exceptions.h"
 #include "solib.h"
 #include "filenames.h"
 #include "progspace.h"
@@ -134,9 +133,7 @@ sniff_core_bfd (bfd *abfd)
 
   /* Don't sniff if we have support for register sets in
      CORE_GDBARCH.  */
-  if (core_gdbarch
-      && (gdbarch_iterate_over_regset_sections_p (core_gdbarch)
-         || gdbarch_regset_from_core_section_p (core_gdbarch)))
+  if (core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch))
     return NULL;
 
   for (cf = core_file_fns; cf != NULL; cf = cf->next)
@@ -416,7 +413,7 @@ core_open (const char *arg, int from_tty)
      sections.  */
   TRY_CATCH (except, RETURN_MASK_ERROR)
     {
-      target_find_new_threads ();
+      target_update_thread_list ();
     }
 
   if (except.reason < 0)
@@ -459,6 +456,19 @@ core_open (const char *arg, int from_tty)
   /* 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, 1);
+
+  /* Current thread should be NUM 1 but the user does not know that.
+     If a program is single threaded gdb in general does not mention
+     anything about threads.  That is why the test is >= 2.  */
+  if (thread_count () >= 2)
+    {
+      TRY_CATCH (except, RETURN_MASK_ERROR)
+       {
+         thread_command (NULL, from_tty);
+       }
+      if (except.reason < 0)
+       exception_print (gdb_stderr, except);
+    }
 }
 
 static void
@@ -526,6 +536,11 @@ get_core_register_section (struct regcache *regcache,
       warning (_("Section `%s' in core file too small."), section_name);
       return;
     }
+  if (size != min_size && !(regset->flags & REGSET_VARIABLE_SIZE))
+    {
+      warning (_("Unexpected size of section `%s' in core file."),
+              section_name);
+    }
 
   contents = alloca (size);
   if (! bfd_get_section_contents (core_bfd, section, contents,
@@ -536,20 +551,6 @@ get_core_register_section (struct regcache *regcache,
       return;
     }
 
-  if (regset == NULL
-      && core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch))
-    {
-      regset = gdbarch_regset_from_core_section (core_gdbarch,
-                                                name, size);
-      if (regset == NULL)
-       {
-         if (required)
-           warning (_("Couldn't recognize %s registers in core file."),
-                    human_name);
-         return;
-       }
-    }
-
   if (regset != NULL)
     {
       regset->supply_regset (regset, regcache, -1, contents, size);
@@ -605,9 +606,7 @@ get_core_registers (struct target_ops *ops,
   int i;
   struct gdbarch *gdbarch;
 
-  if (!(core_gdbarch
-       && (gdbarch_iterate_over_regset_sections_p (core_gdbarch)
-           || gdbarch_regset_from_core_section_p (core_gdbarch)))
+  if (!(core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch))
       && (core_vec == NULL || core_vec->core_read_registers == NULL))
     {
       fprintf_filtered (gdb_stderr,
@@ -973,7 +972,7 @@ core_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
   /* Otherwise, this isn't a "threaded" core -- use the PID field, but
      only if it isn't a fake PID.  */
-  inf = find_inferior_pid (ptid_get_pid (ptid));
+  inf = find_inferior_ptid (ptid);
   if (inf != NULL && !inf->fake_pid_p)
     return normal_pid_to_str (ptid);
 
This page took 0.025122 seconds and 4 git commands to generate.