+/* Return "current" architecture. If the target is running, this is
+ the architecture of the selected frame. Otherwise, the "current"
+ architecture defaults to the target architecture.
+
+ This function should normally be called solely by the command
+ interpreter routines to determine the architecture to execute a
+ command in. */
+struct gdbarch *
+get_current_arch (void)
+{
+ if (has_stack_frames ())
+ return get_frame_arch (get_selected_frame (NULL));
+ else
+ return target_gdbarch ();
+}
+
+int
+default_has_shared_address_space (struct gdbarch *gdbarch)
+{
+ /* Simply say no. In most unix-like targets each inferior/process
+ has its own address space. */
+ return 0;
+}
+
+int
+default_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr,
+ char **msg)
+{
+ /* We don't know if maybe the target has some way to do fast
+ tracepoints that doesn't need gdbarch, so always say yes. */
+ if (msg)
+ *msg = NULL;
+ return 1;
+}
+
+void
+default_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
+ int *kindptr)
+{
+ gdbarch_breakpoint_from_pc (gdbarch, pcptr, kindptr);
+}
+
+void
+default_gen_return_address (struct gdbarch *gdbarch,
+ struct agent_expr *ax, struct axs_value *value,
+ CORE_ADDR scope)
+{
+ error (_("This architecture has no method to collect a return address."));
+}
+
+int
+default_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+ struct type *type)
+{
+ /* Usually, the return value's address is stored the in the "first hidden"
+ parameter if the return value should be passed by reference, as
+ specified in ABI. */
+ return language_pass_by_reference (type);
+}
+
+int default_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ return 0;
+}
+
+int default_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ return 0;
+}
+
+int default_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ 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;
+}