import gdb-1999-10-18 snapshot
[deliverable/binutils-gdb.git] / gdb / config / i386 / tm-linux.h
index 0767bd9ba97911fe87f3c92d7e3e515e1836aa75..5faa6ff6264546bdec735603560a01d5c6a5f1a7 100644 (file)
@@ -21,8 +21,8 @@
 #ifndef TM_LINUX_H
 #define TM_LINUX_H
 
-/* FIXME:  If nothing else gets added to this file, it could be removed
-   and configure could just use tm-i386.h instead. -fnf */
+#define I386_GNULINUX_TARGET
+#define HAVE_I387_REGS
 
 #include "i386/tm-i386.h"
 
 
 #include "tm-sysv4.h"
 
+#define LOW_RETURN_REGNUM 0    /* holds low four bytes of result */
+#define HIGH_RETURN_REGNUM 2   /* holds high four bytes of result */
+
+/* This should probably move to tm-i386.h.  */
+#define TARGET_LONG_DOUBLE_BIT 80
+
+#if defined(HAVE_LONG_DOUBLE) && defined(HOST_I386)
+/* The host and target are i386 machines and the compiler supports
+   long doubles. Long doubles on the host therefore have the same
+   layout as a 387 FPU stack register. */
+#define LD_I387
+
+extern int i387_extract_floating (PTR addr, int len, long double *dretptr);
+extern int i387_store_floating   (PTR addr, int len, long double val);
+
+#define TARGET_EXTRACT_FLOATING i387_extract_floating
+#define TARGET_STORE_FLOATING   i387_store_floating
+
+#define TARGET_ANALYZE_FLOATING                                        \
+  do                                                           \
+    {                                                          \
+      unsigned expon;                                          \
+                                                               \
+      low = extract_unsigned_integer (valaddr, 4);             \
+      high = extract_unsigned_integer (valaddr + 4, 4);                \
+      expon = extract_unsigned_integer (valaddr + 8, 2);       \
+                                                               \
+      nonnegative = ((expon & 0x8000) == 0);                   \
+      is_nan = ((expon & 0x7fff) == 0x7fff)                    \
+       && ((high & 0x80000000) == 0x80000000)                  \
+       && (((high & 0x7fffffff) | low) != 0);                  \
+    }                                                          \
+  while (0)
+
+#undef REGISTER_CONVERT_TO_VIRTUAL
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)       \
+{                                                              \
+  long double val = *((long double *)FROM);                    \
+  store_floating ((TO), TYPE_LENGTH (TYPE), val);              \
+}
+
+#undef REGISTER_CONVERT_TO_RAW
+#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)                   \
+{                                                                      \
+  long double val = extract_floating ((FROM), TYPE_LENGTH (TYPE));     \
+  *((long double *)TO) = val;                                          \
+}
+
+/* Return the GDB type object for the "standard" data type
+   of data in register N.  */
+#undef REGISTER_VIRTUAL_TYPE
+#define REGISTER_VIRTUAL_TYPE(N)                                       \
+  (IS_FP_REGNUM (N) ? builtin_type_long_double : builtin_type_int)
+
+#endif
+
 /* The following works around a problem with /usr/include/sys/procfs.h  */
 #define sys_quotactl 1
 
@@ -104,4 +160,28 @@ extern CORE_ADDR i386_linux_sigtramp_saved_pc PARAMS ((struct frame_info *));
 
 extern CORE_ADDR i386_linux_sigtramp_saved_sp PARAMS ((struct frame_info *));
 
+/* Some versions of Linux have real-time signal support in the C library, and
+   some don't.  We have to include this file to find out.  */
+#include <signal.h>
+
+#ifdef __SIGRTMIN
+#define REALTIME_LO __SIGRTMIN
+#define REALTIME_HI (__SIGRTMAX + 1)
+#else
+#define REALTIME_LO 32
+#define REALTIME_HI 64
+#endif
+
+/* When we call a function in a shared library, and the PLT sends us
+   into the dynamic linker to find the function's real address, we
+   need to skip over the dynamic linker call.  This function decides
+   when to skip, and where to skip to.  See the comments for
+   SKIP_SOLIB_RESOLVER at the top of infrun.c.  */
+#define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
+extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
+
+/* N_FUN symbols in shared libaries have 0 for their values and need
+   to be relocated. */
+#define SOFUN_ADDRESS_MAYBE_MISSING
+
 #endif /* #ifndef TM_LINUX_H */
This page took 0.024312 seconds and 4 git commands to generate.