aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1991-11-12 03:23:32 +0000
committerFred Fish <fnf@specifix.com>1991-11-12 03:23:32 +0000
commitfb182850985cdd243f9e4782e83a141edb5aabdf (patch)
treed9e7250e0e86aa9d1f5f49cbcb24a835d5586c21 /gdb/procfs.c
parent4807bcf9a39f312d6a6b5189122520a666ec35a8 (diff)
downloadgdb-fb182850985cdd243f9e4782e83a141edb5aabdf.zip
gdb-fb182850985cdd243f9e4782e83a141edb5aabdf.tar.gz
gdb-fb182850985cdd243f9e4782e83a141edb5aabdf.tar.bz2
Minor rewording of message containing name of program that generated a
core file (core.c), permanently remove the register_addr() stub (elfread.c), move a misplaced #endif (procfs.c), and add fetch_core_registers func for core file support (procfs.c).
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c63
1 files changed, 62 insertions, 1 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index a277369..c745997 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -634,6 +634,8 @@ DEFUN(detach, (signal),
attach_flag = 0;
}
+#endif /* ATTACH_DETACH */
+
/*
GLOBAL FUNCTION
@@ -873,7 +875,66 @@ DEFUN_VOID(fetch_inferior_registers)
#endif
}
-#endif /* ATTACH_DETACH */
+/*
+
+GLOBAL FUNCTION
+
+ fetch_core_registers -- fetch current registers from core file data
+
+SYNOPSIS
+
+ void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which)
+
+DESCRIPTION
+
+ Read the values of either the general register set (WHICH equals 0)
+ or the floating point register set (WHICH equals 2) from the core
+ file data (pointed to by CORE_REG_SECT), and update gdb's idea of
+ their current values. The CORE_REG_SIZE parameter is ignored.
+
+NOTES
+
+ Use the indicated sizes to validate the gregset and fpregset
+ structures.
+*/
+
+void
+fetch_core_registers (core_reg_sect, core_reg_size, which)
+ char *core_reg_sect;
+ unsigned core_reg_size;
+ int which;
+{
+
+ if (which == 0)
+ {
+ if (core_reg_size != sizeof (pi.gregset))
+ {
+ warning ("wrong size gregset struct in core file");
+ }
+ else
+ {
+ (void) memcpy ((char *) &pi.gregset, core_reg_sect,
+ sizeof (pi.gregset));
+ supply_gregset (&pi.gregset);
+ }
+ }
+ else if (which == 2)
+ {
+ if (core_reg_size != sizeof (pi.fpregset))
+ {
+ warning ("wrong size fpregset struct in core file");
+ }
+ else
+ {
+ (void) memcpy ((char *) &pi.fpregset, core_reg_sect,
+ sizeof (pi.fpregset));
+#if defined (FP0_REGNUM)
+ supply_fpregset (&pi.fpregset);
+#endif
+ }
+ }
+}
/*