GDB (API)
/home/stan/gdb/src/gdb/score-tdep.h
Go to the documentation of this file.
00001 /* Target-dependent code for the S+core architecture, for GDB,
00002    the GNU Debugger.
00003 
00004    Copyright (C) 2006-2013 Free Software Foundation, Inc.
00005 
00006    Contributed by Qinwei (qinwei@sunnorth.com.cn)
00007    Contributed by Ching-Peng Lin (cplin@sunplus.com)
00008 
00009    This file is part of GDB.
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 3 of the License, or
00014    (at your option) any later version.
00015 
00016    This program is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020 
00021    You should have received a copy of the GNU General Public License
00022    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00023 
00024 #ifndef SCORE_TDEP_H
00025 #define SCORE_TDEP_H
00026 #include "math.h"
00027 
00028 enum gdb_regnum
00029 {
00030   SCORE_SP_REGNUM = 0,
00031   SCORE_FP_REGNUM = 2,
00032   SCORE_RA_REGNUM = 3,
00033   SCORE_A0_REGNUM = 4,
00034   SCORE_AL_REGNUM = 7,
00035   SCORE_PC_REGNUM = 49,
00036 };
00037 
00038 #define SCORE_A0_REGNUM        4
00039 #define SCORE_A1_REGNUM        5
00040 #define SCORE_REGSIZE          4
00041 #define SCORE7_NUM_REGS         56
00042 #define SCORE3_NUM_REGS         50
00043 #define SCORE_BEGIN_ARG_REGNUM 4
00044 #define SCORE_LAST_ARG_REGNUM  7
00045 
00046 #define SCORE_INSTLEN          4
00047 #define SCORE16_INSTLEN        2
00048 
00049 /* Forward declarations.  */
00050 struct regset;
00051 
00052 /* Target-dependent structure in gdbarch */
00053 struct gdbarch_tdep
00054 {
00055     /* Cached core file helpers.  */
00056     struct regset *gregset;
00057 };
00058 
00059 /* Linux Core file support (dirty hack)
00060   
00061    S+core Linux register set definition, copy from S+core Linux.  */
00062 struct pt_regs {
00063     /* Pad bytes for argument save space on the stack.  */
00064     unsigned long pad0[6]; /* may be 4, MIPS accept 6var, SCore
00065                               accepts 4 Var--yuchen */
00066 
00067     /* Saved main processor registers.  */
00068     unsigned long orig_r4;
00069     unsigned long regs[32];
00070 
00071     /* Other saved registers.  */
00072     unsigned long cel;
00073     unsigned long ceh;
00074 
00075     unsigned long sr0;  /*cnt*/
00076     unsigned long sr1;  /*lcr*/
00077     unsigned long sr2;  /*scr*/
00078 
00079     /* saved cp0 registers */
00080     unsigned long cp0_epc;
00081     unsigned long cp0_ema;
00082     unsigned long cp0_psr;
00083     unsigned long cp0_ecr;
00084     unsigned long cp0_condition;
00085 };
00086 
00087 typedef struct pt_regs elf_gregset_t;
00088 
00089 #endif /* SCORE_TDEP_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines