* inferior.h (read_sp): Remove prototype.
[deliverable/binutils-gdb.git] / gdb / corelow.c
index f38934e2d4ecd55fc4f23fb0e9d0885dd8ec2f1a..7be9655f8b31d52045e0577661023cd106a0f3f5 100644 (file)
@@ -82,7 +82,7 @@ static void core_close (int);
 
 static void core_close_cleanup (void *ignore);
 
-static void get_core_registers (int);
+static void get_core_registers (struct regcache *, int);
 
 static void add_to_thread_list (bfd *, asection *, void *);
 
@@ -375,7 +375,7 @@ core_open (char *filename, int from_tty)
   if (ontop)
     {
       /* Fetch all registers from core file.  */
-      target_fetch_registers (-1);
+      target_fetch_registers (current_regcache, -1);
 
       /* Now, set up the frame cache, and print the top of stack.  */
       reinit_frame_cache ();
@@ -483,9 +483,9 @@ get_core_register_section (struct regcache *regcache,
 /* We just get all the registers, so we don't use regno.  */
 
 static void
-get_core_registers (int regno)
+get_core_registers (struct regcache *regcache, int regno)
 {
-  int status;
+  int i;
 
   if (!(core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch))
       && (core_vec == NULL || core_vec->core_read_registers == NULL))
@@ -495,14 +495,17 @@ get_core_registers (int regno)
       return;
     }
 
-  get_core_register_section (current_regcache,
+  get_core_register_section (regcache,
                             ".reg", 0, "general-purpose", 1);
-  get_core_register_section (current_regcache,
+  get_core_register_section (regcache,
                             ".reg2", 2, "floating-point", 0);
-  get_core_register_section (current_regcache,
+  get_core_register_section (regcache,
                             ".reg-xfp", 3, "extended floating-point", 0);
 
-  deprecated_registers_fetched ();
+  /* Supply dummy value for all registers not found in the core.  */
+  for (i = 0; i < NUM_REGS; i++)
+    if (!regcache_valid_p (regcache, i))
+      regcache_raw_supply (regcache, i, NULL);
 }
 
 static void
This page took 0.023533 seconds and 4 git commands to generate.