#include "gdb_obstack.h"
#include "observer.h"
#include "regcache.h"
+#include "objfiles.h"
/* Static function declarations */
int sofun_address_maybe_missing;
gdbarch_process_record_ftype *process_record;
gdbarch_process_record_signal_ftype *process_record_signal;
- gdbarch_gdb_signal_from_host_ftype *gdb_signal_from_host;
+ gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target;
gdbarch_get_siginfo_type_ftype *get_siginfo_type;
gdbarch_record_special_symbol_ftype *record_special_symbol;
gdbarch_get_syscall_number_ftype *get_syscall_number;
int has_dos_based_file_system;
gdbarch_gen_return_address_ftype *gen_return_address;
gdbarch_info_proc_ftype *info_proc;
+ gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order;
};
0, /* sofun_address_maybe_missing */
0, /* process_record */
0, /* process_record_signal */
- default_gdb_signal_from_host, /* gdb_signal_from_host */
+ 0, /* gdb_signal_from_target */
0, /* get_siginfo_type */
0, /* record_special_symbol */
0, /* get_syscall_number */
0, /* has_dos_based_file_system */
default_gen_return_address, /* gen_return_address */
0, /* info_proc */
+ default_iterate_over_objfiles_in_search_order, /* iterate_over_objfiles_in_search_order */
/* startup_gdbarch() */
};
gdbarch->displaced_step_free_closure = NULL;
gdbarch->displaced_step_location = NULL;
gdbarch->relocate_instruction = NULL;
- gdbarch->gdb_signal_from_host = default_gdb_signal_from_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->gen_return_address = default_gen_return_address;
+ gdbarch->iterate_over_objfiles_in_search_order = default_iterate_over_objfiles_in_search_order;
/* gdbarch_alloc() */
return gdbarch;
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
/* Skip verify of process_record, has predicate. */
/* Skip verify of process_record_signal, has predicate. */
- /* Skip verify of gdb_signal_from_host, invalid_p == 0 */
+ /* Skip verify of gdb_signal_from_target, has predicate. */
/* Skip verify of get_siginfo_type, has predicate. */
/* Skip verify of record_special_symbol, has predicate. */
/* Skip verify of get_syscall_number, has predicate. */
/* Skip verify of has_dos_based_file_system, invalid_p == 0 */
/* Skip verify of gen_return_address, invalid_p == 0 */
/* Skip verify of info_proc, has predicate. */
+ /* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
"gdbarch_dump: gcore_bfd_target = %s\n",
pstring (gdbarch->gcore_bfd_target));
fprintf_unfiltered (file,
- "gdbarch_dump: gdb_signal_from_host = <%s>\n",
- host_address_to_string (gdbarch->gdb_signal_from_host));
+ "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
+ gdbarch_gdb_signal_from_target_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdb_signal_from_target = <%s>\n",
+ host_address_to_string (gdbarch->gdb_signal_from_target));
fprintf_unfiltered (file,
"gdbarch_dump: gen_return_address = <%s>\n",
host_address_to_string (gdbarch->gen_return_address));
fprintf_unfiltered (file,
"gdbarch_dump: integer_to_address = <%s>\n",
host_address_to_string (gdbarch->integer_to_address));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
+ host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order));
fprintf_unfiltered (file,
"gdbarch_dump: long_bit = %s\n",
plongest (gdbarch->long_bit));
gdbarch->process_record_signal = process_record_signal;
}
+int
+gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->gdb_signal_from_target != NULL;
+}
+
enum gdb_signal
-gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch, int signo)
+gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->gdb_signal_from_host != NULL);
+ gdb_assert (gdbarch->gdb_signal_from_target != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_from_host called\n");
- return gdbarch->gdb_signal_from_host (gdbarch, signo);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_from_target called\n");
+ return gdbarch->gdb_signal_from_target (gdbarch, signo);
}
void
-set_gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch,
- gdbarch_gdb_signal_from_host_ftype gdb_signal_from_host)
+set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch,
+ gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target)
{
- gdbarch->gdb_signal_from_host = gdb_signal_from_host;
+ gdbarch->gdb_signal_from_target = gdb_signal_from_target;
}
int
gdbarch->info_proc = info_proc;
}
+void
+gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->iterate_over_objfiles_in_search_order != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_iterate_over_objfiles_in_search_order called\n");
+ gdbarch->iterate_over_objfiles_in_search_order (gdbarch, cb, cb_data, current_objfile);
+}
+
+void
+set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch,
+ gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order)
+{
+ gdbarch->iterate_over_objfiles_in_search_order = iterate_over_objfiles_in_search_order;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */