blob: d40852aa223b814318433a8cf9b540a1cfe3eaf5 [file] [log] [blame]
/* Target-dependent code for Fuchsia x86-64.
Copyright (C) 2001-2016 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
#include "regcache.h"
#include "osabi.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "reggroups.h"
#include "regset.h"
#include "parser-defs.h"
#include "user-regs.h"
#include "amd64-fuchsia-tdep.h"
#include "fuchsia-tdep.h"
#include "amd64-tdep.h"
static int
amd64_fuchsia_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
{
return i386_register_reggroup_p (gdbarch, regnum, group);
}
static void
amd64_fuchsia_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
const struct target_desc *tdesc = info.target_desc;
struct tdesc_arch_data *tdesc_data
= (struct tdesc_arch_data *) info.tdep_info;
gdb_assert (tdesc_data);
amd64_init_abi (info, gdbarch);
fuchsia_init_abi (info, gdbarch);
tdep->register_reggroup_p = amd64_fuchsia_register_reggroup_p;
/* Displaced stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch,
amd64_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup);
set_gdbarch_displaced_step_free_closure (gdbarch,
simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
fuchsia_displaced_step_location);
// TODO:
// - set_gdbarch_handle_segmentation_fault
// to display extra info for MPX boundary violations.
}
/* Provide a prototype to silence -Wmissing-prototypes. */
extern void _initialize_amd64_fuchsia_tdep (void);
void
_initialize_amd64_fuchsia_tdep (void)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
fuchsia_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_FUCHSIA, amd64_fuchsia_init_abi);
}