aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorHui Zhu <teawater@gmail.com>2009-04-30 02:52:16 +0000
committerHui Zhu <teawater@gmail.com>2009-04-30 02:52:16 +0000
commit0508c3ec4d3efe99aa7edf201f81b34edb74a5ad (patch)
treef892adca86225685d10ce31dc5e15f42cd8c684c /gdb/gdbarch.c
parent96c23d596607cc7143e0ea1f4fee260977aec18b (diff)
downloadfsf-binutils-gdb-0508c3ec4d3efe99aa7edf201f81b34edb74a5ad.zip
fsf-binutils-gdb-0508c3ec4d3efe99aa7edf201f81b34edb74a5ad.tar.gz
fsf-binutils-gdb-0508c3ec4d3efe99aa7edf201f81b34edb74a5ad.tar.bz2
GDBARCH interface for process record and replay.
* gdbarch.sh (process_record): This interface point to the function that records the inferior execute log.
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 3273b34..cc13715 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -239,6 +239,7 @@ struct gdbarch
gdbarch_core_read_description_ftype *core_read_description;
gdbarch_static_transform_name_ftype *static_transform_name;
int sofun_address_maybe_missing;
+ gdbarch_process_record_ftype *process_record;
gdbarch_target_signal_from_host_ftype *target_signal_from_host;
gdbarch_target_signal_to_host_ftype *target_signal_to_host;
gdbarch_get_siginfo_type_ftype *get_siginfo_type;
@@ -374,6 +375,7 @@ struct gdbarch startup_gdbarch =
0, /* core_read_description */
0, /* static_transform_name */
0, /* sofun_address_maybe_missing */
+ 0, /* process_record */
default_target_signal_from_host, /* target_signal_from_host */
default_target_signal_to_host, /* target_signal_to_host */
0, /* get_siginfo_type */
@@ -630,6 +632,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of core_read_description, has predicate */
/* Skip verify of static_transform_name, has predicate */
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
+ /* Skip verify of process_record, has predicate */
/* Skip verify of target_signal_from_host, invalid_p == 0 */
/* Skip verify of target_signal_to_host, invalid_p == 0 */
/* Skip verify of get_siginfo_type, has predicate */
@@ -946,6 +949,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: print_vector_info = <%s>\n",
host_address_to_string (gdbarch->print_vector_info));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_process_record_p() = %d\n",
+ gdbarch_process_record_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: process_record = <%s>\n",
+ host_address_to_string (gdbarch->process_record));
+ fprintf_unfiltered (file,
"gdbarch_dump: ps_regnum = %s\n",
plongest (gdbarch->ps_regnum));
fprintf_unfiltered (file,
@@ -3250,6 +3259,30 @@ set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
}
+int
+gdbarch_process_record_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->process_record != NULL;
+}
+
+int
+gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->process_record != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
+ return gdbarch->process_record (gdbarch, regcache, addr);
+}
+
+void
+set_gdbarch_process_record (struct gdbarch *gdbarch,
+ gdbarch_process_record_ftype process_record)
+{
+ gdbarch->process_record = process_record;
+}
+
enum target_signal
gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
{