aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-05-11 19:57:17 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-05-11 19:57:17 +0000
commit1c7724581e56a7cda4dd412b88eabe51e33b0507 (patch)
tree81f0a22f8d4bbeb17a7a8f890cba798f43862207 /gdb/gdbarch.c
parent06d3b283b148a3ab8ff85a50fb127973524e700c (diff)
downloadgdb-1c7724581e56a7cda4dd412b88eabe51e33b0507.zip
gdb-1c7724581e56a7cda4dd412b88eabe51e33b0507.tar.gz
gdb-1c7724581e56a7cda4dd412b88eabe51e33b0507.tar.bz2
* 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.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 7e8c697..8c19f91 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -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. */