]> Git Repo - binutils.git/blobdiff - gdb/config/sparc/tm-sparc.h
2003-07-03 Andrew Cagney <[email protected]>
[binutils.git] / gdb / config / sparc / tm-sparc.h
index c8a073bf24a4d1147f40f74421e3c88017399b36..ec60c7983c2d4a16377f2c351c16462678381fca 100644 (file)
@@ -158,15 +158,16 @@ extern int sparc_intreg_size (void);
                                                                 \
   "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr"        \
 }
+extern const char *legacy_register_name (int i);
+#define REGISTER_NAME legacy_register_name
 
 /* Offset from address of function to start of its code.
    Zero on most machines.  */
 
 #define FUNCTION_START_OFFSET 0
 
-/* Amount PC must be decremented by after a breakpoint.
-   This is often the number of bytes in BREAKPOINT
-   but not always.  */
+/* Amount PC must be decremented by after a breakpoint.  This is often
+   the number of bytes returned by BREAKPOINT_FROM_PC but not always.  */
 
 #define DECR_PC_AFTER_BREAK 0
 
@@ -174,7 +175,7 @@ extern int sparc_intreg_size (void);
    used in push_word and a few other places; REGISTER_RAW_SIZE is the
    real way to know how big a register is.  */
 
-#define REGISTER_SIZE 4
+#define DEPRECATED_REGISTER_SIZE 4
 
 /* Number of machine registers */
 
@@ -182,7 +183,7 @@ extern int sparc_intreg_size (void);
 
 #define        SP_REGNUM 14            /* Contains address of top of stack, \
                                   which is also the bottom of the frame.  */
-#define        FP_REGNUM 30            /* Contains address of executing stack frame */
+#define        DEPRECATED_FP_REGNUM 30         /* Contains address of executing stack frame */
 
 #define        FP0_REGNUM 32           /* Floating point register 0 */
 
@@ -199,12 +200,13 @@ extern int sparc_intreg_size (void);
    stack rather than with the other registers, and this causes hair
    and confusion in places like pop_frame.  It might be better to
    remove the ins and locals from `registers', make sure that
-   get_saved_register can get them from the stack (even in the
-   innermost frame), and make this the way to access them.  For the
-   frame pointer we would do that via TARGET_READ_FP.  On the other
-   hand, that is likely to be confusing or worse for flat frames.  */
+   frame_register() can get them from the stack (even in the innermost
+   frame), and make this the way to access them.  For the frame
+   pointer we would do that via DEPRECATED_TARGET_READ_FP.  On the
+   other hand, that is likely to be confusing or worse for flat
+   frames.  */
 
-#define REGISTER_BYTES (32*4+32*4+8*4)
+#define DEPRECATED_REGISTER_BYTES (32*4+32*4+8*4)
 
 /* Index within `registers' of the first byte of the space for
    register N.  */
@@ -258,7 +260,7 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
    the new frame is not set up until the new function executes
    some instructions.  */
 
-#define SAVED_PC_AFTER_CALL(FRAME) PC_ADJUST (read_register (RP_REGNUM))
+#define DEPRECATED_SAVED_PC_AFTER_CALL(FRAME) PC_ADJUST (read_register (RP_REGNUM))
 
 /* Stack grows downward.  */
 
@@ -267,18 +269,17 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
 /* Write into appropriate registers a function return value of type
    TYPE, given in virtual format.  */
 
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
-     sparc_store_return_value (TYPE, VALBUF)
-extern void sparc_store_return_value (struct type *, char *);
-
-/* Extract from an array REGBUF containing the (raw) register state
-   the address in which a function should return its structure value,
-   as a CORE_ADDR (or an expression that can be used as one).  */
+#define STORE_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
+     sparc32_store_return_value (TYPE, REGCACHE, VALBUF)
+extern void sparc32_store_return_value (struct type *, struct regcache *,
+                                       const void *);
 
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
-     sparc_extract_struct_value_address (REGBUF)
+/* Extract from REGCACHE the address in which a function should return
+   its structure value.  */
 
-extern CORE_ADDR sparc_extract_struct_value_address (char *);
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGCACHE) \
+     sparc_extract_struct_value_address (REGCACHE)
+extern CORE_ADDR sparc_extract_struct_value_address (struct regcache *);
 
 /* Stack must be aligned on 64-bit boundaries when synthesizing
    function calls (128-bit for sparc64).  */
@@ -360,7 +361,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
 
 /* Sequence of bytes for breakpoint instruction (ta 1). */
 
-#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
+extern const unsigned char *sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len);
+#define BREAKPOINT_FROM_PC(PC,LEN) sparc_breakpoint_from_pc ((PC), (LEN))
 
 /* Register numbers of various important registers.
    Note that some of these values are "real" register numbers,
@@ -392,8 +394,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
 #define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM)
 
 /*
- * FRAME_CHAIN and FRAME_INFO definitions, collected here for convenience.
- */
+ * DEPRECATED_FRAME_CHAIN and FRAME_INFO definitions, collected here
+ * for convenience.  */
 
 #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
 /*
@@ -403,58 +405,11 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
-/* FRAME_CHAIN takes a frame's nominal address
-   and produces the frame's chain-pointer. */
-
-/* In the case of the Sun 4, the frame-chain's nominal address
-   is held in the frame pointer register.
-
-   On the Sun4, the frame (in %fp) is %sp for the previous frame.
-   From the previous frame's %sp, we can find the previous frame's
-   %fp: it is in the save area just above the previous frame's %sp.
-
-   If we are setting up an arbitrary frame, we'll need to know where
-   it ends.  Hence the following.  This part of the frame cache
-   structure should be checked before it is assumed that this frame's
-   bottom is in the stack pointer.
-
-   If there isn't a frame below this one, the bottom of this frame is
-   in the stack pointer.
-
-   If there is a frame below this one, and the frame pointers are
-   identical, it's a leaf frame and the bottoms are the same also.
+/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
+   the frame's chain-pointer. */
 
-   Otherwise the bottom of this frame is the top of the next frame.
-
-   The bottom field is misnamed, since it might imply that memory from
-   bottom to frame contains this frame.  That need not be true if
-   stack frames are allocated in different segments (e.g. some on a
-   stack, some on a heap in the data segment).
-
-   GCC 2.6 and later can generate ``flat register window'' code that
-   makes frames by explicitly saving those registers that need to be
-   saved.  %i7 is used as the frame pointer, and the frame is laid out
-   so that flat and non-flat calls can be intermixed freely within a
-   program.  Unfortunately for GDB, this means it must detect and
-   record the flatness of frames.
-
-   Since the prologue in a flat frame also tells us where fp and pc
-   have been stashed (the frame is of variable size, so their location
-   is not fixed), it's convenient to record them in the frame info.  */
-
-#define EXTRA_FRAME_INFO \
-  CORE_ADDR bottom;      \
-  int in_prologue;       \
-  int flat;              \
-  /* Following fields only relevant for flat frames.  */ \
-  CORE_ADDR pc_addr;     \
-  CORE_ADDR fp_addr;     \
-  /* Add this to ->frame to get the value of the stack pointer at the */ \
-  /* time of the register saves.  */ \
-  int sp_offset;
-
-/* We need to override GET_SAVED_REGISTER so that we can deal with the
-   way outs change into ins in different frames.  */
+/* We need to override DEPRECATED_GET_SAVED_REGISTER so that we can
+   deal with the way outs change into ins in different frames.  */
 
 void sparc_get_saved_register (char *raw_buffer,
                               int *optimized,
@@ -462,7 +417,7 @@ void sparc_get_saved_register (char *raw_buffer,
                               struct frame_info *frame,
                               int regnum, enum lval_type *lvalp);
 
-#define GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
+#define DEPRECATED_GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
      sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \
                               FRAME, REGNUM, LVAL)
 
@@ -472,7 +427,7 @@ void sparc_get_saved_register (char *raw_buffer,
      sparc_init_extra_frame_info (FROMLEAF, FCI)
 extern void sparc_init_extra_frame_info (int, struct frame_info *);
 
-#define FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME))
+#define DEPRECATED_FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME))
 extern CORE_ADDR sparc_frame_chain (struct frame_info *);
 
 /* A macro that tells us whether the function invocation represented
@@ -488,17 +443,13 @@ extern CORE_ADDR sparc_frame_chain (struct frame_info *);
 extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
 
 /* If the argument is on the stack, it will be here.  */
-#define FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
+#define DEPRECATED_FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
 
-#define FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
 
 /* Set VAL to the number of args passed to frame described by FI.
    Can set VAL to -1, meaning no way to tell.  */
 
-/* We can't tell how many args there are
-   now that the C compiler delays popping them.  */
-#define FRAME_NUM_ARGS(FI) (-1)
-
 /* Return number of bytes at start of arglist that are not really args.  */
 
 #define FRAME_ARGS_SKIP 68
@@ -518,7 +469,7 @@ extern void sparc_print_extra_frame_info (struct frame_info *);
 extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
 #define        DEPRECATED_INIT_FRAME_PC(FROMLEAF, PREV)        (init_frame_pc_noop (FROMLEAF, PREV))
 #define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
-  ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \
+  ((FROMLEAF) ? DEPRECATED_SAVED_PC_AFTER_CALL ((PREV)->next) : \
              (PREV)->next ? DEPRECATED_FRAME_SAVED_PC ((PREV)->next) : read_pc ())
 
 /* Define other aspects of the stack frame.  */
@@ -592,9 +543,9 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
  *
  *   call_function then writes CALL_DUMMY, pushes the args onto the
  * stack, and adjusts the stack pointer.
- *
*   run_stack_dummy then starts execution (in the middle of
* CALL_DUMMY, as directed by call_function).  */
  call_function_by_hand then starts execution (in the middle of
  CALL_DUMMY, as directed by call_function).  */
 
 #ifndef CALL_DUMMY
 /* This sequence of words is the instructions
@@ -635,21 +586,21 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
 
 /* Size of the call dummy in bytes. */
 
-#define CALL_DUMMY_LENGTH 0x38
+#define DEPRECATED_CALL_DUMMY_LENGTH 0x38
 
 /* Offset within call dummy of first instruction to execute. */
 
-#define CALL_DUMMY_START_OFFSET 0
+#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
 
 /* Offset within CALL_DUMMY of the 'call' instruction. */
 
-#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + 0x24)
+#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x24)
 
 /* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */
 
-#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30)
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x30)
 
-#define CALL_DUMMY_STACK_ADJUST 68
+#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68
 
 /* Call dummy method (eg. on stack, at entry point, etc.) */
 
@@ -672,7 +623,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
 /* Insert the specified number of args and function address
    into a call sequence of the above form stored at DUMMYNAME.  */
 
-#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
+#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
      sparc_fix_call_dummy (DUMMYNAME, PC, FUN, TYPE, GCC_P)
 void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
                           struct type *value_type, int using_gcc);
@@ -688,7 +639,7 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
 void sparc_push_dummy_frame (void);
 void sparc_pop_frame (void);
 
-#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
+#define DEPRECATED_PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
      sparc32_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
 
 extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int,
@@ -714,9 +665,10 @@ extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int,
    function return value of type TYPE, and copy that, in virtual
    format, into VALBUF.  */
 
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
-     sparc32_extract_return_value (TYPE, REGBUF, VALBUF)
-extern void sparc32_extract_return_value (struct type *, char[], char *);
+#define EXTRACT_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
+     sparc32_extract_return_value (TYPE, REGCACHE, VALBUF)
+extern void sparc32_extract_return_value (struct type *, struct regcache *,
+                                         void *valbuf);
 
 #endif /* GDB_MULTI_ARCH */
 
@@ -756,3 +708,4 @@ extern int deferred_stores;
 
 #define TM_PRINT_INSN_MACH bfd_mach_sparc
 
+#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED 1
This page took 0.036114 seconds and 4 git commands to generate.