1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-2022 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
;
34 const gdb_byte
*sw_breakpoint_from_kind (int kind
, int *size
) override
;
38 void low_arch_setup () override
;
40 bool low_cannot_fetch_register (int regno
) override
;
42 bool low_cannot_store_register (int regno
) override
;
44 bool low_fetch_register (regcache
*regcache
, int regno
) override
;
46 bool low_breakpoint_at (CORE_ADDR pc
) override
;
49 /* The singleton target ops object. */
51 static ia64_target the_ia64_target
;
54 ia64_target::sw_breakpoint_from_kind (int kind
, int *size
)
56 gdb_assert_not_reached ("target op sw_breakpoint_from_kind is not "
57 "implemented by this target");
61 ia64_target::low_breakpoint_at (CORE_ADDR pc
)
63 gdb_assert_not_reached ("linux target op low_breakpoint_at is not "
64 "implemented by this target");
67 /* Defined in auto-generated file reg-ia64.c. */
68 void init_registers_ia64 (void);
69 extern const struct target_desc
*tdesc_ia64
;
71 #define ia64_num_regs 462
73 #include <asm/ptrace_offsets.h>
75 static int ia64_regmap
[] =
77 /* general registers */
78 -1, /* gr0 not available; i.e, it's always zero */
110 /* gr32 through gr127 not directly available via the ptrace interface */
111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
113 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
114 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
115 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
117 /* Floating point registers */
118 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
245 /* predicate registers - we don't fetch these individually */
246 -1, -1, -1, -1, -1, -1, -1, -1,
247 -1, -1, -1, -1, -1, -1, -1, -1,
248 -1, -1, -1, -1, -1, -1, -1, -1,
249 -1, -1, -1, -1, -1, -1, -1, -1,
250 -1, -1, -1, -1, -1, -1, -1, -1,
251 -1, -1, -1, -1, -1, -1, -1, -1,
252 -1, -1, -1, -1, -1, -1, -1, -1,
253 -1, -1, -1, -1, -1, -1, -1, -1,
254 /* branch registers */
263 /* virtual frame pointer and virtual return address pointer */
265 /* other registers */
268 PT_CR_IPSR
, /* psr */
270 /* kernel registers not visible via ptrace interface (?) */
271 -1, -1, -1, -1, -1, -1, -1, -1,
273 -1, -1, -1, -1, -1, -1, -1, -1,
279 -1, /* Not available: FCR, IA32 floating control register */
281 -1, /* Not available: EFLAG */
282 -1, /* Not available: CSD */
283 -1, /* Not available: SSD */
284 -1, /* Not available: CFLG */
285 -1, /* Not available: FSR */
286 -1, /* Not available: FIR */
287 -1, /* Not available: FDR */
295 -1, /* Not available: ITC */
296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
297 -1, -1, -1, -1, -1, -1, -1, -1, -1,
301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
303 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
304 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
305 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
306 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
311 ia64_target::low_cannot_store_register (int regno
)
317 ia64_target::low_cannot_fetch_register (int regno
)
322 /* GDB register numbers. */
323 #define IA64_GR0_REGNUM 0
324 #define IA64_FR0_REGNUM 128
325 #define IA64_FR1_REGNUM 129
328 ia64_target::low_fetch_register (regcache
*regcache
, int regnum
)
330 /* r0 cannot be fetched but is always zero. */
331 if (regnum
== IA64_GR0_REGNUM
)
333 const gdb_byte zero
[8] = { 0 };
335 gdb_assert (sizeof (zero
) == register_size (regcache
->tdesc
, regnum
));
336 supply_register (regcache
, regnum
, zero
);
340 /* fr0 cannot be fetched but is always zero. */
341 if (regnum
== IA64_FR0_REGNUM
)
343 const gdb_byte f_zero
[16] = { 0 };
345 gdb_assert (sizeof (f_zero
) == register_size (regcache
->tdesc
, regnum
));
346 supply_register (regcache
, regnum
, f_zero
);
350 /* fr1 cannot be fetched but is always one (1.0). */
351 if (regnum
== IA64_FR1_REGNUM
)
353 const gdb_byte f_one
[16] =
354 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
356 gdb_assert (sizeof (f_one
) == register_size (regcache
->tdesc
, regnum
));
357 supply_register (regcache
, regnum
, f_one
);
364 static struct usrregs_info ia64_usrregs_info
=
370 static struct regs_info myregs_info
=
372 NULL
, /* regset_bitmap */
377 ia64_target::get_regs_info ()
383 ia64_target::low_arch_setup ()
385 current_process ()->tdesc
= tdesc_ia64
;
388 /* The linux target ops object. */
390 linux_process_target
*the_linux_target
= &the_ia64_target
;
393 initialize_low_arch (void)
395 init_registers_ia64 ();