aboutsummaryrefslogtreecommitdiff
path: root/gdb/alpha-nat.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1995-01-12 18:12:04 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1995-01-12 18:12:04 +0000
commit2592eef89b7f3a9fca571688566e2bc9dc7c1d6a (patch)
tree7ec582bf7cfeb80c49c8e58a9d22295823788a2f /gdb/alpha-nat.c
parent3074a46dbfa968ae2e77211df8142fe9c1f78e2b (diff)
downloadgdb-2592eef89b7f3a9fca571688566e2bc9dc7c1d6a.zip
gdb-2592eef89b7f3a9fca571688566e2bc9dc7c1d6a.tar.gz
gdb-2592eef89b7f3a9fca571688566e2bc9dc7c1d6a.tar.bz2
* README: Add note about SPARCworks cc release 3.0 and higher.
Add procfs support for Alpha OSF/1-2.x. * config/alpha/nm-osf.h: Renamed from nm-alpha.h, generic OSF/1 native support. * config/alpha/alpha-osf1.mh (NAT_FILE): Changed accordingly. (MUNCH_DEFINE): Removed. * config/alpha/alpha-osf2.mh, config/alpha/nm-osf2.h: New files for procfs support. * configure.in (alpha-dec-osf*): Use alpha-osf2.mh for OSF/1 release 2.x and higher, else alpha-osf1.mh, as the procfs support in release 1.x is incomplete. * Makefile.in (ALLCONFIG): Add config/alpha/alpha-osf2.mh. * alpha-nat.c (supply_gregset, fill_gregset, supply_fpgregset, fill_fpgregset): New routines for procfs support. * inftarg.c (_initialize_inftarg): Don't add ptrace support if we have an optional procfs and /proc is accessible. * procfs.c: Include sys/fault.h and sys/syscall.h before including sys/procfs.h. (unconditionally_kill_inferior): If PROCFS_NEED_PIOCSSIG_FOR_KILL is defined, additionally perform a PIOCSSIG to really terminate the inferior. (create_procinfo): Always return a result. (create_procinfo, do_attach): Don't trace T_IFAULT faults if PROCFS_DONT_TRACE_IFAULT is defined. (procfs_init_inferior): Use START_INFERIOR_TRAPS_EXPECTED as argument to startup_inferior if it is defined. (proc_set_exec_trap): If PIOCSSPCACT is defined, use it instead of tracing exits from exec system calls. Needed for the user level loader under Alpha OSF/1. (do_detach): Clear any pending signal if we want to detach from a process without a signal. (set_proc_siginfo): If PROCFS_DONT_PIOCSSIG_CURSIG is defined, don't issue a PIOCSSIG if pr_cursig already contains the signal we intend to set. (info_proc_signals): If PROCFS_SIGPEND_OFFSET is defined, the pending signals are numbered from 1 instead of 0. (info_proc_mappings): Increase size of output format for addresses if BFD_HOST_64_BIT is defined. (procfs_stop): Renamed from child_stop. (_initialize_procfs): Don't add procfs support if we have an optional procfs and /proc is not accessible.
Diffstat (limited to 'gdb/alpha-nat.c')
-rw-r--r--gdb/alpha-nat.c73
1 files changed, 72 insertions, 1 deletions
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index a0c5399..4d91fe8 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -1,5 +1,5 @@
/* Low level Alpha interface, for GDB when running native.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1995 Free Software Foundation, Inc.
This file is part of GDB.
@@ -142,3 +142,74 @@ register_addr (regno, blockend)
{
return REGISTER_PTRACE_ADDR (regno);
}
+
+#ifdef USE_PROC_FS
+#include <sys/procfs.h>
+
+/*
+ * See the comment in m68k-tdep.c regarding the utility of these functions.
+ */
+
+void
+supply_gregset (gregsetp)
+ gregset_t *gregsetp;
+{
+ register int regi;
+ register long *regp = gregsetp->regs;
+
+ for (regi = 0; regi < 31; regi++)
+ supply_register (regi, (char *)(regp + regi));
+
+ supply_register (PC_REGNUM, (char *)(regp + 31));
+}
+
+void
+fill_gregset (gregsetp, regno)
+ gregset_t *gregsetp;
+ int regno;
+{
+ int regi;
+ register long *regp = gregsetp->regs;
+
+ for (regi = 0; regi < 31; regi++)
+ if ((regno == -1) || (regno == regi))
+ *(regp + regi) = *(long *) &registers[REGISTER_BYTE (regi)];
+
+ if ((regno == -1) || (regno == PC_REGNUM))
+ *(regp + 31) = *(long *) &registers[REGISTER_BYTE (PC_REGNUM)];
+}
+
+/*
+ * Now we do the same thing for floating-point registers.
+ * Again, see the comments in m68k-tdep.c.
+ */
+
+void
+supply_fpregset (fpregsetp)
+ fpregset_t *fpregsetp;
+{
+ register int regi;
+ register long *regp = fpregsetp->regs;
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (regi + FP0_REGNUM, (char *)(regp + regi));
+}
+
+void
+fill_fpregset (fpregsetp, regno)
+ fpregset_t *fpregsetp;
+ int regno;
+{
+ int regi;
+ register long *regp = fpregsetp->regs;
+
+ for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
+ {
+ if ((regno == -1) || (regno == regi))
+ {
+ *(regp + regi - FP0_REGNUM) =
+ *(long *) &registers[REGISTER_BYTE (regi)];
+ }
+ }
+}
+#endif