This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH]: DJGPP build and cleanup
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: DJGPP build and cleanup
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Wed, 23 Feb 2000 17:29:16 -0500 (EST)
[Sorry, pressed Send too fast...]
The following patches allow the DJGPP (a.k.a. go32) version of GDB to
be built, and also clean up a few compiler warnings.
My problems with setting up SSH are still not solved (I'm working on
that), so could someone please commit these changes for me?
The change to i386-tdep.c should probably be approved by someone (I
cannot figure out from MAINTAINERS who's responsible for i386
targets).
2000-02-23 Eli Zaretskii <eliz@is.elta.co.il>
* config/i386/nm-go32.h (FLOAT_INFO): Remove macro definition.
(top level): Add prototypes for go32_* functions.
* config/i386/tm-go32.h (I386_DJGPP_TARGET): Define.
(FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC):
Override definitions from tm-i386.h.
(REGISTER_VIRTUAL_TYPE): Remove macro definition.
* i386-tdep.c (i386_extract_return_value)
[I386_AIX_TARGET || I386_GNULINUX_TARGET]: Add I386_DJGPP_TARGET
to the list of targets which return FP values in FP registers.
--- gdb/config/i386/nm-go32.h~0 Mon Aug 23 22:36:46 1999
+++ gdb/config/i386/nm-go32.h Wed Feb 23 18:37:36 2000
@@ -48,6 +48,7 @@
#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr,len) \
go32_region_ok_for_watchpoint(addr,len)
+extern int go32_region_ok_for_watchpoint (CORE_ADDR, int);
/* After a watchpoint trap, the PC points to the instruction after the
one that caused the trap. Therefore we don't need to step over it.
@@ -60,24 +61,24 @@
#define target_stopped_data_address() \
go32_stopped_by_watchpoint (inferior_pid, 1)
+extern CORE_ADDR go32_stopped_by_watchpoint (int, int);
/* Use these macros for watchpoint insertion/removal. */
#define target_insert_watchpoint(addr, len, type) \
go32_insert_watchpoint (inferior_pid, addr, len, type)
+extern int go32_insert_watchpoint (int, CORE_ADDR, int, int);
#define target_remove_watchpoint(addr, len, type) \
go32_remove_watchpoint (inferior_pid, addr, len, type)
+extern int go32_remove_watchpoint (int, CORE_ADDR, int, int);
#define target_insert_hw_breakpoint(addr, shadow) \
go32_insert_hw_breakpoint(addr, shadow)
+extern int go32_insert_hw_breakpoint (CORE_ADDR, void *);
#define target_remove_hw_breakpoint(addr, shadow) \
go32_remove_hw_breakpoint(addr, shadow)
+extern int go32_remove_hw_breakpoint (CORE_ADDR, void *);
#define DECR_PC_AFTER_HW_BREAK 0
-
-#undef FLOAT_INFO
-#define FLOAT_INFO { i386_go32_float_info (); }
-
-extern void i386_go32_float_info (void);
--- gdb/config/i386/tm-go32.h~0 Wed Nov 17 02:30:32 1999
+++ gdb/config/i386/tm-go32.h Wed Feb 23 18:22:02 2000
@@ -1,5 +1,5 @@
/* Target-dependent definitions for Intel x86 running DJGPP.
- Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
@@ -18,6 +18,10 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef TM_GO32_H
+#define TM_GO32_H
+
+#define I386_DJGPP_TARGET
#undef HAVE_SSE_REGS /* FIXME! go32-nat.c needs to support XMMi registers */
#define HAVE_I387_REGS
@@ -60,18 +64,30 @@
*((long double *)(TO)) = val; \
}
-/* Return the GDB type object for the "standard" data type of data in
- register N. Perhaps si and di should go here, but potentially they
- could be used for things other than address. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM) \
- ? lookup_pointer_type (builtin_type_void) \
- : IS_FP_REGNUM(N) ? builtin_type_long_double \
- : IS_SSE_REGNUM(N) ? builtin_type_v4sf \
- : builtin_type_int)
-
-#endif /* LD_I387 */
-
#undef TARGET_LONG_DOUBLE_BIT
#define TARGET_LONG_DOUBLE_BIT 96
+
+/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
+ chain-pointer.
+ In the case of the i386, the frame's nominal address
+ is the address of a 4-byte word containing the calling frame's address.
+ DJGPP doesn't have any special frames for signal handlers, they are
+ just normal C functions. */
+#undef FRAME_CHAIN
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame, 4) :\
+ 0)
+
+/* A macro that tells us whether the function invocation represented
+ by FI does not have a frame on the stack associated with it. If it
+ does not, FRAMELESS is set to 1, else 0. */
+#undef FRAMELESS_FUNCTION_INVOCATION
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+ (frameless_look_for_prologue(FI))
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
+
+#endif /* LD_I387 */
+#endif /* TM_GO32_H */
--- gdb/config/i386/xm-go32.h~0 Mon Aug 23 22:36:50 1999
+++ gdb/config/i386/xm-go32.h Fri Feb 18 18:18:44 2000
@@ -36,3 +36,4 @@
#define DIRNAME_SEPARATOR ';'
#define HOST_I386
+typedef unsigned char fd_mask;