aboutsummaryrefslogtreecommitdiff
path: root/gdb/nm-hp300bsd.h
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1993-02-19 06:55:31 +0000
committerJohn Gilmore <gnu@cygnus>1993-02-19 06:55:31 +0000
commit5e3d0ab075496938efe61a15c129f7464464d083 (patch)
tree9c091896b2c182a4660d8d8d4cfb813c9de4a214 /gdb/nm-hp300bsd.h
parentb9163d1aaa910ee7b98ce1180742cb065e085c15 (diff)
downloadgdb-5e3d0ab075496938efe61a15c129f7464464d083.zip
gdb-5e3d0ab075496938efe61a15c129f7464464d083.tar.gz
gdb-5e3d0ab075496938efe61a15c129f7464464d083.tar.bz2
* gcc.patch: Update for a different GCC (G++) bug.
* main.c (print_gdb_version): Update copyright year to 1993. * nm-hp300bsd.h: Decide whether this is BSD 4.3 or 4.4, conditionalize this file on it. FIXME, right way is to split these into two config files. (ATTACH_DETACH): Define for BSD 4.4 (PTRACE_ARG_TYPE): caddr_t for BSD 4.4, unset for 4.3. (U_REGS_OFFSET): Revise for 4.4. (REGISTER_U_ADDR): Separate for 4.4, but it doesn't work yet. * xm-hp300bsd.h: Move definitions of UINT_MAX, INT_MAX, INT_MIN, LONG_MAX into this file to avoid cpp "redefinition" warnings.
Diffstat (limited to 'gdb/nm-hp300bsd.h')
-rw-r--r--gdb/nm-hp300bsd.h74
1 files changed, 54 insertions, 20 deletions
diff --git a/gdb/nm-hp300bsd.h b/gdb/nm-hp300bsd.h
index 6a8cda7..3531842 100644
--- a/gdb/nm-hp300bsd.h
+++ b/gdb/nm-hp300bsd.h
@@ -17,6 +17,60 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* This is a hack. This is only a hack. Were this a common source file,
+ rather than a config file specific to BSD on HP 68k's, you would have
+ been instructed to clean this up. As it is, clean it up if FSF's
+ HP's-running-ancient-BSD ever go away. */
+
+#include <errno.h>
+#ifdef EPROCUNAVAIL
+ /* BSD 4.4 alpha or better */
+
+ /* We can attach to processes using ptrace. */
+
+#define ATTACH_DETACH
+#define PTRACE_ATTACH 10
+#define PTRACE_DETACH 11
+
+ /* The third argument of ptrace is declared as this type. */
+
+#define PTRACE_ARG3_TYPE caddr_t
+
+/* U_REGS_OFFSET is the offset of the registers within the u area for
+ ptrace purposes. */
+#define U_REGS_OFFSET \
+ ptrace (PT_READ_U, inferior_pid, \
+ (PTRACE_ARG3_TYPE) \
+ (offsetof (struct user, u_kproc.kp_proc.p_md.md_regs)), 0) \
+ - USRSTACK
+
+ /* This is a piece of magic that is given a register number REGNO
+ and as BLOCKEND the address in the system of the end of the user structure
+ and stores in ADDR the address in the kernel or core dump
+ of that register. */
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ \
+ if (regno < PS_REGNUM) \
+ addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \
+ else if (regno == PS_REGNUM) \
+ addr = (int) &((struct frame *)(blockend))->f_stackadj; \
+ else if (regno == PC_REGNUM) \
+ addr = (int) &((struct frame *)(blockend))->f_pc; \
+ else if (regno < FPC_REGNUM) \
+ addr = (int) \
+ &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\
+ else if (regno == FPC_REGNUM) \
+ addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \
+ else if (regno == FPS_REGNUM) \
+ addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \
+ else \
+ addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
+}
+#else
+
+/* THIS IS BSD 4.3 or something like it. */
+
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
@@ -40,24 +94,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
else \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
}
-
-/* This is a hack. This is only a hack. Were this a common source file,
- rather than a config file specific to BSD on HP 68k's, you would have
- been instructed to clean this up. As it is, clean it up if FSF's
- HP's-running-ancient-BSD ever go away. */
-
-#include <errno.h>
-#ifdef EPROCUNAVAIL
- /* BSD 4.4 alpha or better */
-
- /* We can attach to processes using ptrace. */
-
-#define ATTACH_DETACH
-#define PTRACE_ATTACH 10
-#define PTRACE_DETACH 11
-
- /* The third argument of ptrace is declared as this type. */
-
-#define PTRACE_ARG3_TYPE caddr_t
#endif
-