aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2010-01-06 04:20:27 +0000
committerStan Shebs <shebs@codesourcery.com>2010-01-06 04:20:27 +0000
commit7a697b8dd7ac3c14e35ae3026d955aeae3ecc054 (patch)
tree62009f9b707ae6f18c12be8956f7b1e5fc586a7a /gdb/gdbarch.c
parent737a160ed9bb7bbe1ac8ebea1cdc27438213c247 (diff)
downloadgdb-7a697b8dd7ac3c14e35ae3026d955aeae3ecc054.zip
gdb-7a697b8dd7ac3c14e35ae3026d955aeae3ecc054.tar.gz
gdb-7a697b8dd7ac3c14e35ae3026d955aeae3ecc054.tar.bz2
Add fast tracepoints.
* arch-utils.h (default_fast_tracepoint_valid_at): Declare. * arch-utils.c (default_fast_tracepoint_valid_at): New function. * breakpoint.h (enum bptype): Add bp_fast_tracepoint. * breakpoint.c (tracepoint_type): New function. (ALL_TRACEPOINTS): Use it. (should_be_inserted): Ditto. (bpstat_check_location): Ditto. (print_one_breakpoint_location): Ditto. (user_settable_breakpoint): Ditto. (set_breakpoint_location_function): Ditto. (disable_breakpoints_in_shlibs): Ditto. (delete_trace_command): Ditto. (print_it_typical): Add bp_fast_tracepoint case. (bpstat_what): Ditto. (print_one_breakpoint_location): Ditto. (allocate_bp_location): Ditto. (mention): Ditto. (breakpoint_re_set_one): Ditto. (disable_command): Ditto. (enable_command): Ditto. (check_fast_tracepoint_sals): New function. (break_command_really): Call it. (ftrace_command): New function. (_initialize_breakpoint): Add ftrace command. * gdbarch.sh (fast_tracepoint_valid_at): New. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.c (i386_fast_tracepoint_valid_at): New function. (i386_gdbarch_init): Use it. * remote.c (struct remote_state): New field fast_tracepoints. (PACKET_FastTracepoints): New packet config type. (remote_fast_tracepoint_feature): New function. (remote_protocol_features): Add FastTracepoints. (remote_supports_fast_tracepoints): New function. (_initialize_remote): Add FastTracepoints. * tracepoint.c (download_tracepoint): Add fast tracepoint option. * NEWS: Mention fast tracepoints. * gdb.texinfo (Create and Delete Tracepoints): Describe fast tracepoints. (Tracepoint Packets): Describe remote protocol for fast tracepoints. * gdb.trace/tracecmd.exp: Test ftrace.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 3680dc4..9d77027 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -250,6 +250,7 @@ struct gdbarch
int has_global_solist;
int has_global_breakpoints;
gdbarch_has_shared_address_space_ftype *has_shared_address_space;
+ gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
};
@@ -391,6 +392,7 @@ struct gdbarch startup_gdbarch =
0, /* has_global_solist */
0, /* has_global_breakpoints */
default_has_shared_address_space, /* has_shared_address_space */
+ default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
/* startup_gdbarch() */
};
@@ -475,6 +477,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->target_signal_from_host = default_target_signal_from_host;
gdbarch->target_signal_to_host = default_target_signal_to_host;
gdbarch->has_shared_address_space = default_has_shared_address_space;
+ gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
/* gdbarch_alloc() */
return gdbarch;
@@ -653,6 +656,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of has_global_solist, invalid_p == 0 */
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
/* Skip verify of has_shared_address_space, invalid_p == 0 */
+ /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
@@ -826,6 +830,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: elf_make_msymbol_special = <%s>\n",
host_address_to_string (gdbarch->elf_make_msymbol_special));
fprintf_unfiltered (file,
+ "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
+ host_address_to_string (gdbarch->fast_tracepoint_valid_at));
+ fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
gdbarch_fetch_pointer_argument_p (gdbarch));
fprintf_unfiltered (file,
@@ -3528,6 +3535,23 @@ set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
gdbarch->has_shared_address_space = has_shared_address_space;
}
+int
+gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
+ return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
+}
+
+void
+set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
+ gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
+{
+ gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */