1 /* Target-dependent code for OpenBSD/mips64.
3 Copyright 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. */
27 #include "gdb_string.h"
29 #include "mips-tdep.h"
30 #include "solib-svr4.h"
32 #define MIPS64OBSD_NUM_REGS 73
34 /* Core file support. */
36 /* Supply register REGNUM from the buffer specified by GREGS and LEN
37 in the general-purpose register set REGSET to register cache
38 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
41 mips64obsd_supply_gregset (const struct regset
*regset
,
42 struct regcache
*regcache
, int regnum
,
43 const void *gregs
, size_t len
)
45 const char *regs
= gregs
;
48 for (i
= 0; i
< MIPS64OBSD_NUM_REGS
; i
++)
50 if (regnum
== i
|| regnum
== -1)
51 regcache_raw_supply (regcache
, i
, regs
+ i
* 8);
55 /* OpenBSD/mips64 register set. */
57 static struct regset mips64obsd_gregset
=
60 mips64obsd_supply_gregset
63 /* Return the appropriate register set for the core section identified
64 by SECT_NAME and SECT_SIZE. */
66 static const struct regset
*
67 mips64obsd_regset_from_core_section (struct gdbarch
*gdbarch
,
68 const char *sect_name
, size_t sect_size
)
70 if (strcmp (sect_name
, ".reg") == 0 && sect_size
>= MIPS64OBSD_NUM_REGS
* 8)
71 return &mips64obsd_gregset
;
78 mips64obsd_init_abi (struct gdbarch_info info
, struct gdbarch
*gdbarch
)
80 set_gdbarch_regset_from_core_section
81 (gdbarch
, mips64obsd_regset_from_core_section
);
83 set_gdbarch_software_single_step (gdbarch
, mips_software_single_step
);
85 set_solib_svr4_fetch_link_map_offsets
86 (gdbarch
, svr4_lp64_fetch_link_map_offsets
);
90 /* Provide a prototype to silence -Wmissing-prototypes. */
91 void _initialize_mips64obsd_tdep (void);
94 _initialize_mips64obsd_tdep (void)
96 gdbarch_register_osabi (bfd_arch_mips
, 0, GDB_OSABI_OPENBSD_ELF
,