return format[0]->name;
}
+static const char *
+pstring (const char *string)
+{
+ if (string == NULL)
+ return "(null)";
+ return string;
+}
+
/* Maintain the struct gdbarch object */
gdbarch_skip_main_prologue_ftype *skip_main_prologue;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
+ gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
gdbarch_displaced_step_location_ftype *displaced_step_location;
+ gdbarch_relocate_instruction_ftype *relocate_instruction;
gdbarch_overlay_update_ftype *overlay_update;
gdbarch_core_read_description_ftype *core_read_description;
gdbarch_static_transform_name_ftype *static_transform_name;
int has_global_solist;
int has_global_breakpoints;
gdbarch_has_shared_address_space_ftype *has_shared_address_space;
+ gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
+ gdbarch_auto_charset_ftype *auto_charset;
+ gdbarch_auto_wide_charset_ftype *auto_wide_charset;
+ const char * solib_symbols_extension;
+ int has_dos_based_file_system;
};
0, /* skip_main_prologue */
0, /* inner_than */
0, /* breakpoint_from_pc */
+ default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
0, /* adjust_breakpoint_address */
default_memory_insert_breakpoint, /* memory_insert_breakpoint */
default_memory_remove_breakpoint, /* memory_remove_breakpoint */
0, /* displaced_step_fixup */
NULL, /* displaced_step_free_closure */
NULL, /* displaced_step_location */
+ 0, /* relocate_instruction */
0, /* overlay_update */
0, /* core_read_description */
0, /* static_transform_name */
0, /* has_global_solist */
0, /* has_global_breakpoints */
default_has_shared_address_space, /* has_shared_address_space */
+ default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
+ default_auto_charset, /* auto_charset */
+ default_auto_wide_charset, /* auto_wide_charset */
+ 0, /* solib_symbols_extension */
+ 0, /* has_dos_based_file_system */
/* startup_gdbarch() */
};
gdbarch->value_from_register = default_value_from_register;
gdbarch->pointer_to_address = unsigned_pointer_to_address;
gdbarch->address_to_pointer = unsigned_address_to_pointer;
+ gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
gdbarch->remote_register_number = default_remote_register_number;
gdbarch->displaced_step_fixup = NULL;
gdbarch->displaced_step_free_closure = NULL;
gdbarch->displaced_step_location = NULL;
+ gdbarch->relocate_instruction = NULL;
gdbarch->target_signal_from_host = default_target_signal_from_host;
gdbarch->target_signal_to_host = default_target_signal_to_host;
gdbarch->has_shared_address_space = default_has_shared_address_space;
+ gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
+ gdbarch->auto_charset = default_auto_charset;
+ gdbarch->auto_wide_charset = default_auto_wide_charset;
/* gdbarch_alloc() */
return gdbarch;
gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
{
void *data = obstack_alloc (arch->obstack, size);
+
memset (data, 0, size);
return data;
}
gdbarch_free (struct gdbarch *arch)
{
struct obstack *obstack;
+
gdb_assert (arch != NULL);
gdb_assert (!arch->initialized_p);
obstack = arch->obstack;
struct cleanup *cleanups;
long length;
char *buf;
+
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
/* fundamental */
fprintf_unfiltered (log, "\n\tinner_than");
if (gdbarch->breakpoint_from_pc == 0)
fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
+ /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
/* Skip verify of adjust_breakpoint_address, has predicate */
/* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
fprintf_unfiltered (log, "\n\tdisplaced_step_location");
+ /* Skip verify of relocate_instruction, has predicate */
/* Skip verify of overlay_update, has predicate */
/* Skip verify of core_read_description, has predicate */
/* Skip verify of static_transform_name, has predicate */
/* Skip verify of has_global_solist, invalid_p == 0 */
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
/* Skip verify of has_shared_address_space, invalid_p == 0 */
+ /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
+ /* Skip verify of auto_charset, invalid_p == 0 */
+ /* Skip verify of auto_wide_charset, invalid_p == 0 */
+ /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
{
const char *gdb_nm_file = "<not-defined>";
+
#if defined (GDB_NM_FILE)
gdb_nm_file = GDB_NM_FILE;
#endif
fprintf_unfiltered (file,
"gdbarch_dump: adjust_breakpoint_address = <%s>\n",
host_address_to_string (gdbarch->adjust_breakpoint_address));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: auto_charset = <%s>\n",
+ host_address_to_string (gdbarch->auto_charset));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: auto_wide_charset = <%s>\n",
+ host_address_to_string (gdbarch->auto_wide_charset));
fprintf_unfiltered (file,
"gdbarch_dump: believe_pcc_promotion = %s\n",
plongest (gdbarch->believe_pcc_promotion));
fprintf_unfiltered (file,
"gdbarch_dump: elf_make_msymbol_special = <%s>\n",
host_address_to_string (gdbarch->elf_make_msymbol_special));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
+ host_address_to_string (gdbarch->fast_tracepoint_valid_at));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
gdbarch_fetch_pointer_argument_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: get_syscall_number = <%s>\n",
host_address_to_string (gdbarch->get_syscall_number));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: has_dos_based_file_system = %s\n",
+ plongest (gdbarch->has_dos_based_file_system));
fprintf_unfiltered (file,
"gdbarch_dump: has_global_breakpoints = %s\n",
plongest (gdbarch->has_global_breakpoints));
fprintf_unfiltered (file,
"gdbarch_dump: regset_from_core_section = <%s>\n",
host_address_to_string (gdbarch->regset_from_core_section));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
+ gdbarch_relocate_instruction_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: relocate_instruction = <%s>\n",
+ host_address_to_string (gdbarch->relocate_instruction));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
+ host_address_to_string (gdbarch->remote_breakpoint_from_pc));
fprintf_unfiltered (file,
"gdbarch_dump: remote_register_number = <%s>\n",
host_address_to_string (gdbarch->remote_register_number));
fprintf_unfiltered (file,
"gdbarch_dump: sofun_address_maybe_missing = %s\n",
plongest (gdbarch->sofun_address_maybe_missing));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: solib_symbols_extension = %s\n",
+ pstring (gdbarch->solib_symbols_extension));
fprintf_unfiltered (file,
"gdbarch_dump: sp_regnum = %s\n",
plongest (gdbarch->sp_regnum));
gdbarch->breakpoint_from_pc = breakpoint_from_pc;
}
+void
+gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
+ gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
+}
+
+void
+set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
+ gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
+{
+ gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
+}
+
int
gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
{
gdbarch->displaced_step_location = displaced_step_location;
}
+int
+gdbarch_relocate_instruction_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->relocate_instruction != NULL;
+}
+
+void
+gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->relocate_instruction != NULL);
+ /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n");
+ gdbarch->relocate_instruction (gdbarch, to, from);
+}
+
+void
+set_gdbarch_relocate_instruction (struct gdbarch *gdbarch,
+ gdbarch_relocate_instruction_ftype relocate_instruction)
+{
+ gdbarch->relocate_instruction = relocate_instruction;
+}
+
int
gdbarch_overlay_update_p (struct gdbarch *gdbarch)
{
gdbarch->has_shared_address_space = has_shared_address_space;
}
+int
+gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
+ return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
+}
+
+void
+set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
+ gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
+{
+ gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
+}
+
+const char *
+gdbarch_auto_charset (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->auto_charset != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
+ return gdbarch->auto_charset ();
+}
+
+void
+set_gdbarch_auto_charset (struct gdbarch *gdbarch,
+ gdbarch_auto_charset_ftype auto_charset)
+{
+ gdbarch->auto_charset = auto_charset;
+}
+
+const char *
+gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->auto_wide_charset != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
+ return gdbarch->auto_wide_charset ();
+}
+
+void
+set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
+ gdbarch_auto_wide_charset_ftype auto_wide_charset)
+{
+ gdbarch->auto_wide_charset = auto_wide_charset;
+}
+
+const char *
+gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
+ return gdbarch->solib_symbols_extension;
+}
+
+void
+set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
+ const char * solib_symbols_extension)
+{
+ gdbarch->solib_symbols_extension = solib_symbols_extension;
+}
+
+int
+gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
+ return gdbarch->has_dos_based_file_system;
+}
+
+void
+set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
+ int has_dos_based_file_system)
+{
+ gdbarch->has_dos_based_file_system = has_dos_based_file_system;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
gdbarch_data_post_init_ftype *post_init)
{
struct gdbarch_data_registration **curr;
- /* Append the new registraration. */
+
+ /* Append the new registration. */
for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
{
/* Accumulate a list of names based on the registed list of
architectures. */
- enum bfd_architecture a;
int nr_arches = 0;
const char **arches = NULL;
struct gdbarch_registration *rego;
+
for (rego = gdbarch_registry;
rego != NULL;
rego = rego->next)
{
struct gdbarch_registration **curr;
const struct bfd_arch_info *bfd_arch_info;
+
/* Check that BFD recognizes this architecture */
bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
if (bfd_arch_info == NULL)
void
_initialize_gdbarch (void)
{
- struct cmd_list_element *c;
-
add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
Set architecture debugging."), _("\
Show architecture debugging."), _("\