diff options
author | Stan Shebs <shebs@codesourcery.com> | 2011-11-14 20:07:25 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 2011-11-14 20:07:25 +0000 |
commit | 405f8e949968faadc137cf5d4244fc68a7f6c586 (patch) | |
tree | 523b73e190feb6d047e882474ccfa133457fc37f /gdb/remote.c | |
parent | 3e05895e9e59ad84a047a73cd70b6b70c26bac9e (diff) | |
download | gdb-405f8e949968faadc137cf5d4244fc68a7f6c586.zip gdb-405f8e949968faadc137cf5d4244fc68a7f6c586.tar.gz gdb-405f8e949968faadc137cf5d4244fc68a7f6c586.tar.bz2 |
2011-11-14 Stan Shebs <stan@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
* NEWS: Document shorter fast tracepoints and qTMinFTPILen packet.
* i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for
the minimum instruction size for fast tracepoints.
* target.h (struct target_ops): Add new method
to_get_min_fast_tracepoint_insn_len.
(target_get_min_fast_tracepoint_insn_len): New.
* target.c (update_current_target): Set up new target operation.
* remote.c (remote_write_bytes_aux): Fix typo.
(remote_get_min_fast_tracepoint_insn_len): New.
(init_remote_ops): Initialize new field.
* gdb.texinfo (Create and Delete Tracepoints): Describe what is
needed to get shorter fast tracepoints.
(Tracepoint Packets): Document new qTMinFTPILen packet.
* linux-x86-low.c (small_jump_insn): New.
(i386_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message, build a trampoline and issue a small
jump instruction to it.
(x86_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message.
(x86_get_min_fast_tracepoint_insn_len): New.
(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
* linux-low.h (struct linux_target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new operation.
* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
arguments.
(linux_get_min_fast_tracepoint_insn_len): New function.
(linux_target_op): Add new operation.
* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
(gdb_trampoline_buffer_end): Ditto.
(gdb_trampoline_buffer_error): Ditto.
(struct ipa_sym_addresses): Add fields for new IPA variables.
(symbol_list): Add entries for new IPA variables.
(struct tracepoint): Add fields to hold the address range of the
trampoline used by the tracepoint.
(trampoline_buffer_head): New static variable.
(trampoline_buffer_tail): Ditto.
(claim_trampoline_space): New function.
(have_fast_tracepoint_trampoline_buffer): New function.
(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
structure.
(install_fast_tracepoint): Ditto, also add error buffer argument.
(cmd_qtminftpilen): New function.
(handle_tracepoint_query): Add response to qTMinFTPILen packet.
(fast_tracepoint_from_trampoline_address): New function.
(fast_tracepoint_collecting): Handle trampoline as part of jump
pad space.
(set_trampoline_buffer_space): New function.
(initialize_tracepoint): Initialize new IPA variables.
* target.h (struct target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new
get_min_fast_tracepoint_insn_len operation.
(target_get_min_fast_tracepoint_insn_len): New.
(install_fast_tracepoint_jump_pad): Add arguments.
* server.h (IPA_BUFSIZ): Define.
* linux-i386-ipa.c: Include extra header files.
(initialize_fast_tracepoint_trampoline_buffer): New function.
(initialize_low_tracepoint): Call it.
* server.h (set_trampoline_buffer_space): Declare.
(claim_trampoline_space): Ditto.
(have_fast_tracepoint_trampoline_buffer): Ditto.
* gdb.trace/ftrace.c: New.
* gdb.trace/ftrace.exp: New.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index a6d5e5f..6e9e242 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6370,7 +6370,7 @@ remote_write_bytes_aux (const char *header, CORE_ADDR memaddr, if (todo <= 0) internal_error (__FILE__, __LINE__, - _("minumum packet size too small to write data")); + _("minimum packet size too small to write data")); /* If we already need another packet, then try to align the end of this packet to a useful boundary. */ @@ -10451,6 +10451,32 @@ remote_traceframe_info (void) return NULL; } +/* Handle the qTMinFTPILen packet. Returns the minimum length of + instruction on which a fast tracepoint may be placed. Returns -1 + if the packet is not supported, and 0 if the minimum instruction + length is unknown. */ + +static int +remote_get_min_fast_tracepoint_insn_len (void) +{ + struct remote_state *rs = get_remote_state (); + char *reply; + + sprintf (rs->buf, "qTMinFTPILen"); + putpkt (rs->buf); + reply = remote_get_noisy_reply (&target_buf, &target_buf_size); + if (*reply == '\0') + return -1; + else + { + ULONGEST min_insn_len; + + unpack_varlen_hex (reply, &min_insn_len); + + return (int) min_insn_len; + } +} + static void init_remote_ops (void) { @@ -10540,6 +10566,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_upload_trace_state_variables = remote_upload_trace_state_variables; remote_ops.to_get_raw_trace_data = remote_get_raw_trace_data; + remote_ops.to_get_min_fast_tracepoint_insn_len = remote_get_min_fast_tracepoint_insn_len; remote_ops.to_set_disconnected_tracing = remote_set_disconnected_tracing; remote_ops.to_set_circular_trace_buffer = remote_set_circular_trace_buffer; remote_ops.to_core_of_thread = remote_core_of_thread; |