aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-11-12 18:59:43 +0000
committerStu Grossman <grossman@cygnus>1993-11-12 18:59:43 +0000
commit9a13e99e206b8c400f1ea65869f90b8500731c4c (patch)
tree8b4ffcf0204742c7106f91b62fc6da3395a1c841 /gdb/config
parent115f743028a080c89c7201a2d31a7ba61c5259b1 (diff)
downloadgdb-9a13e99e206b8c400f1ea65869f90b8500731c4c.zip
gdb-9a13e99e206b8c400f1ea65869f90b8500731c4c.tar.gz
gdb-9a13e99e206b8c400f1ea65869f90b8500731c4c.tar.bz2
* coff-solib.c (coff_solib_add): Cast result of alloca().
* m68k-tdep.c (m68k_saved_pc_after_call): Get rid of GDB_TARGET_IS_SUN3. Use more general SYSCALL_TRAP macro. * config/m68k/m68klynx.mh (NATDEPFILES): Remove exec.o (it's already in TDEPFILES). * config/m68k/tm-m68k.h (SAVED_PC_AFTER_CALL): Use m68k_saved_pc_after_call. * Remove all Sun3 specific stuff. * (FIX_CALL_DUMMY): Cast arg to bfd_putb32 to unsigned char *. * config/m68k/tm-m68klynx.h: Define SYSCALL_TRAP as trap #10. Disable REMOTE_BREAKPOINT mechanism. * config/m68k/tm-sun3.h: Get rid of GDB_TARGET_IS_SUN3. * Protect from multiple includion. * Move Sun3 specific stuff from tm-m68k.h to here. * Define SYSCALL_TRAP as trap #0. * Remove def of SAVED_PC_AFTER_CALL (now in tm-m68k.h). * gdbserver/low-lynx.c: Redo all register store/fetch stuff to make it portable for 386 and 68k.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/m68k/m68klynx.mh2
-rw-r--r--gdb/config/m68k/tm-m68k.h45
-rw-r--r--gdb/config/m68k/tm-m68klynx.h9
-rw-r--r--gdb/config/m68k/tm-sun3.h39
4 files changed, 58 insertions, 37 deletions
diff --git a/gdb/config/m68k/m68klynx.mh b/gdb/config/m68k/m68klynx.mh
index 4d80b0b..4f2922c 100644
--- a/gdb/config/m68k/m68klynx.mh
+++ b/gdb/config/m68k/m68klynx.mh
@@ -2,7 +2,7 @@
XM_FILE= xm-m68klynx.h
XDEPFILES=
NAT_FILE= nm-m68klynx.h
-NATDEPFILES= exec.o infptrace.o inftarg.o fork-child.o corelow.o m68kly-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o m68kly-nat.o
REGEX=regex.o
REGEX1=regex.o
GDBSERVER_LIBS= -lbsd
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index 0f4a165..7a8c52a 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -42,8 +42,14 @@ extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip));
the new frame is not set up until the new function executes
some instructions. */
+#ifdef __STDC__
+struct frame_info;
+#endif
+
+extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
+
#define SAVED_PC_AFTER_CALL(frame) \
-read_memory_integer (read_register (SP_REGNUM), 4)
+ m68k_saved_pc_after_call(frame)
/* Stack grows downward. */
@@ -88,29 +94,22 @@ read_memory_integer (read_register (SP_REGNUM), 4)
#define REGISTER_TYPE long
-#define REGISTER_BYTES_SUN3 (16*4 + 8 + 8*12 + 3*4 + 4)
#define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
#define REGISTER_BYTES_NOFP (16*4 + 8)
-#if defined (GDB_TARGET_IS_SUN3)
- /* Sun3 status includes fpflags, which shows whether the FPU has been used
- by the process, and whether the FPU was done with an instruction or
- was interrupted in the middle of a long instruction. See
- <machine/reg.h>. */
- /* a&d, pc,sr, fp, fpstat, fpflags */
-# define NUM_REGS 31
-# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
-# define REGISTER_BYTES_OK(b) \
- ((b) == REGISTER_BYTES_SUN3 \
- || (b) == REGISTER_BYTES_FP \
- || (b) == REGISTER_BYTES_NOFP)
-#else /* Not sun3. */
-# define NUM_REGS 29
-# define REGISTER_BYTES_OK(b) \
- ((b) == REGISTER_BYTES_FP \
- || (b) == REGISTER_BYTES_NOFP)
-# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4)
-#endif /* Not sun3. */
+#ifndef NUM_REGS
+#define NUM_REGS 29
+#endif
+
+#ifndef REGISTER_BYTES_OK
+#define REGISTER_BYTES_OK(b) \
+ ((b) == REGISTER_BYTES_FP \
+ || (b) == REGISTER_BYTES_NOFP)
+#endif
+
+#ifndef REGISTER_BYTES
+#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4)
+#endif
/* Index within `registers' of the first byte of the space for
register N. */
@@ -360,8 +359,8 @@ extern const struct ext_format ext_format_68881;
We use the BFD routines to store a big-endian value of known size. */
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ bfd_putb32 (fun, (char *) dummyname + CALL_DUMMY_START_OFFSET + 2); \
- bfd_putb32 (nargs*4, (char *) dummyname + CALL_DUMMY_START_OFFSET + 8); }
+{ bfd_putb32 (fun, (unsigned char *) dummyname + CALL_DUMMY_START_OFFSET + 2); \
+ bfd_putb32 (nargs*4, (unsigned char *) dummyname + CALL_DUMMY_START_OFFSET + 8); }
/* Push an empty stack frame, to record the current PC, etc. */
diff --git a/gdb/config/m68k/tm-m68klynx.h b/gdb/config/m68k/tm-m68klynx.h
index 4fc71a5..a13c4b6 100644
--- a/gdb/config/m68k/tm-m68klynx.h
+++ b/gdb/config/m68k/tm-m68klynx.h
@@ -20,10 +20,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef TM_M68KLYNX_H
#define TM_M68KLYNX_H
+/* If PC-2 contains this instruction, then we know what we are in a system
+ call stub, and the return PC is is at SP+4, instead of SP. */
+
+#define SYSCALL_TRAP 0x4e4a /* trap #10 */
+#define SYSCALL_TRAP_OFFSET 2 /* PC is after trap instruction */
+
/* Use the generic 68k definitions. */
#include "m68k/tm-m68k.h"
+/* Disable dumbshit alternate breakpoint mechanism needed by 68k stub. */
+#undef REMOTE_BREAKPOINT
+
/* Include COFF shared library support. */
#include "coff-solib.h"
diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h
index 716b194..87ddc9e 100644
--- a/gdb/config/m68k/tm-sun3.h
+++ b/gdb/config/m68k/tm-sun3.h
@@ -17,10 +17,29 @@ 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. */
-/* Let native-versus-cross support code know we are targeting sun3,
- and modify registers to include sun3 fpustate register. */
+#ifndef TM_SUN3_H
+#define TM_SUN3_H
-#define GDB_TARGET_IS_SUN3 1
+/* Sun3 status includes fpflags, which shows whether the FPU has been used
+ by the process, and whether the FPU was done with an instruction or
+ was interrupted in the middle of a long instruction. See
+ <machine/reg.h>. */
+/* a&d, pc,sr, fp, fpstat, fpflags */
+
+#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
+
+#define NUM_REGS 31
+
+#define REGISTER_BYTES_OK(b) \
+ ((b) == REGISTER_BYTES \
+ || (b) == REGISTER_BYTES_FP \
+ || (b) == REGISTER_BYTES_NOFP)
+
+/* If PC contains this instruction, then we know what we are in a system
+ call stub, and the return PC is is at SP+4, instead of SP. */
+
+#define SYSCALL_TRAP 0x4e40 /* trap #0 */
+#define SYSCALL_TRAP_OFFSET 0 /* PC points at trap instruction */
#include "m68k/tm-m68k.h"
@@ -53,16 +72,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-#undef SAVED_PC_AFTER_CALL
-
-#ifdef __STDC__
-struct frame_info;
-#endif
-
-extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
-
-#define SAVED_PC_AFTER_CALL(frame) \
- m68k_saved_pc_after_call(frame)
+/* If sun3 pcc says that a parameter is a short, it's a short. */
+#define BELIEVE_PCC_PROMOTION_TYPE
/* Sun /bin/cc gets this right as of SunOS 4.1.x. We need to define
BELIEVE_PCC_PROMOTION to get this right now that the code which
@@ -92,3 +103,5 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
#undef SIG_PC_FP_OFFSET
#define SIG_PC_FP_OFFSET 324
#define SIG_SP_FP_OFFSET 332
+
+#endif /* TM_SUN3_H */