return format[0]->name;
}
+static const char *
+pstring (const char *string)
+{
+ if (string == NULL)
+ return "(null)";
+ return string;
+}
+
/* Maintain the struct gdbarch object */
int has_global_breakpoints;
gdbarch_has_shared_address_space_ftype *has_shared_address_space;
gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
- const char * qsupported;
+ 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, /* has_global_breakpoints */
default_has_shared_address_space, /* has_shared_address_space */
default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
- 0, /* qsupported */
+ 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->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 */
/* 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 qsupported, 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: 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: push_dummy_code = <%s>\n",
host_address_to_string (gdbarch->push_dummy_code));
- fprintf_unfiltered (file,
- "gdbarch_dump: qsupported = %s\n",
- gdbarch->qsupported);
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_read_pc_p() = %d\n",
gdbarch_read_pc_p (gdbarch));
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));
}
const char *
-gdbarch_qsupported (struct gdbarch *gdbarch)
+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);
- /* Skip verify of qsupported, invalid_p == 0 */
+ gdb_assert (gdbarch->auto_wide_charset != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_qsupported called\n");
- return gdbarch->qsupported;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
+ return gdbarch->auto_wide_charset ();
}
void
-set_gdbarch_qsupported (struct gdbarch *gdbarch,
- const char * qsupported)
+set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
+ gdbarch_auto_wide_charset_ftype auto_wide_charset)
{
- gdbarch->qsupported = qsupported;
+ 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;
}
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."), _("\