1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-2024 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/>. */
19 #include "linux-low.h"
25 /* Linux target op definitions for the IA64 architecture. */
27 class ia64_target
: public linux_process_target
31 const regs_info
*get_regs_info () override
;
33 const gdb_byte
*sw_breakpoint_from_kind (int kind
, int *size
) override
;
37 void low_arch_setup () override
;
39 bool low_cannot_fetch_register (int regno
) override
;
41 bool low_cannot_store_register (int regno
) override
;
43 bool low_fetch_register (regcache
*regcache
, int regno
) override
;
45 bool low_breakpoint_at (CORE_ADDR pc
) override
;
48 /* The singleton target ops object. */
50 static ia64_target the_ia64_target
;
53 ia64_target::sw_breakpoint_from_kind (int kind
, int *size
)
55 gdb_assert_not_reached ("target op sw_breakpoint_from_kind is not "
56 "implemented by this target");
60 ia64_target::low_breakpoint_at (CORE_ADDR pc
)
62 gdb_assert_not_reached ("linux target op low_breakpoint_at is not "
63 "implemented by this target");
66 /* Defined in auto-generated file reg-ia64.c. */
67 void init_registers_ia64 (void);
68 extern const struct target_desc
*tdesc_ia64
;
70 #define ia64_num_regs 462
72 #include <asm/ptrace_offsets.h>
74 static int ia64_regmap
[] =
76 /* general registers */
77 -1, /* gr0 not available; i.e, it's always zero */
109 /* gr32 through gr127 not directly available via the ptrace interface */
110 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
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 /* Floating point registers */
117 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
244 /* predicate registers - we don't fetch these individually */
245 -1, -1, -1, -1, -1, -1, -1, -1,
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 /* branch registers */
262 /* virtual frame pointer and virtual return address pointer */
264 /* other registers */
267 PT_CR_IPSR
, /* psr */
269 /* kernel registers not visible via ptrace interface (?) */
270 -1, -1, -1, -1, -1, -1, -1, -1,
272 -1, -1, -1, -1, -1, -1, -1, -1,
278 -1, /* Not available: FCR, IA32 floating control register */
280 -1, /* Not available: EFLAG */
281 -1, /* Not available: CSD */
282 -1, /* Not available: SSD */
283 -1, /* Not available: CFLG */
284 -1, /* Not available: FSR */
285 -1, /* Not available: FIR */
286 -1, /* Not available: FDR */
294 -1, /* Not available: ITC */
295 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
296 -1, -1, -1, -1, -1, -1, -1, -1, -1,
300 -1, -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,
310 ia64_target::low_cannot_store_register (int regno
)
316 ia64_target::low_cannot_fetch_register (int regno
)
321 /* GDB register numbers. */
322 #define IA64_GR0_REGNUM 0
323 #define IA64_FR0_REGNUM 128
324 #define IA64_FR1_REGNUM 129
327 ia64_target::low_fetch_register (regcache
*regcache
, int regnum
)
329 /* r0 cannot be fetched but is always zero. */
330 if (regnum
== IA64_GR0_REGNUM
)
332 const gdb_byte zero
[8] = { 0 };
334 gdb_assert (sizeof (zero
) == register_size (regcache
->tdesc
, regnum
));
335 supply_register (regcache
, regnum
, zero
);
339 /* fr0 cannot be fetched but is always zero. */
340 if (regnum
== IA64_FR0_REGNUM
)
342 const gdb_byte f_zero
[16] = { 0 };
344 gdb_assert (sizeof (f_zero
) == register_size (regcache
->tdesc
, regnum
));
345 supply_register (regcache
, regnum
, f_zero
);
349 /* fr1 cannot be fetched but is always one (1.0). */
350 if (regnum
== IA64_FR1_REGNUM
)
352 const gdb_byte f_one
[16] =
353 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
355 gdb_assert (sizeof (f_one
) == register_size (regcache
->tdesc
, regnum
));
356 supply_register (regcache
, regnum
, f_one
);
363 static struct usrregs_info ia64_usrregs_info
=
369 static struct regs_info myregs_info
=
371 NULL
, /* regset_bitmap */
376 ia64_target::get_regs_info ()
382 ia64_target::low_arch_setup ()
384 current_process ()->tdesc
= tdesc_ia64
;
387 /* The linux target ops object. */
389 linux_process_target
*the_linux_target
= &the_ia64_target
;
392 initialize_low_arch (void)
394 init_registers_ia64 ();