/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright (C) 1998-2014 Free Software Foundation, Inc.
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
This file is part of GDB.
#include "buildsym.h"
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et al. */
-#include <string.h>
+#include "infrun.h"
#include "regcache.h"
-#include "gdb_assert.h"
#include "sim-regno.h"
#include "gdbcore.h"
#include "osabi.h"
#include "target-descriptions.h"
#include "objfiles.h"
#include "language.h"
+#include "symtab.h"
#include "version.h"
}
int
-generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+generic_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
return 0;
}
}
void
-default_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
+default_coff_make_msymbol_special (int val, struct minimal_symbol *msym)
{
return;
}
+/* See arch-utils.h. */
+
void
-default_coff_make_msymbol_special (int val, struct minimal_symbol *msym)
+default_make_symbol_special (struct symbol *sym, struct objfile *objfile)
{
return;
}
+/* See arch-utils.h. */
+
+CORE_ADDR
+default_adjust_dwarf2_addr (CORE_ADDR pc)
+{
+ return pc;
+}
+
+/* See arch-utils.h. */
+
+CORE_ADDR
+default_adjust_dwarf2_line (CORE_ADDR addr, int rel)
+{
+ return addr;
+}
+
int
cannot_register_not (struct gdbarch *gdbarch, int regnum)
{
return regno;
}
+/* See arch-utils.h. */
+
+int
+default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range)
+{
+ return 0;
+}
+
\f
/* Functions to manipulate the endianness of the target. */
chp = strchr (target_name, '-');
if (chp != NULL
&& chp - 2 >= target_name
- && strncmp (chp - 2, "el", 2) == 0)
+ && startswith (chp - 2, "el"))
default_byte_order = BFD_ENDIAN_LITTLE;
}
if (default_byte_order == BFD_ENDIAN_UNKNOWN)
return 0;
}
-/* */
+void
+default_skip_permanent_breakpoint (struct regcache *regcache)
+{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ CORE_ADDR current_pc = regcache_read_pc (regcache);
+ const gdb_byte *bp_insn;
+ int bp_len;
+
+ bp_insn = gdbarch_breakpoint_from_pc (gdbarch, ¤t_pc, &bp_len);
+ current_pc += bp_len;
+ regcache_write_pc (regcache, current_pc);
+}
+
+CORE_ADDR
+default_infcall_mmap (CORE_ADDR size, unsigned prot)
+{
+ error (_("This target does not support inferior memory allocation by mmap."));
+}
+
+void
+default_infcall_munmap (CORE_ADDR addr, CORE_ADDR size)
+{
+ /* Memory reserved by inferior mmap is kept leaked. */
+}
+
+/* -mcmodel=large is used so that no GOT (Global Offset Table) is needed to be
+ created in inferior memory by GDB (normally it is set by ld.so). */
+
+char *
+default_gcc_target_options (struct gdbarch *gdbarch)
+{
+ return xstrprintf ("-m%d%s", gdbarch_ptr_bit (gdbarch),
+ gdbarch_ptr_bit (gdbarch) == 64 ? " -mcmodel=large" : "");
+}
+
+/* gdbarch gnu_triplet_regexp method. */
+
+const char *
+default_gnu_triplet_regexp (struct gdbarch *gdbarch)
+{
+ return gdbarch_bfd_arch_info (gdbarch)->arch_name;
+}
+
+/* Default method for gdbarch_addressable_memory_unit_size. By default, a memory byte has
+ a size of 1 octet. */
+
+int
+default_addressable_memory_unit_size (struct gdbarch *gdbarch)
+{
+ return 1;
+}
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_gdbarch_utils;