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 "regcache.h" 00022 00023 #include <sys/procfs.h> 00024 #include "gregset.h" 00025 00026 #include "sparc64-tdep.h" 00027 #include "sparc-tdep.h" 00028 #include "sparc-nat.h" 00029 #include "inferior.h" 00030 #include "target.h" 00031 #include "linux-nat.h" 00032 00033 static const struct sparc_gregset sparc64_linux_ptrace_gregset = 00034 { 00035 16 * 8, /* "tstate" */ 00036 17 * 8, /* %pc */ 00037 18 * 8, /* %npc */ 00038 19 * 8, /* %y */ 00039 -1, /* %wim */ 00040 -1, /* %tbr */ 00041 0 * 8, /* %g1 */ 00042 -1, /* %l0 */ 00043 4 /* sizeof (%y) */ 00044 }; 00045 00046 00047 void 00048 supply_gregset (struct regcache *regcache, const prgregset_t *gregs) 00049 { 00050 sparc64_supply_gregset (sparc_gregset, regcache, -1, gregs); 00051 } 00052 00053 void 00054 supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs) 00055 { 00056 sparc64_supply_fpregset (&sparc64_bsd_fpregset, regcache, -1, fpregs); 00057 } 00058 00059 void 00060 fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum) 00061 { 00062 sparc64_collect_gregset (sparc_gregset, regcache, regnum, gregs); 00063 } 00064 00065 void 00066 fill_fpregset (const struct regcache *regcache, 00067 prfpregset_t *fpregs, int regnum) 00068 { 00069 sparc64_collect_fpregset (&sparc64_bsd_fpregset, regcache, regnum, fpregs); 00070 } 00071 00072 /* Provide a prototype to silence -Wmissing-prototypes. */ 00073 void _initialize_sparc64_linux_nat (void); 00074 00075 void 00076 _initialize_sparc64_linux_nat (void) 00077 { 00078 struct target_ops *t; 00079 00080 /* Fill in the generic GNU/Linux methods. */ 00081 t = linux_target (); 00082 00083 /* Add our register access methods. */ 00084 t->to_fetch_registers = sparc_fetch_inferior_registers; 00085 t->to_store_registers = sparc_store_inferior_registers; 00086 00087 /* Register the target. */ 00088 linux_nat_add_target (t); 00089 00090 sparc_gregset = &sparc64_linux_ptrace_gregset; 00091 }