* alpha-tdep.c (alpha_register_virtual_type): New function.
[deliverable/binutils-gdb.git] / gdb / config / alpha / tm-alpha.h
index 2b3e5ac6b6f3b0ca05e7ad309f3679fbe2e98a54..84ba3b489fb286f6aa7cec8ef9ab5b1550f8cb49 100644 (file)
@@ -1,6 +1,7 @@
 /* Definitions to make GDB run on an Alpha box under OSF1.  This is
    also used by the Alpha/Netware and Alpha/Linux targets.
-   Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +23,7 @@
 #ifndef TM_ALPHA_H
 #define TM_ALPHA_H
 
+#include "regcache.h"
 #include "bfd.h"
 #include "coff/sym.h"          /* Needed for PDR below.  */
 #include "coff/symconst.h"
@@ -32,7 +34,7 @@ struct value;
 struct symbol;
 
 #if !defined (TARGET_BYTE_ORDER)
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_LITTLE
 #endif
 
 /* Redefine some target bit sizes from the default.  */
@@ -71,11 +73,12 @@ extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
 
 /* Are we currently handling a signal ?  */
 
-#define IN_SIGTRAMP(pc, name)  ((name) && STREQ ("__sigtramp", (name)))
+#define IN_SIGTRAMP(pc, name) alpha_osf_in_sigtramp ((pc), (name))
+extern int alpha_osf_in_sigtramp (CORE_ADDR, char *);
 
 /* Stack grows downward.  */
 
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
+#define INNER_THAN(lhs,rhs) core_addr_lessthan ((lhs), (rhs))
 
 #define BREAKPOINT {0x80, 0, 0, 0}     /* call_pal bpt */
 
@@ -97,20 +100,12 @@ extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
 
 #define NUM_REGS 66
 
-/* Initializer for an array of names of registers.
-   There should be NUM_REGS strings in this initializer.  */
-
-#define REGISTER_NAMES         \
-    {  "v0",   "t0",   "t1",   "t2",   "t3",   "t4",   "t5",   "t6", \
-       "t7",   "s0",   "s1",   "s2",   "s3",   "s4",   "s5",   "fp", \
-       "a0",   "a1",   "a2",   "a3",   "a4",   "a5",   "t8",   "t9", \
-       "t10",  "t11",  "ra",   "t12",  "at",   "gp",   "sp",   "zero", \
-       "f0",   "f1",   "f2",   "f3",   "f4",   "f5",   "f6",   "f7", \
-       "f8",   "f9",   "f10",  "f11",  "f12",  "f13",  "f14",  "f15", \
-       "f16",  "f17",  "f18",  "f19",  "f20",  "f21",  "f22",  "f23",\
-       "f24",  "f25",  "f26",  "f27",  "f28",  "f29",  "f30",  "fpcr",\
-       "pc",   "vfp",                                          \
-    }
+
+/* Return the name of register REGNO.  */
+
+#define REGISTER_NAME(regno) alpha_register_name ((regno))
+extern char *alpha_register_name (int);
+
 
 /* Register numbers of various important registers.
    Note that most of these values are "real" register numbers,
@@ -135,9 +130,12 @@ extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
 #define FP_REGNUM 65           /* Virtual frame pointer */
 
 #define CANNOT_FETCH_REGISTER(regno) \
-  ((regno) == FP_REGNUM || (regno) == ZERO_REGNUM)
+  alpha_cannot_fetch_register ((regno))
+extern int alpha_cannot_fetch_register (int);
+
 #define CANNOT_STORE_REGISTER(regno) \
-  ((regno) == FP_REGNUM || (regno) == ZERO_REGNUM)
+  alpha_cannot_store_register ((regno))
+extern int alpha_cannot_store_register (int);
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -175,7 +173,8 @@ extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
    memory format is an integer with 4 bytes or less, as the representation
    of integers in floating point registers is different. */
 
-#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) < FP0_REGNUM + 31)
+#define REGISTER_CONVERTIBLE(N) alpha_register_convertible ((N))
+extern int alpha_register_convertible (int);
 
 /* Convert data from raw format for register REGNUM in buffer FROM
    to virtual format with type TYPE in buffer TO.  */
@@ -196,14 +195,15 @@ alpha_register_convert_to_raw (struct type *, int, char *, char *);
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 
-#define REGISTER_VIRTUAL_TYPE(N) \
-       (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+31)  \
-        ? builtin_type_double : builtin_type_long) \
+#define REGISTER_VIRTUAL_TYPE(N) alpha_register_virtual_type ((N))
+extern struct type * alpha_register_virtual_type (int);
 
 /* Store the address of the place in which to copy the structure the
    subroutine will return.  Handled by alpha_push_arguments.  */
 
-#define STORE_STRUCT_RETURN(addr, sp)
+#define STORE_STRUCT_RETURN(addr, sp) \
+  alpha_store_struct_return ((addr), (sp))
+extern void alpha_store_struct_return (CORE_ADDR, CORE_ADDR);
 /**/
 
 /* Extract from an array REGBUF containing the (raw) register state
@@ -230,11 +230,13 @@ extern void alpha_store_return_value (struct type *, char *);
    on it.  */
 
 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
-  (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
-                   REGISTER_RAW_SIZE (V0_REGNUM)))
+  alpha_extract_struct_value_address (REGBUF)
+extern CORE_ADDR alpha_extract_struct_value_address (char *);
 
 /* Structures are returned by ref in extra arg0 */
-#define USE_STRUCT_CONVENTION(gcc_p, type)     1
+#define USE_STRUCT_CONVENTION(gcc_p, type) \
+  alpha_use_struct_convention ((gcc_p), (type))
+extern int alpha_use_struct_convention (int, struct type *);
 \f
 
 /* Describe the pointer in each stack frame to the previous stack frame
@@ -243,7 +245,7 @@ extern void alpha_store_return_value (struct type *, char *);
 /* FRAME_CHAIN takes a frame's nominal address
    and produces the frame's chain-pointer. */
 
-#define FRAME_CHAIN(thisframe) (CORE_ADDR) alpha_frame_chain (thisframe)
+#define FRAME_CHAIN(thisframe) alpha_frame_chain (thisframe)
 extern CORE_ADDR alpha_frame_chain (struct frame_info *);
 
 /* Define other aspects of the stack frame.  */
@@ -275,9 +277,11 @@ extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *);
 
 #define ALPHA_NUM_ARG_REGS     6
 
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame - (ALPHA_NUM_ARG_REGS * 8))
+#define FRAME_ARGS_ADDRESS(fi) alpha_frame_args_address ((fi))
+extern CORE_ADDR alpha_frame_args_address (struct frame_info *);
 
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame - (fi)->localoff)
+#define FRAME_LOCALS_ADDRESS(fi) alpha_frame_locals_address ((fi))
+extern CORE_ADDR alpha_frame_locals_address (struct frame_info *);
 
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
@@ -294,14 +298,9 @@ extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *);
    ways in the stack frame.  sp is even more special:
    the address we return for it IS the sp for the next frame.  */
 
-extern void alpha_find_saved_regs (struct frame_info *);
-
 #define FRAME_INIT_SAVED_REGS(frame_info) \
-  do { \
-    if ((frame_info)->saved_regs == NULL) \
-      alpha_find_saved_regs (frame_info); \
-    (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
-  } while (0)
+  alpha_frame_init_saved_regs (frame_info)
+extern void alpha_frame_init_saved_regs (struct frame_info *);
 \f
 
 /* Things needed for making the inferior call functions.  */
@@ -348,23 +347,20 @@ extern CORE_ADDR alpha_call_dummy_address (void);
    We only have to set RA_REGNUM to the dummy breakpoint address
    and T12_REGNUM (the `procedure value register') to the function address.  */
 
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p)    \
-{                                                                      \
-  CORE_ADDR bp_address = CALL_DUMMY_ADDRESS ();                        \
-  if (bp_address == 0)                                                 \
-    error ("no place to put call");                                    \
-  write_register (RA_REGNUM, bp_address);                              \
-  write_register (T12_REGNUM, fun);                                    \
-}
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+  alpha_fix_call_dummy ((dummyname), (pc), (fun), (nargs), (args), \
+                       (type), (gcc_p))
+extern void alpha_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
+                                  struct value **, struct type *, int);
 
 /* There's a mess in stack frame creation.  See comments in blockframe.c
    near reference to INIT_FRAME_PC_FIRST.  */
 
-#define        INIT_FRAME_PC(fromleaf, prev)   /* nada */
+#define INIT_FRAME_PC(fromleaf, prev) init_frame_pc_noop ((fromleaf), (prev))
 
 #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
-  (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
-             (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ());
+  alpha_init_frame_pc_first ((fromleaf), (prev))
+extern void alpha_init_frame_pc_first (int, struct frame_info *);
 
 /* Special symbol found in blocks associated with routines.  We can hang
    alpha_extra_func_info_t's off of this.  */
@@ -390,21 +386,14 @@ typedef struct alpha_extra_func_info
 #define mips_extra_func_info alpha_extra_func_info
 #define mips_extra_func_info_t alpha_extra_func_info_t
 
-#define EXTRA_FRAME_INFO \
-  int localoff; \
-  int pc_reg; \
-  alpha_extra_func_info_t proc_desc;
 
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
-extern void init_extra_frame_info (struct frame_info *);
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
+  alpha_init_extra_frame_info(fromleaf, fci)
+extern void alpha_init_extra_frame_info (int, struct frame_info *);
+
+#define PRINT_EXTRA_FRAME_INFO(fi) alpha_print_extra_frame_info ((fi))
+extern void alpha_print_extra_frame_info (struct frame_info *);
 
-#define        PRINT_EXTRA_FRAME_INFO(fi) \
-  { \
-    if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \
-      printf_filtered (" frame pointer is at %s+%ld\n", \
-                       REGISTER_NAME (fi->proc_desc->pdr.framereg), \
-                                 fi->proc_desc->pdr.frameoffset); \
-  }
 
 /* It takes two values to specify a frame on the ALPHA.  Sigh.
 
@@ -472,4 +461,7 @@ extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
 extern CORE_ADDR alpha_osf_skip_sigtramp_frame (struct frame_info *,
                                                CORE_ADDR);
 
+/* Single step based on where the current instruction will take us.  */
+extern void alpha_software_single_step (enum target_signal, int);
+
 #endif /* TM_ALPHA_H */
This page took 0.02864 seconds and 4 git commands to generate.