#include "target.h"
#include "annotate.h"
#endif
+#include "regcache.h"
+#include "gdb_assert.h"
#include "version.h"
return 0;
}
+CORE_ADDR
+generic_skip_trampoline_code (CORE_ADDR pc)
+{
+ return 0;
+}
+
+int
+generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ return 0;
+}
+
+int
+generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ return 0;
+}
+
char *
legacy_register_name (int i)
{
#endif
}
+/* New/multi-arched targets should use the correct gdbarch field
+ instead of using this global pointer. */
+int
+legacy_print_insn (bfd_vma vma, disassemble_info *info)
+{
+ return (*tm_print_insn) (vma, info);
+}
/* Helper functions for INNER_THAN */
CORE_ADDR
-default_convert_from_func_ptr_addr (CORE_ADDR addr)
+core_addr_identity (CORE_ADDR addr)
{
return addr;
}
return fi->frame;
}
+/* Default prepare_to_procced(). */
+int
+default_prepare_to_proceed (int select_it)
+{
+ return 0;
+}
+
+/* Generic prepare_to_proceed(). This one should be suitable for most
+ targets that support threads. */
+int
+generic_prepare_to_proceed (int select_it)
+{
+ ptid_t wait_ptid;
+ struct target_waitstatus wait_status;
+
+ /* Get the last target status returned by target_wait(). */
+ get_last_target_status (&wait_ptid, &wait_status);
+
+ /* Make sure we were stopped either at a breakpoint, or because
+ of a Ctrl-C. */
+ if (wait_status.kind != TARGET_WAITKIND_STOPPED
+ || (wait_status.value.sig != TARGET_SIGNAL_TRAP &&
+ wait_status.value.sig != TARGET_SIGNAL_INT))
+ {
+ return 0;
+ }
+
+ if (!ptid_equal (wait_ptid, minus_one_ptid)
+ && !ptid_equal (inferior_ptid, wait_ptid))
+ {
+ /* Switched over from WAIT_PID. */
+ CORE_ADDR wait_pc = read_pc_pid (wait_ptid);
+
+ if (wait_pc != read_pc ())
+ {
+ if (select_it)
+ {
+ /* Switch back to WAIT_PID thread. */
+ inferior_ptid = wait_ptid;
+
+ /* FIXME: This stuff came from switch_to_thread() in
+ thread.c (which should probably be a public function). */
+ flush_cached_frames ();
+ registers_changed ();
+ stop_pc = wait_pc;
+ select_frame (get_current_frame (), 0);
+ }
+ /* We return 1 to indicate that there is a breakpoint here,
+ so we need to step over it before continuing to avoid
+ hitting it straight away. */
+ if (breakpoint_here_p (wait_pc))
+ {
+ return 1;
+ }
+ }
+ }
+ return 0;
+
+}
+
+void
+init_frame_pc_noop (int fromleaf, struct frame_info *prev)
+{
+ return;
+}
+
+void
+init_frame_pc_default (int fromleaf, struct frame_info *prev)
+{
+ if (fromleaf)
+ prev->pc = SAVED_PC_AFTER_CALL (prev->next);
+ else if (prev->next != NULL)
+ prev->pc = FRAME_SAVED_PC (prev->next);
+ else
+ prev->pc = read_pc ();
+}
+
+int
+cannot_register_not (int regnum)
+{
+ return 0;
+}
+
+/* Legacy version of target_virtual_frame_pointer(). Assumes that
+ there is an FP_REGNUM and that it is the same, cooked or raw. */
+
+void
+legacy_virtual_frame_pointer (CORE_ADDR pc,
+ int *frame_regnum,
+ LONGEST *frame_offset)
+{
+ gdb_assert (FP_REGNUM >= 0);
+ *frame_regnum = FP_REGNUM;
+ *frame_offset = 0;
+}
+\f
/* Functions to manipulate the endianness of the target. */
#ifdef TARGET_BYTE_ORDER_SELECTABLE
show_architecture (NULL, from_tty);
}
-/* Called if the user enters ``info architecture'' without an argument. */
-
-static void
-info_architecture (char *args, int from_tty)
-{
- printf_filtered ("Available architectures are:\n");
- if (GDB_MULTI_ARCH)
- {
- const char **arches = gdbarch_printable_names ();
- const char **arch;
- for (arch = arches; *arch != NULL; arch++)
- {
- printf_filtered (" %s", *arch);
- }
- xfree (arches);
- }
- else
- {
- enum bfd_architecture a;
- for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
- {
- const struct bfd_arch_info *ap;
- for (ap = bfd_lookup_arch (a, 0);
- ap != NULL;
- ap = ap->next)
- {
- printf_filtered (" %s", ap->printable_name);
- ap = ap->next;
- }
- }
- }
- printf_filtered ("\n");
-}
-
/* Set the dynamic target-system-dependent parameters (architecture,
byte-order) using information found in the BFD */
"initialize_current_architecture: Selection of initial architecture failed");
}
}
+ else
+ initialize_non_multiarch ();
/* Create the ``set architecture'' command appending ``auto'' to the
list of architectures. */
current setting. */
add_cmd ("architecture", class_support, show_architecture,
"Show the current target architecture", &showlist);
- c = add_cmd ("architecture", class_support, info_architecture,
- "List supported target architectures", &infolist);
- deprecate_cmd (c, "set architecture");
}
}