GDB (API)
|
00001 /* Native-dependent code for GNU/Linux UltraSPARC. 00002 00003 Copyright (C) 2003-2013 Free Software Foundation, Inc. 00004 00005 This file is part of GDB. 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 #include "defs.h" 00021 #include "gdbarch.h" 00022 00023 #include "sparc64-tdep.h" 00024 #include "sparc-nat.h" 00025 00026 /* Determine whether `gregset_t' contains register REGNUM. */ 00027 00028 static int 00029 sparc64_gregset_supplies_p (struct gdbarch *gdbarch, int regnum) 00030 { 00031 if (gdbarch_ptr_bit (gdbarch) == 32) 00032 return sparc32_gregset_supplies_p (gdbarch, regnum); 00033 00034 /* Integer registers. */ 00035 if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_G7_REGNUM) 00036 || (regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM) 00037 || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_L7_REGNUM) 00038 || (regnum >= SPARC_I0_REGNUM && regnum <= SPARC_I7_REGNUM)) 00039 return 1; 00040 00041 /* Control registers. */ 00042 if (regnum == SPARC64_PC_REGNUM 00043 || regnum == SPARC64_NPC_REGNUM 00044 || regnum == SPARC64_STATE_REGNUM 00045 || regnum == SPARC64_Y_REGNUM 00046 || regnum == SPARC64_FPRS_REGNUM) 00047 return 1; 00048 00049 return 0; 00050 } 00051 00052 /* Determine whether `fpregset_t' contains register REGNUM. */ 00053 00054 static int 00055 sparc64_fpregset_supplies_p (struct gdbarch *gdbarch, int regnum) 00056 { 00057 if (gdbarch_ptr_bit (gdbarch) == 32) 00058 return sparc32_fpregset_supplies_p (gdbarch, regnum); 00059 00060 /* Floating-point registers. */ 00061 if ((regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM) 00062 || (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM)) 00063 return 1; 00064 00065 /* Control registers. */ 00066 if (regnum == SPARC64_FSR_REGNUM) 00067 return 1; 00068 00069 return 0; 00070 } 00071 00072 00073 /* Provide a prototype to silence -Wmissing-prototypes. */ 00074 void _initialize_sparc64_nat (void); 00075 00076 void 00077 _initialize_sparc64_nat (void) 00078 { 00079 sparc_supply_gregset = sparc64_supply_gregset; 00080 sparc_collect_gregset = sparc64_collect_gregset; 00081 sparc_supply_fpregset = sparc64_supply_fpregset; 00082 sparc_collect_fpregset = sparc64_collect_fpregset; 00083 sparc_gregset_supplies_p = sparc64_gregset_supplies_p; 00084 sparc_fpregset_supplies_p = sparc64_fpregset_supplies_p; 00085 }