GDB (API)
/home/stan/gdb/src/gdb/alpha-tdep.h
Go to the documentation of this file.
00001 /* Common target dependent code for GDB on Alpha systems.
00002    Copyright (C) 1993-2013 Free Software Foundation, Inc.
00003 
00004    This file is part of GDB.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 3 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00018 
00019 #ifndef ALPHA_TDEP_H
00020 #define ALPHA_TDEP_H
00021 
00022 struct regcache;
00023 
00024 /* Say how long (ordinary) registers are.  This is a piece of bogosity
00025    used in push_word and a few other places; register_size() is the
00026    real way to know how big a register is.  */
00027 #define ALPHA_REGISTER_SIZE 8
00028 
00029 /* Number of machine registers.  */
00030 #define ALPHA_NUM_REGS 67
00031 
00032 /* Register numbers of various important registers.  Note that most of
00033    these values are "real" register numbers, and correspond to the
00034    general registers of the machine.  */
00035 
00036 #define ALPHA_V0_REGNUM      0  /* Function integer return value */
00037 #define ALPHA_T7_REGNUM      8  /* Return address register for OSF/1 __add* */
00038 #define ALPHA_S0_REGNUM      9  /* First saved register */
00039 #define ALPHA_GCC_FP_REGNUM 15  /* Used by gcc as frame register */
00040 #define ALPHA_A0_REGNUM     16  /* Loc of first arg during a subr call */
00041 #define ALPHA_T9_REGNUM     23  /* Return address register for OSF/1 __div* */
00042 #define ALPHA_RA_REGNUM     26  /* Contains return address value */
00043 #define ALPHA_T12_REGNUM    27  /* Contains start addr of current proc */
00044 #define ALPHA_GP_REGNUM     29  /* Contains the global pointer */
00045 #define ALPHA_SP_REGNUM     30  /* Contains address of top of stack */
00046 #define ALPHA_ZERO_REGNUM   31  /* Read-only register, always 0 */
00047 #define ALPHA_FP0_REGNUM    32  /* Floating point register 0 */
00048 #define ALPHA_FPA0_REGNUM   48  /* First float arg during a subr call */
00049 #define ALPHA_FPCR_REGNUM   63  /* Floating point control register */
00050 #define ALPHA_PC_REGNUM     64  /* Contains program counter */
00051 #define ALPHA_UNIQUE_REGNUM 66  /* PAL_rduniq value */
00052 
00053 /* Instruction size.  */
00054 #define ALPHA_INSN_SIZE 4
00055 
00056 /* The alpha has two different virtual pointers for arguments and locals.
00057    
00058    The virtual argument pointer is pointing to the bottom of the argument
00059    transfer area, which is located immediately below the virtual frame
00060    pointer.  Its size is fixed for the native compiler, it is either zero
00061    (for the no arguments case) or large enough to hold all argument registers.
00062    gcc uses a variable sized argument transfer area.  As it has
00063    to stay compatible with the native debugging tools it has to use the same
00064    virtual argument pointer and adjust the argument offsets accordingly.
00065    
00066    The virtual local pointer is localoff bytes below the virtual frame
00067    pointer, the value of localoff is obtained from the PDR.  */
00068 #define ALPHA_NUM_ARG_REGS   6
00069 
00070 /* Target-dependent structure in gdbarch.  */
00071 struct gdbarch_tdep
00072 {
00073   CORE_ADDR vm_min_address;     /* Used by alpha_heuristic_proc_start.  */
00074 
00075   /* If PC is inside a dynamically-generated signal trampoline function
00076      (i.e. one copied onto the user stack at run-time), return how many
00077      bytes PC is beyond the start of that function.  Otherwise, return -1.  */
00078   LONGEST (*dynamic_sigtramp_offset) (struct gdbarch *, CORE_ADDR);
00079 
00080   /* Translate a signal handler stack base address into the address of
00081      the sigcontext structure for that signal handler.  */
00082   CORE_ADDR (*sigcontext_addr) (struct frame_info *);
00083 
00084   /* Does the PC fall in a signal trampoline.  */
00085   /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
00086      look at tramp-frame.h and other simplier per-architecture
00087      sigtramp unwinders.  */
00088   int (*pc_in_sigtramp) (struct gdbarch *gdbarch, CORE_ADDR pc,
00089                          const char *name);
00090 
00091   /* If TYPE will be returned in memory, return true.  */
00092   int (*return_in_memory) (struct type *type);
00093 
00094   /* Offset of registers in `struct sigcontext'.  */
00095   int sc_pc_offset;
00096   int sc_regs_offset;
00097   int sc_fpregs_offset;
00098 
00099   int jb_pc;                    /* Offset to PC value in jump buffer.
00100                                    If htis is negative, longjmp support
00101                                    will be disabled.  */
00102   size_t jb_elt_size;           /* And the size of each entry in the buf.  */
00103 };
00104 
00105 extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc);
00106 extern int alpha_software_single_step (struct frame_info *frame);
00107 extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
00108 
00109 extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
00110 extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);
00111 
00112 extern void alpha_supply_int_regs (struct regcache *, int, const void *,
00113                                    const void *, const void *);
00114 extern void alpha_fill_int_regs (const struct regcache *, int,
00115                                  void *, void *, void *);
00116 extern void alpha_supply_fp_regs (struct regcache *, int,
00117                                   const void *, const void *);
00118 extern void alpha_fill_fp_regs (const struct regcache *,
00119                                 int, void *, void *);
00120 
00121 #endif /* ALPHA_TDEP_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines