1 /* Native-dependent code for Solaris SPARC.
3 Copyright 2003, 2004 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 2 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, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
25 #include <sys/procfs.h>
28 #include "sparc-tdep.h"
30 /* This file provids the (temporary) glue between the Solaris SPARC
31 target dependent code and the machine independent SVR4 /proc
34 /* Solaris 7 (Solaris 2.7, SunOS 5.7) and up support two process data
35 models, the traditional 32-bit data model (ILP32) and the 64-bit
36 data model (LP64). The format of /proc depends on the data model
37 of the observer (the controlling process, GDB in our case). The
38 Solaris header files conveniently define PR_MODEL_NATIVE to the
39 data model of the controlling process. If its value is
40 PR_MODEL_LP64, we know that GDB is being compiled as a 64-bit
43 GNU/Linux uses the same formats as Solaris for its core files (but
44 not for ptrace(2)). The GNU/Linux headers don't define
45 PR_MODEL_NATIVE though. Therefore we rely on the __arch64__ define
46 provided by GCC to determine the appropriate data model.
48 Note that a 32-bit GDB won't be able to debug a 64-bit target
49 process using /proc on Solaris. */
51 #if (defined (__arch64__) || \
52 (defined (PR_MODEL_NATIVE) && (PR_MODEL_NATIVE == PR_MODEL_LP64)))
54 #include "sparc64-tdep.h"
56 #define sparc_supply_gregset sparc64_supply_gregset
57 #define sparc_supply_fpregset sparc64_supply_fpregset
58 #define sparc_collect_gregset sparc64_collect_gregset
59 #define sparc_collect_fpregset sparc64_collect_fpregset
61 #define sparc_sol2_gregset sparc64_sol2_gregset
62 #define sparc_sol2_fpregset sparc64_sol2_fpregset
66 #define sparc_supply_gregset sparc32_supply_gregset
67 #define sparc_supply_fpregset sparc32_supply_fpregset
68 #define sparc_collect_gregset sparc32_collect_gregset
69 #define sparc_collect_fpregset sparc32_collect_fpregset
71 #define sparc_sol2_gregset sparc32_sol2_gregset
72 #define sparc_sol2_fpregset sparc32_sol2_fpregset
77 supply_gregset (prgregset_t
*gregs
)
79 sparc_supply_gregset (&sparc_sol2_gregset
, current_regcache
, -1, gregs
);
83 supply_fpregset (prfpregset_t
*fpregs
)
85 sparc_supply_fpregset (current_regcache
, -1, fpregs
);
89 fill_gregset (prgregset_t
*gregs
, int regnum
)
91 sparc_collect_gregset (&sparc_sol2_gregset
, current_regcache
, regnum
, gregs
);
95 fill_fpregset (prfpregset_t
*fpregs
, int regnum
)
97 sparc_collect_fpregset (current_regcache
, regnum
, fpregs
);
This page took 0.031516 seconds and 4 git commands to generate.