aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-08-20 21:59:05 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-08-20 21:59:05 +0000
commit0ca9bd1214f3f9c60845f60d958bddc3ae6e0734 (patch)
tree8676a95324fc38571045f4453bba377496b011d6
parent7bece3241145e201fa27cb17a5e5ca599568eb78 (diff)
downloadgdb-0ca9bd1214f3f9c60845f60d958bddc3ae6e0734.zip
gdb-0ca9bd1214f3f9c60845f60d958bddc3ae6e0734.tar.gz
gdb-0ca9bd1214f3f9c60845f60d958bddc3ae6e0734.tar.bz2
* Move KERNEL_U_ADDR from xm-hp300bsd.h to nm-hp300bsd.h and make
it conditionalized on 4.3 vs. 4.4. * config/m68k/nm-hp300bsd.h: Move REGISTER_U_ADDR out of 4.3 and 4.4 sections; it was identical and now works for 4.4.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/config/m68k/nm-hp300bsd.h52
-rw-r--r--gdb/config/m68k/tm-hp300bsd.h19
-rw-r--r--gdb/config/m68k/xm-hp300bsd.h3
4 files changed, 39 insertions, 40 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 303e02c..d80dbc8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
Fri Aug 20 14:01:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ * Move KERNEL_U_ADDR from xm-hp300bsd.h to nm-hp300bsd.h and make
+ it conditionalized on 4.3 vs. 4.4.
+ * config/m68k/nm-hp300bsd.h: Move REGISTER_U_ADDR out of 4.3 and
+ 4.4 sections; it was identical and now works for 4.4.
+
* mips-tdep.c (is_delayed): Use INSN*BRANCH* not ANY_DELAY.
* printcmd.c (MAKEVA_END): Update this version to use "aligner".
diff --git a/gdb/config/m68k/nm-hp300bsd.h b/gdb/config/m68k/nm-hp300bsd.h
index 6ad7f70..b05b388 100644
--- a/gdb/config/m68k/nm-hp300bsd.h
+++ b/gdb/config/m68k/nm-hp300bsd.h
@@ -17,22 +17,20 @@ 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 m68k'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. */
+/* Detect whether this is 4.3 or 4.4. */
#include <errno.h>
#ifdef EPROCUNAVAIL
- /* BSD 4.4 alpha or better */
- /* We can attach to processes using ptrace. */
+/* 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. */
+/* The third argument of ptrace is declared as this type. */
#define PTRACE_ARG3_TYPE caddr_t
@@ -44,32 +42,25 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(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. */
+/* No user structure in 4.4, registers are relative to kernel stack
+ which is fixed. */
+#define KERNEL_U_ADDR 0xFFF00000
+
+/* FIXME: Is ONE_PROCESS_WRITETEXT still true now that the kernel has
+ copy-on-write? It not, move it to the 4.3-specific section below
+ (now it is in xm-hp300bsd.h). */
-#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 BSD 4.3 or something like it. */
+
+/* Get kernel u area address at run-time using BSD style nlist (). */
+#define KERNEL_U_ADDR_BSD
+
+#endif
+
+/* This was once broken for 4.4, but probably because we had the wrong
+ KERNEL_U_ADDR. */
/* 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
@@ -94,4 +85,3 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
else \
addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
}
-#endif
diff --git a/gdb/config/m68k/tm-hp300bsd.h b/gdb/config/m68k/tm-hp300bsd.h
index 9184725..900d7fd 100644
--- a/gdb/config/m68k/tm-hp300bsd.h
+++ b/gdb/config/m68k/tm-hp300bsd.h
@@ -17,11 +17,9 @@ 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. */
-/*
- * Configuration file for HP9000/300 series machine running
- * University of Utah's 4.3bsd port. This is NOT for HP-UX.
- * Problems to hpbsd-bugs@cs.utah.edu
- */
+/* Configuration file for HP9000/300 series machine running BSD,
+ including Utah, Mt. Xinu or Berkeley variants. This is NOT for HP-UX.
+ Problems to hpbsd-bugs@cs.utah.edu. */
#define HAVE_68881
@@ -31,6 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define BPT_VECTOR 0x2
#define TARGET_NBPG 4096
+
+/* For 4.4 this would be 2, but it is OK for us to detect an area a
+ bit bigger than necessary. This way the same gdb binary can target
+ either 4.3 or 4.4. */
+
#define TARGET_UPAGES 3
/* On the HP300, sigtramp is in the u area. Gak! User struct is not
@@ -38,7 +41,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). This tests
for the whole u area, since we don't necessarily have hp300bsd
include files around. */
-#define SIGTRAMP_START STACK_END_ADDR
+
+/* For 4.4, it is actually right 20 bytes *before* STACK_END_ADDR, so
+ include that in the area we test for. */
+
+#define SIGTRAMP_START (STACK_END_ADDR - 20)
#define SIGTRAMP_END (STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG)
/* Address of end of stack space. */
diff --git a/gdb/config/m68k/xm-hp300bsd.h b/gdb/config/m68k/xm-hp300bsd.h
index d5b6703..b4938e9 100644
--- a/gdb/config/m68k/xm-hp300bsd.h
+++ b/gdb/config/m68k/xm-hp300bsd.h
@@ -32,9 +32,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define SET_STACK_LIMIT_HUGE
-/* Get kernel u area address at run-time using BSD style nlist (). */
-#define KERNEL_U_ADDR_BSD
-
/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
#define ONE_PROCESS_WRITETEXT