#include "gdb_assert.h"
#include "gdb_string.h"
-#include "gdb-events.h"
#include "reggroups.h"
#include "osabi.h"
#include "gdb_obstack.h"
+#include "observer.h"
+#include "regcache.h"
/* Static function declarations */
/* basic architectural information */
const struct bfd_arch_info * bfd_arch_info;
int byte_order;
+ int byte_order_for_code;
enum gdb_osabi osabi;
const struct target_desc * target_desc;
gdbarch_integer_to_address_ftype *integer_to_address;
gdbarch_return_value_ftype *return_value;
gdbarch_skip_prologue_ftype *skip_prologue;
+ gdbarch_skip_main_prologue_ftype *skip_main_prologue;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
gdbarch_register_reggroup_p_ftype *register_reggroup_p;
gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
gdbarch_regset_from_core_section_ftype *regset_from_core_section;
+ struct core_regset_section * core_regset_sections;
gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
int vtable_function_descriptors;
int vbit_in_delta;
/* basic architecture information */
&bfd_default_arch_struct, /* bfd_arch_info */
BFD_ENDIAN_BIG, /* byte_order */
+ BFD_ENDIAN_BIG, /* byte_order_for_code */
GDB_OSABI_UNKNOWN, /* osabi */
0, /* target_desc */
/* target specific vector and its dump routine */
0, /* integer_to_address */
0, /* return_value */
0, /* skip_prologue */
+ 0, /* skip_main_prologue */
0, /* inner_than */
0, /* breakpoint_from_pc */
0, /* adjust_breakpoint_address */
default_register_reggroup_p, /* register_reggroup_p */
0, /* fetch_pointer_argument */
0, /* regset_from_core_section */
+ 0, /* core_regset_sections */
0, /* core_xfer_shared_libraries */
0, /* vtable_function_descriptors */
0, /* vbit_in_delta */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
+struct gdbarch *target_gdbarch = &startup_gdbarch;
/* Create a new ``struct gdbarch'' based on information provided by
``struct gdbarch_info''. */
gdbarch->bfd_arch_info = info->bfd_arch_info;
gdbarch->byte_order = info->byte_order;
+ gdbarch->byte_order_for_code = info->byte_order_for_code;
gdbarch->osabi = info->osabi;
gdbarch->target_desc = info->target_desc;
/* Skip verify of return_value, has predicate */
if (gdbarch->skip_prologue == 0)
fprintf_unfiltered (log, "\n\tskip_prologue");
+ /* Skip verify of skip_main_prologue, has predicate */
if (gdbarch->inner_than == 0)
fprintf_unfiltered (log, "\n\tinner_than");
if (gdbarch->breakpoint_from_pc == 0)
fprintf_unfiltered (file,
"gdbarch_dump: byte_order = %s\n",
paddr_d (gdbarch->byte_order));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: byte_order_for_code = %s\n",
+ paddr_d (gdbarch->byte_order_for_code));
fprintf_unfiltered (file,
"gdbarch_dump: call_dummy_location = %s\n",
paddr_d (gdbarch->call_dummy_location));
fprintf_unfiltered (file,
"gdbarch_dump: core_read_description = <0x%lx>\n",
(long) gdbarch->core_read_description);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: core_regset_sections = %s\n",
+ host_address_to_string (gdbarch->core_regset_sections));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
gdbarch_core_xfer_shared_libraries_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: single_step_through_delay = <0x%lx>\n",
(long) gdbarch->single_step_through_delay);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
+ gdbarch_skip_main_prologue_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: skip_main_prologue = <0x%lx>\n",
+ (long) gdbarch->skip_main_prologue);
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
gdbarch_skip_permanent_breakpoint_p (gdbarch));
return gdbarch->byte_order;
}
+int
+gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
+ return gdbarch->byte_order_for_code;
+}
+
enum gdb_osabi
gdbarch_osabi (struct gdbarch *gdbarch)
{
gdbarch->skip_prologue = skip_prologue;
}
+int
+gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->skip_main_prologue != NULL;
+}
+
+CORE_ADDR
+gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->skip_main_prologue != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
+ return gdbarch->skip_main_prologue (gdbarch, ip);
+}
+
+void
+set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
+ gdbarch_skip_main_prologue_ftype skip_main_prologue)
+{
+ gdbarch->skip_main_prologue = skip_main_prologue;
+}
+
int
gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
{
gdbarch->regset_from_core_section = regset_from_core_section;
}
+struct core_regset_section *
+gdbarch_core_regset_sections (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
+ return gdbarch->core_regset_sections;
+}
+
+void
+set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
+ struct core_regset_section * core_regset_sections)
+{
+ gdbarch->core_regset_sections = core_regset_sections;
+}
+
int
gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
{
gdb_assert (current_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_gdbarch = new_gdbarch;
- architecture_changed_event ();
- reinit_frame_cache ();
+ target_gdbarch = new_gdbarch;
+ observer_notify_architecture_changed (new_gdbarch);
+ registers_changed ();
}
extern void _initialize_gdbarch (void);