1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-2020 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #include "linux-low.h"
26 /* Linux target op definitions for the IA64 architecture. */
28 class ia64_target
: public linux_process_target
32 const regs_info
*get_regs_info () override
;
36 void low_arch_setup () override
;
38 bool low_cannot_fetch_register (int regno
) override
;
40 bool low_cannot_store_register (int regno
) override
;
42 bool low_fetch_register (regcache
*regcache
, int regno
) override
;
45 /* The singleton target ops object. */
47 static ia64_target the_ia64_target
;
49 /* Defined in auto-generated file reg-ia64.c. */
50 void init_registers_ia64 (void);
51 extern const struct target_desc
*tdesc_ia64
;
53 #define ia64_num_regs 462
55 #include <asm/ptrace_offsets.h>
57 static int ia64_regmap
[] =
59 /* general registers */
60 -1, /* gr0 not available; i.e, it's always zero */
92 /* gr32 through gr127 not directly available via the ptrace interface */
93 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
94 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
95 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
96 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
97 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
98 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
99 /* Floating point registers */
100 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
227 /* predicate registers - we don't fetch these individually */
228 -1, -1, -1, -1, -1, -1, -1, -1,
229 -1, -1, -1, -1, -1, -1, -1, -1,
230 -1, -1, -1, -1, -1, -1, -1, -1,
231 -1, -1, -1, -1, -1, -1, -1, -1,
232 -1, -1, -1, -1, -1, -1, -1, -1,
233 -1, -1, -1, -1, -1, -1, -1, -1,
234 -1, -1, -1, -1, -1, -1, -1, -1,
235 -1, -1, -1, -1, -1, -1, -1, -1,
236 /* branch registers */
245 /* virtual frame pointer and virtual return address pointer */
247 /* other registers */
250 PT_CR_IPSR
, /* psr */
252 /* kernel registers not visible via ptrace interface (?) */
253 -1, -1, -1, -1, -1, -1, -1, -1,
255 -1, -1, -1, -1, -1, -1, -1, -1,
261 -1, /* Not available: FCR, IA32 floating control register */
263 -1, /* Not available: EFLAG */
264 -1, /* Not available: CSD */
265 -1, /* Not available: SSD */
266 -1, /* Not available: CFLG */
267 -1, /* Not available: FSR */
268 -1, /* Not available: FIR */
269 -1, /* Not available: FDR */
277 -1, /* Not available: ITC */
278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
279 -1, -1, -1, -1, -1, -1, -1, -1, -1,
283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
285 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
287 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
288 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
293 ia64_target::low_cannot_store_register (int regno
)
299 ia64_target::low_cannot_fetch_register (int regno
)
304 /* GDB register numbers. */
305 #define IA64_GR0_REGNUM 0
306 #define IA64_FR0_REGNUM 128
307 #define IA64_FR1_REGNUM 129
310 ia64_target::low_fetch_register (regcache
*regcache
, int regnum
)
312 /* r0 cannot be fetched but is always zero. */
313 if (regnum
== IA64_GR0_REGNUM
)
315 const gdb_byte zero
[8] = { 0 };
317 gdb_assert (sizeof (zero
) == register_size (regcache
->tdesc
, regnum
));
318 supply_register (regcache
, regnum
, zero
);
322 /* fr0 cannot be fetched but is always zero. */
323 if (regnum
== IA64_FR0_REGNUM
)
325 const gdb_byte f_zero
[16] = { 0 };
327 gdb_assert (sizeof (f_zero
) == register_size (regcache
->tdesc
, regnum
));
328 supply_register (regcache
, regnum
, f_zero
);
332 /* fr1 cannot be fetched but is always one (1.0). */
333 if (regnum
== IA64_FR1_REGNUM
)
335 const gdb_byte f_one
[16] =
336 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
338 gdb_assert (sizeof (f_one
) == register_size (regcache
->tdesc
, regnum
));
339 supply_register (regcache
, regnum
, f_one
);
346 static struct usrregs_info ia64_usrregs_info
=
352 static struct regs_info myregs_info
=
354 NULL
, /* regset_bitmap */
359 ia64_target::get_regs_info ()
365 ia64_target::low_arch_setup ()
367 current_process ()->tdesc
= tdesc_ia64
;
371 struct linux_target_ops the_low_target
= {
374 /* The linux target ops object. */
376 linux_process_target
*the_linux_target
= &the_ia64_target
;
379 initialize_low_arch (void)
381 init_registers_ia64 ();