mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
0fb4aa4bfc
gdb/gdbserver/ * configure.ac: Handle --with-ust. substitute ustlibs and ustinc. * mem-break.c (uninsert_all_breakpoints) (reinsert_all_breakpoints): New. * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints): * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New. (gdb_agent_ust_loaded, helper_thread_id) (gdb_agent_helper_thread_id): New macros. (struct ipa_sym_addresses): Add addr_ust_loaded, addr_helper_thread_id, addr_cmd_buf. (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf. (in_process_agent_loaded_ust): New. (write_e_ust_not_loaded): New. (maybe_write_ipa_ust_not_loaded): New. (struct collect_static_trace_data_action): New. (enum tracepoint_type) <static_tracepoint>: New. (struct tracepoint) <handle>: Mention static tracepoints. (struct static_tracepoint_ctx): New. (CMD_BUF_SIZE): New. (add_tracepoint_action): Handle static tracepoint actions. (unprobe_marker_at): New. (clear_installed_tracepoints): Handle static tracepoints. (cmd_qtdp): Handle static tracepoints. (probe_marker_at): New. (cmd_qtstart): Handle static tracepoints. (response_tracepoint): Handle static tracepoints. (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New. (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat. (get_context_regcache): Handle static tracepoints. (do_action_at_tracepoint): Handle static tracepoint actions. (traceframe_find_block_type): Handle static trace data blocks. (traceframe_read_sdata): New. (download_tracepoints): Download static tracepoint actions. [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h. (GDB_PROBE_NAME): New. (ust_ops): New. (GET_UST_SYM): New. (USTF): New. (dlsym_ust): New. (ust_marker_to_static_tracepoint): New. (gdb_probe): New. (collect_ust_data_at_tracepoint): New. (gdb_ust_probe): New. (UNIX_PATH_MAX, SOCK_DIR): New. (gdb_ust_connect_sync_socket): New. (resume_thread, stop_thread): New. (run_inferior_command): New. (init_named_socket): New. (gdb_ust_socket_init): New. (cstr_to_hexstr): New. (next_st): New. (first_marker, next_marker): New. (response_ust_marker): New. (cmd_qtfstm, cmd_qtsstm): New. (unprobe_marker_at, probe_marker_at): New. (cmd_qtstmat, gdb_ust_thread): New. (gdb_ust_init): New. (initialize_tracepoint_ftlib): Call gdb_ust_init. * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (x86_64_st_collect_regmap): New. (X86_64_NUM_ST_COLLECT_GREGS): New. (AMD64_RIP_REGNUM): New. (supply_static_tracepoint_registers): New. * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (i386_st_collect_regmap): New. (i386_NUM_ST_COLLECT_GREGS): New. (supply_static_tracepoint_registers): New. * server.c (handle_query): Handle qXfer:statictrace:read. <qSupported>: Report support for StaticTracepoints, and qXfer:statictrace:read features. * server.h (traceframe_read_sdata) (supply_static_tracepoint_registers): Declare. * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex) (unpack_varlen_hex): Include in IPA build. * Makefile.in (ustlibs, ustinc): New. (IPA_OBJS): Add remote-utils-ipa.o. ($(IPA_LIB)): Link -ldl and -lpthread. (UST_CFLAGS): New. (IPAGENT_CFLAGS): Add UST_CFLAGS. * config.in, configure: Regenerate. gdb/ * NEWS: Mention new support for static tracepoints. (New packets): Mention qTfSTM, qTsSTM, qTSTMat and qXfer:statictrace:read. (New features in the GDB remote stub, GDBserver): Mention static tracepoints support using an UST based backend. (New commands): Mention "info static-tracepoint-markers" and "strace". * breakpoint.c (is_marker_spec): New. (is_tracepoint): Handle static tracepoints. (validate_commands_for_breakpoint): Static tracepoints can't do while-stepping. (static_tracepoints_here): New. (bpstat_what): Handle static tracepoints. (print_one_breakpoint_location, allocate_bp_location, mention): Ditto. (create_breakpoint_sal): Ditto. (decode_static_tracepoint_spec): New. (create_breakpoint): Replace `hardwareflag', and `traceflag' with `type_wanted'. Adjust. Handle static tracepoint marker locations. (break_command_1): Adjust. (update_static_tracepoint): New. (update_breakpoint_locations): Handle static tracepoints. (breakpoint_re_set_one): Handle static tracepoint marker locations. (disable_command, enable_command): Handle static tracepoints. (trace_command, ftrace_command): Adjust. (strace_command): New. (create_tracepoint_from_upload): Adjust. (save_breakpoints): Handle static tracepoints. (_initialize_breakpoint): Install the "strace" command. * breakpoint.h (enum bptype): New bp_static_tracepoint type. (struct breakpoint): New fields static_trace_marker_id and static_trace_marker_id_idx. (breakpoints_here_p): Declare. (create_breakpoint): Adjust. (static_tracepoints_here): Declare. * remote.c (struct remote_state) <static_tracepoints>: New field. (PACKET_qXfer_statictrace_read, PACKET_StaticTracepoints): New. (remote_static_tracepoint_marker_at): New. (remote_static_tracepoint_markers_by_strid): New. (remote_static_tracepoint_feature): New. (remote_disconnected_tracing_feature): Handle "StaticTracepoints". (remote_xfer_partial): Handle TARGET_OBJECT_STATIC_TRACE_DATA. (remote_supports_static_tracepoints): New. (remote_download_tracepoint): Download static tracepoints. (init_remote_ops): Install remote_static_tracepoint_marker_at and remote_static_tracepoint_markers_by_strid. (_initialize_remote): Install set|show remote static-tracepoints, and set|show remote read-sdata-object commands. * target.c (update_current_target): Inherit and default to_static_tracepoint_marker_at, and to_static_tracepoint_markers_by_strid. * target.h (static_tracepoint_marker): Forward declare. (enum target_object): New object TARGET_OBJECT_STATIC_TRACE_DATA. (static_tracepoint_marker_p): New typedef. (DEF_VEC_P(static_tracepoint_marker_p)): New VEC type. (struct target_ops): New fields to_static_tracepoint_marker_at and to_static_tracepoint_markers_by_strid. (target_static_tracepoint_marker_at) (target_static_tracepoint_markers_by_strid): New. * tracepoint.c: Include source.h. (validate_actionline): Handle $_sdata. (struct collection_list): New field strace_data. (add_static_trace_data): New. (clear_collection_list): Clear strace_data. (stringify_collection_list): Account for a possible static trace data collection. (encode_actions_1): Encode an $_sdata collection. (parse_tracepoint_definition): Handle static tracepoints. (parse_static_tracepoint_marker_definition): New. (release_static_tracepoint_marker): New. (print_one_static_tracepoint_marker): New. (info_static_tracepoint_markers_command): New. (sdata_make_value): New. (_initialize_tracepoint): Create the $_sdata convenience variable. Add the "info static-tracepoint-markers" command. Mention $_sdata in the "collect" command's help output. * tracepoint.h (struct static_tracepoint_marker): New. (parse_static_tracepoint_marker_definition) (release_static_tracepoint_marker): Declare. * mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust. * python/py-breakpoint.c (bppy_new): Adjust. doc/ * gdb.texinfo (Convenience Variables): Document $_sdata. (Commands to Set Tracepoints): Describe static tracepoints. Add `Listing Static Tracepoint Markers' menu entry. Document "strace". (Tracepoint Action Lists): Document collecting $_sdata. (Listing Static Tracepoint Markers): New subsection. (Tracepoints support in gdbserver): Mention static tracepoints. (remote packets, enabling and disabling): Mention read-sdata-object. (General Query Packets) <qSupported>: Document qXfer:sdata:read and StaticTracepoint. Mention qTfSTM, qTsSTM and qTSTMat as tracepoint packets. Document qXfer:sdata:read. (Tracepoint packets): Document qTfSTM, qTsSTM and qTSTMat.
158 lines
4.9 KiB
C
158 lines
4.9 KiB
C
/* Memory breakpoint interfaces for the remote server for GDB.
|
|
Copyright (C) 2002, 2005, 2007, 2008, 2009, 2010
|
|
Free Software Foundation, Inc.
|
|
|
|
Contributed by MontaVista Software.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef MEM_BREAK_H
|
|
#define MEM_BREAK_H
|
|
|
|
/* Breakpoints are opaque. */
|
|
struct breakpoint;
|
|
struct fast_tracepoint_jump;
|
|
|
|
/* Create a new GDB breakpoint at WHERE. Returns -1 if breakpoints
|
|
are not supported on this target, 0 otherwise. */
|
|
|
|
int set_gdb_breakpoint_at (CORE_ADDR where);
|
|
|
|
/* Returns TRUE if there's any breakpoint at ADDR in our tables,
|
|
inserted, or not. */
|
|
|
|
int breakpoint_here (CORE_ADDR addr);
|
|
|
|
/* Returns TRUE if there's any inserted breakpoint set at ADDR. */
|
|
|
|
int breakpoint_inserted_here (CORE_ADDR addr);
|
|
|
|
/* Returns TRUE if there's a GDB breakpoint set at ADDR. */
|
|
|
|
int gdb_breakpoint_here (CORE_ADDR where);
|
|
|
|
/* Create a new breakpoint at WHERE, and call HANDLER when
|
|
it is hit. HANDLER should return 1 if the breakpoint
|
|
should be deleted, 0 otherwise. */
|
|
|
|
struct breakpoint *set_breakpoint_at (CORE_ADDR where,
|
|
int (*handler) (CORE_ADDR));
|
|
|
|
/* Delete a GDB breakpoint previously inserted at ADDR with
|
|
set_gdb_breakpoint_at. */
|
|
|
|
int delete_gdb_breakpoint_at (CORE_ADDR addr);
|
|
|
|
/* Delete a breakpoint. */
|
|
|
|
int delete_breakpoint (struct breakpoint *bkpt);
|
|
|
|
/* Set a reinsert breakpoint at STOP_AT. */
|
|
|
|
void set_reinsert_breakpoint (CORE_ADDR stop_at);
|
|
|
|
/* Delete all reinsert breakpoints. */
|
|
|
|
void delete_reinsert_breakpoints (void);
|
|
|
|
/* Reinsert breakpoints at WHERE (and change their status to
|
|
inserted). */
|
|
|
|
void reinsert_breakpoints_at (CORE_ADDR where);
|
|
|
|
/* Uninsert breakpoints at WHERE (and change their status to
|
|
uninserted). This still leaves the breakpoints in the table. */
|
|
|
|
void uninsert_breakpoints_at (CORE_ADDR where);
|
|
|
|
/* Reinsert all breakpoints of the current process (and change their
|
|
status to inserted). */
|
|
|
|
void reinsert_all_breakpoints (void);
|
|
|
|
/* Uninsert all breakpoints of the current process (and change their
|
|
status to uninserted). This still leaves the breakpoints in the
|
|
table. */
|
|
|
|
void uninsert_all_breakpoints (void);
|
|
|
|
/* See if any breakpoint claims ownership of STOP_PC. Call the handler for
|
|
the breakpoint, if found. */
|
|
|
|
void check_breakpoints (CORE_ADDR stop_pc);
|
|
|
|
/* See if any breakpoints shadow the target memory area from MEM_ADDR
|
|
to MEM_ADDR + MEM_LEN. Update the data already read from the target
|
|
(in BUF) if necessary. */
|
|
|
|
void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
|
|
|
|
/* See if any breakpoints shadow the target memory area from MEM_ADDR
|
|
to MEM_ADDR + MEM_LEN. Update the data to be written to the target
|
|
(in BUF) if necessary, as well as the original data for any breakpoints. */
|
|
|
|
void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
|
|
|
|
/* Set the byte pattern to insert for memory breakpoints. This function
|
|
must be called before any breakpoints are set. */
|
|
|
|
void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
|
|
|
|
/* Delete all breakpoints. */
|
|
|
|
void delete_all_breakpoints (void);
|
|
|
|
/* Clear the "inserted" flag in all breakpoints of PROC. */
|
|
|
|
void mark_breakpoints_out (struct process_info *proc);
|
|
|
|
/* Delete all breakpoints, but do not try to un-insert them from the
|
|
inferior. */
|
|
|
|
void free_all_breakpoints (struct process_info *proc);
|
|
|
|
/* Check if breakpoints still seem to be inserted in the inferior. */
|
|
|
|
void validate_breakpoints (void);
|
|
|
|
/* Insert a fast tracepoint jump at WHERE, using instruction INSN, of
|
|
LENGTH bytes. */
|
|
|
|
struct fast_tracepoint_jump *set_fast_tracepoint_jump (CORE_ADDR where,
|
|
unsigned char *insn,
|
|
ULONGEST length);
|
|
|
|
/* Delete fast tracepoint jump TODEL from our tables, and uninsert if
|
|
from memory. */
|
|
|
|
int delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel);
|
|
|
|
/* Returns true if there's fast tracepoint jump set at WHERE. */
|
|
|
|
int fast_tracepoint_jump_here (CORE_ADDR);
|
|
|
|
/* Uninsert fast tracepoint jumps at WHERE (and change their status to
|
|
uninserted). This still leaves the tracepoints in the table. */
|
|
|
|
void uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc);
|
|
|
|
/* Reinsert fast tracepoint jumps at WHERE (and change their status to
|
|
inserted). */
|
|
|
|
void reinsert_fast_tracepoint_jumps_at (CORE_ADDR where);
|
|
|
|
#endif /* MEM_BREAK_H */
|