]>
Commit | Line | Data |
---|---|---|
386c036b MK |
1 | /* Native-dependent code for Solaris SPARC. |
2 | ||
1d506c26 | 3 | Copyright (C) 2003-2024 Free Software Foundation, Inc. |
386c036b MK |
4 | |
5 | This file is part of GDB. | |
6 | ||
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 | |
a9762ec7 | 9 | the Free Software Foundation; either version 3 of the License, or |
386c036b MK |
10 | (at your option) any later version. |
11 | ||
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. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
386c036b | 19 | |
386c036b MK |
20 | #include "regcache.h" |
21 | ||
22 | #include <sys/procfs.h> | |
23 | #include "gregset.h" | |
24 | ||
25 | #include "sparc-tdep.h" | |
d1a7880c PA |
26 | #include "target.h" |
27 | #include "procfs.h" | |
386c036b MK |
28 | |
29 | /* This file provids the (temporary) glue between the Solaris SPARC | |
30 | target dependent code and the machine independent SVR4 /proc | |
31 | support. */ | |
32 | ||
33 | /* Solaris 7 (Solaris 2.7, SunOS 5.7) and up support two process data | |
34 | models, the traditional 32-bit data model (ILP32) and the 64-bit | |
35 | data model (LP64). The format of /proc depends on the data model | |
36 | of the observer (the controlling process, GDB in our case). The | |
37 | Solaris header files conveniently define PR_MODEL_NATIVE to the | |
38 | data model of the controlling process. If its value is | |
39 | PR_MODEL_LP64, we know that GDB is being compiled as a 64-bit | |
40 | program. | |
41 | ||
386c036b MK |
42 | Note that a 32-bit GDB won't be able to debug a 64-bit target |
43 | process using /proc on Solaris. */ | |
44 | ||
c475f569 | 45 | #if PR_MODEL_NATIVE == PR_MODEL_LP64 |
386c036b MK |
46 | |
47 | #include "sparc64-tdep.h" | |
48 | ||
49 | #define sparc_supply_gregset sparc64_supply_gregset | |
50 | #define sparc_supply_fpregset sparc64_supply_fpregset | |
51 | #define sparc_collect_gregset sparc64_collect_gregset | |
52 | #define sparc_collect_fpregset sparc64_collect_fpregset | |
53 | ||
b4fd25c9 AA |
54 | #define sparc_sol2_gregmap sparc64_sol2_gregmap |
55 | #define sparc_sol2_fpregmap sparc64_sol2_fpregmap | |
386c036b MK |
56 | |
57 | #else | |
58 | ||
59 | #define sparc_supply_gregset sparc32_supply_gregset | |
60 | #define sparc_supply_fpregset sparc32_supply_fpregset | |
61 | #define sparc_collect_gregset sparc32_collect_gregset | |
62 | #define sparc_collect_fpregset sparc32_collect_fpregset | |
63 | ||
b4fd25c9 AA |
64 | #define sparc_sol2_gregmap sparc32_sol2_gregmap |
65 | #define sparc_sol2_fpregmap sparc32_sol2_fpregmap | |
386c036b MK |
66 | |
67 | #endif | |
68 | ||
69 | void | |
7f7fe91e | 70 | supply_gregset (struct regcache *regcache, const prgregset_t *gregs) |
386c036b | 71 | { |
b4fd25c9 | 72 | sparc_supply_gregset (&sparc_sol2_gregmap, regcache, -1, gregs); |
386c036b MK |
73 | } |
74 | ||
75 | void | |
7f7fe91e | 76 | supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs) |
386c036b | 77 | { |
b4fd25c9 | 78 | sparc_supply_fpregset (&sparc_sol2_fpregmap, regcache, -1, fpregs); |
386c036b MK |
79 | } |
80 | ||
81 | void | |
7f7fe91e | 82 | fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum) |
386c036b | 83 | { |
b4fd25c9 | 84 | sparc_collect_gregset (&sparc_sol2_gregmap, regcache, regnum, gregs); |
386c036b MK |
85 | } |
86 | ||
87 | void | |
c378eb4e MS |
88 | fill_fpregset (const struct regcache *regcache, |
89 | prfpregset_t *fpregs, int regnum) | |
386c036b | 90 | { |
b4fd25c9 | 91 | sparc_collect_fpregset (&sparc_sol2_fpregmap, regcache, regnum, fpregs); |
386c036b | 92 | } |