forked from Imagelibrary/binutils-gdb
* gdbarch.sh (overlay_update): New gdbarch function.
(struct obj_section): Add forward declaration. * gdbarch.c, gdbarch.h: Regenerate. * symfile.c (simple_overlay_update): Make global. (target_overlay_update): Remove variable. (overlay_is_mapped): Call gdbarch_overlay_update instead of target_overlay_update. (overlay_load_command): Likewise. * symfile.h (struct obj_section): Add forward declaration. (simple_overlay_update): Add prototype. * m32r-tdep.c (m32r_gdbarch_init): Install simple_overlay_update.
This commit is contained in:
@@ -236,6 +236,7 @@ struct gdbarch
|
||||
int vtable_function_descriptors;
|
||||
int vbit_in_delta;
|
||||
gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
|
||||
gdbarch_overlay_update_ftype *overlay_update;
|
||||
};
|
||||
|
||||
|
||||
@@ -362,6 +363,7 @@ struct gdbarch startup_gdbarch =
|
||||
0, /* vtable_function_descriptors */
|
||||
0, /* vbit_in_delta */
|
||||
0, /* skip_permanent_breakpoint */
|
||||
0, /* overlay_update */
|
||||
/* startup_gdbarch() */
|
||||
};
|
||||
|
||||
@@ -614,6 +616,7 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
|
||||
/* Skip verify of vtable_function_descriptors, invalid_p == 0 */
|
||||
/* Skip verify of vbit_in_delta, invalid_p == 0 */
|
||||
/* Skip verify of skip_permanent_breakpoint, has predicate */
|
||||
/* Skip verify of overlay_update, has predicate */
|
||||
buf = ui_file_xstrdup (log, &dummy);
|
||||
make_cleanup (xfree, buf);
|
||||
if (strlen (buf) > 0)
|
||||
@@ -1224,6 +1227,12 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: osabi = %s\n",
|
||||
paddr_d (current_gdbarch->osabi));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
|
||||
gdbarch_overlay_update_p (current_gdbarch));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: overlay_update = <0x%lx>\n",
|
||||
(long) current_gdbarch->overlay_update);
|
||||
#ifdef PC_REGNUM
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: PC_REGNUM # %s\n",
|
||||
@@ -3605,6 +3614,30 @@ set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
|
||||
gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_overlay_update_p (struct gdbarch *gdbarch)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
return gdbarch->overlay_update != NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
gdb_assert (gdbarch->overlay_update != NULL);
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
|
||||
gdbarch->overlay_update (osect);
|
||||
}
|
||||
|
||||
void
|
||||
set_gdbarch_overlay_update (struct gdbarch *gdbarch,
|
||||
gdbarch_overlay_update_ftype overlay_update)
|
||||
{
|
||||
gdbarch->overlay_update = overlay_update;
|
||||
}
|
||||
|
||||
|
||||
/* Keep a registry of per-architecture data-pointers required by GDB
|
||||
modules. */
|
||||
|
||||
Reference in New Issue
Block a user