1 /* Native-dependent code for Solaris SPARC.
3 Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include <sys/procfs.h>
26 #include "sparc-tdep.h"
28 /* This file provids the (temporary) glue between the Solaris SPARC
29 target dependent code and the machine independent SVR4 /proc
32 /* Solaris 7 (Solaris 2.7, SunOS 5.7) and up support two process data
33 models, the traditional 32-bit data model (ILP32) and the 64-bit
34 data model (LP64). The format of /proc depends on the data model
35 of the observer (the controlling process, GDB in our case). The
36 Solaris header files conveniently define PR_MODEL_NATIVE to the
37 data model of the controlling process. If its value is
38 PR_MODEL_LP64, we know that GDB is being compiled as a 64-bit
41 GNU/Linux uses the same formats as Solaris for its core files (but
42 not for ptrace(2)). The GNU/Linux headers don't define
43 PR_MODEL_NATIVE though. Therefore we rely on the __arch64__ define
44 provided by GCC to determine the appropriate data model.
46 Note that a 32-bit GDB won't be able to debug a 64-bit target
47 process using /proc on Solaris. */
49 #if (defined (__arch64__) || \
50 (defined (PR_MODEL_NATIVE) && (PR_MODEL_NATIVE == PR_MODEL_LP64)))
52 #include "sparc64-tdep.h"
54 #define sparc_supply_gregset sparc64_supply_gregset
55 #define sparc_supply_fpregset sparc64_supply_fpregset
56 #define sparc_collect_gregset sparc64_collect_gregset
57 #define sparc_collect_fpregset sparc64_collect_fpregset
59 #define sparc_sol2_gregset sparc64_sol2_gregset
60 #define sparc_sol2_fpregset sparc64_sol2_fpregset
64 #define sparc_supply_gregset sparc32_supply_gregset
65 #define sparc_supply_fpregset sparc32_supply_fpregset
66 #define sparc_collect_gregset sparc32_collect_gregset
67 #define sparc_collect_fpregset sparc32_collect_fpregset
69 #define sparc_sol2_gregset sparc32_sol2_gregset
70 #define sparc_sol2_fpregset sparc32_sol2_fpregset
75 supply_gregset (struct regcache
*regcache
, const prgregset_t
*gregs
)
77 sparc_supply_gregset (&sparc_sol2_gregset
, regcache
, -1, gregs
);
81 supply_fpregset (struct regcache
*regcache
, const prfpregset_t
*fpregs
)
83 sparc_supply_fpregset (regcache
, -1, fpregs
);
87 fill_gregset (const struct regcache
*regcache
, prgregset_t
*gregs
, int regnum
)
89 sparc_collect_gregset (&sparc_sol2_gregset
, regcache
, regnum
, gregs
);
93 fill_fpregset (const struct regcache
*regcache
, prfpregset_t
*fpregs
, int regnum
)
95 sparc_collect_fpregset (regcache
, regnum
, fpregs
);
This page took 0.032475 seconds and 4 git commands to generate.