#include "gdbcmd.h"
+/* Non-zero if we want to trace architecture code. */
+
+#ifndef GDBARCH_DEBUG
+#define GDBARCH_DEBUG 1
+#endif
+int gdbarch_debug = GDBARCH_DEBUG;
+
+
/* Functions to manipulate the endianness of the target. */
#ifdef TARGET_BYTE_ORDER_SELECTABLE
/* Functions to manipulate the architecture of the target */
int target_architecture_auto = 1;
-extern const bfd_arch_info_type bfd_default_arch_struct;
-const bfd_arch_info_type *target_architecture = &bfd_default_arch_struct;
-int (*target_architecture_hook) PARAMS ((const bfd_arch_info_type *ap));
+extern const struct bfd_arch_info bfd_default_arch_struct;
+const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
+int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap));
/* Do the real work of changing the current architecture */
static void
set_arch (arch)
- const bfd_arch_info_type *arch;
+ const struct bfd_arch_info *arch;
{
/* FIXME: Is it compatible with gdb? */
/* Check with the target on the setting */
int from_tty;
{
const char *arch;
- arch = target_architecture->printable_name;
+ arch = TARGET_ARCHITECTURE->printable_name;
if (target_architecture_auto)
printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
else
}
else
{
- const bfd_arch_info_type *arch = bfd_scan_arch (args);
+ const struct bfd_arch_info *arch = bfd_scan_arch (args);
if (arch != NULL)
set_arch (arch);
else
printf_filtered ("Available architectures are:\n");
for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
{
- const bfd_arch_info_type *ap = bfd_lookup_arch (a, 0);
+ const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0);
if (ap != NULL)
{
do
enum bfd_architecture arch;
unsigned long mach;
{
- const bfd_arch_info_type *wanted = bfd_lookup_arch (arch, mach);
+ const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
if (wanted != NULL)
set_arch (wanted);
else
set_architecture_from_file (abfd)
bfd *abfd;
{
- const bfd_arch_info_type *wanted = bfd_get_arch_info (abfd);
+ const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
if (target_architecture_auto)
{
if (target_architecture_hook != NULL
tm_print_insn_info.read_memory_func = dis_asm_read_memory;
tm_print_insn_info.memory_error_func = dis_asm_memory_error;
tm_print_insn_info.print_address_func = dis_asm_print_address;
+
+#ifdef MAINTENANCE_CMDS
+ add_show_from_set (add_set_cmd ("archdebug",
+ class_maintenance,
+ var_zinteger,
+ (char *)&gdbarch_debug,
+ "Set architecture debugging.\n\
+When non-zero, architecture debugging is enabled.", &setlist),
+ &showlist);
+#endif
}
#define GDBARCH_H
-/* The target-system-dependant byte order is dynmaic */
+/* The target-system-dependant byte order is dynamic */
/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
is selectable at runtime. The user can use the `set endian'
/* The target-system-dependant BFD architecture is dynamic */
extern int target_architecture_auto;
+#ifndef TARGET_ARCHITECTURE_AUTO
#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
+#endif
-extern const bfd_arch_info_type *target_architecture;
+extern const struct bfd_arch_info *target_architecture;
+#ifndef TARGET_ARCHITECTURE
#define TARGET_ARCHITECTURE (target_architecture + 0)
+#endif
/* Notify the target dependant backend of a change to the selected
architecture. A zero return status indicates that the target did
not like the change. */
-extern int (*target_architecture_hook) PARAMS ((const bfd_arch_info_type *));
+extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *));
extern void set_gdbarch_from_file PARAMS ((bfd *));
+
/* Explicitly set the dynamic target-system-dependant parameters based
on bfd_architecture and machine. */
extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
+
+/* gdbarch trace variable */
+extern int gdbarch_debug;
+
#endif