X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftarget-delegates.c;h=934f3021eac6cefeaf95ea80085ba8ef64f509bd;hb=cd4ae029569aa0c38230f042b39f505ac5b8f732;hp=275ce58ee07c0ad8ab9cddcaf6717e5f523370ca;hpb=9409d39e8776a1f556cba720b7fcb0ea60c22cd4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 275ce58ee0..934f3021ea 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -60,6 +60,18 @@ tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *a noprocess (); } +static void +delegate_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2) +{ + self = self->beneath; + self->to_fetch_registers (self, arg1, arg2); +} + +static void +tdefault_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2) +{ +} + static void delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2) { @@ -125,6 +137,19 @@ tdefault_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int return 0; } +static int +delegate_ranged_break_num_registers (struct target_ops *self) +{ + self = self->beneath; + return self->to_ranged_break_num_registers (self); +} + +static int +tdefault_ranged_break_num_registers (struct target_ops *self) +{ + return -1; +} + static int delegate_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2) { @@ -177,6 +202,19 @@ tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, i return -1; } +static int +delegate_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3) +{ + self = self->beneath; + return self->to_insert_mask_watchpoint (self, arg1, arg2, arg3); +} + +static int +tdefault_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3) +{ + return 1; +} + static int delegate_stopped_by_watchpoint (struct target_ops *self) { @@ -452,6 +490,18 @@ tdefault_thread_name (struct target_ops *self, struct thread_info *arg1) return 0; } +static void +delegate_stop (struct target_ops *self, ptid_t arg1) +{ + self = self->beneath; + self->to_stop (self, arg1); +} + +static void +tdefault_stop (struct target_ops *self, ptid_t arg1) +{ +} + static void delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2) { @@ -630,6 +680,32 @@ tdefault_supports_string_tracing (struct target_ops *self) return 0; } +static int +delegate_supports_evaluation_of_breakpoint_conditions (struct target_ops *self) +{ + self = self->beneath; + return self->to_supports_evaluation_of_breakpoint_conditions (self); +} + +static int +tdefault_supports_evaluation_of_breakpoint_conditions (struct target_ops *self) +{ + return 0; +} + +static int +delegate_can_run_breakpoint_commands (struct target_ops *self) +{ + self = self->beneath; + return self->to_can_run_breakpoint_commands (self); +} + +static int +tdefault_can_run_breakpoint_commands (struct target_ops *self) +{ + return 0; +} + static struct gdbarch * delegate_thread_architecture (struct target_ops *self, ptid_t arg1) { @@ -637,6 +713,379 @@ delegate_thread_architecture (struct target_ops *self, ptid_t arg1) return self->to_thread_architecture (self, arg1); } +static void +delegate_trace_init (struct target_ops *self) +{ + self = self->beneath; + self->to_trace_init (self); +} + +static void +tdefault_trace_init (struct target_ops *self) +{ + tcomplain (); +} + +static void +delegate_download_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + self = self->beneath; + self->to_download_tracepoint (self, arg1); +} + +static void +tdefault_download_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + tcomplain (); +} + +static int +delegate_can_download_tracepoint (struct target_ops *self) +{ + self = self->beneath; + return self->to_can_download_tracepoint (self); +} + +static int +tdefault_can_download_tracepoint (struct target_ops *self) +{ + return 0; +} + +static void +delegate_download_trace_state_variable (struct target_ops *self, struct trace_state_variable *arg1) +{ + self = self->beneath; + self->to_download_trace_state_variable (self, arg1); +} + +static void +tdefault_download_trace_state_variable (struct target_ops *self, struct trace_state_variable *arg1) +{ + tcomplain (); +} + +static void +delegate_enable_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + self = self->beneath; + self->to_enable_tracepoint (self, arg1); +} + +static void +tdefault_enable_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + tcomplain (); +} + +static void +delegate_disable_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + self = self->beneath; + self->to_disable_tracepoint (self, arg1); +} + +static void +tdefault_disable_tracepoint (struct target_ops *self, struct bp_location *arg1) +{ + tcomplain (); +} + +static void +delegate_trace_set_readonly_regions (struct target_ops *self) +{ + self = self->beneath; + self->to_trace_set_readonly_regions (self); +} + +static void +tdefault_trace_set_readonly_regions (struct target_ops *self) +{ + tcomplain (); +} + +static void +delegate_trace_start (struct target_ops *self) +{ + self = self->beneath; + self->to_trace_start (self); +} + +static void +tdefault_trace_start (struct target_ops *self) +{ + tcomplain (); +} + +static int +delegate_get_trace_status (struct target_ops *self, struct trace_status *arg1) +{ + self = self->beneath; + return self->to_get_trace_status (self, arg1); +} + +static int +tdefault_get_trace_status (struct target_ops *self, struct trace_status *arg1) +{ + return -1; +} + +static void +delegate_get_tracepoint_status (struct target_ops *self, struct breakpoint *arg1, struct uploaded_tp *arg2) +{ + self = self->beneath; + self->to_get_tracepoint_status (self, arg1, arg2); +} + +static void +tdefault_get_tracepoint_status (struct target_ops *self, struct breakpoint *arg1, struct uploaded_tp *arg2) +{ + tcomplain (); +} + +static void +delegate_trace_stop (struct target_ops *self) +{ + self = self->beneath; + self->to_trace_stop (self); +} + +static void +tdefault_trace_stop (struct target_ops *self) +{ + tcomplain (); +} + +static int +delegate_trace_find (struct target_ops *self, enum trace_find_type arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5) +{ + self = self->beneath; + return self->to_trace_find (self, arg1, arg2, arg3, arg4, arg5); +} + +static int +tdefault_trace_find (struct target_ops *self, enum trace_find_type arg1, int arg2, CORE_ADDR arg3, CORE_ADDR arg4, int *arg5) +{ + return -1; +} + +static int +delegate_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2) +{ + self = self->beneath; + return self->to_get_trace_state_variable_value (self, arg1, arg2); +} + +static int +tdefault_get_trace_state_variable_value (struct target_ops *self, int arg1, LONGEST *arg2) +{ + return 0; +} + +static int +delegate_save_trace_data (struct target_ops *self, const char *arg1) +{ + self = self->beneath; + return self->to_save_trace_data (self, arg1); +} + +static int +tdefault_save_trace_data (struct target_ops *self, const char *arg1) +{ + tcomplain (); +} + +static int +delegate_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1) +{ + self = self->beneath; + return self->to_upload_tracepoints (self, arg1); +} + +static int +tdefault_upload_tracepoints (struct target_ops *self, struct uploaded_tp **arg1) +{ + return 0; +} + +static int +delegate_upload_trace_state_variables (struct target_ops *self, struct uploaded_tsv **arg1) +{ + self = self->beneath; + return self->to_upload_trace_state_variables (self, arg1); +} + +static int +tdefault_upload_trace_state_variables (struct target_ops *self, struct uploaded_tsv **arg1) +{ + return 0; +} + +static LONGEST +delegate_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST arg2, LONGEST arg3) +{ + self = self->beneath; + return self->to_get_raw_trace_data (self, arg1, arg2, arg3); +} + +static LONGEST +tdefault_get_raw_trace_data (struct target_ops *self, gdb_byte *arg1, ULONGEST arg2, LONGEST arg3) +{ + tcomplain (); +} + +static int +delegate_get_min_fast_tracepoint_insn_len (struct target_ops *self) +{ + self = self->beneath; + return self->to_get_min_fast_tracepoint_insn_len (self); +} + +static int +tdefault_get_min_fast_tracepoint_insn_len (struct target_ops *self) +{ + return -1; +} + +static void +delegate_set_disconnected_tracing (struct target_ops *self, int arg1) +{ + self = self->beneath; + self->to_set_disconnected_tracing (self, arg1); +} + +static void +tdefault_set_disconnected_tracing (struct target_ops *self, int arg1) +{ +} + +static void +delegate_set_circular_trace_buffer (struct target_ops *self, int arg1) +{ + self = self->beneath; + self->to_set_circular_trace_buffer (self, arg1); +} + +static void +tdefault_set_circular_trace_buffer (struct target_ops *self, int arg1) +{ +} + +static void +delegate_set_trace_buffer_size (struct target_ops *self, LONGEST arg1) +{ + self = self->beneath; + self->to_set_trace_buffer_size (self, arg1); +} + +static void +tdefault_set_trace_buffer_size (struct target_ops *self, LONGEST arg1) +{ +} + +static int +delegate_set_trace_notes (struct target_ops *self, const char *arg1, const char *arg2, const char *arg3) +{ + self = self->beneath; + return self->to_set_trace_notes (self, arg1, arg2, arg3); +} + +static int +tdefault_set_trace_notes (struct target_ops *self, const char *arg1, const char *arg2, const char *arg3) +{ + return 0; +} + +static int +delegate_get_tib_address (struct target_ops *self, ptid_t arg1, CORE_ADDR *arg2) +{ + self = self->beneath; + return self->to_get_tib_address (self, arg1, arg2); +} + +static int +tdefault_get_tib_address (struct target_ops *self, ptid_t arg1, CORE_ADDR *arg2) +{ + tcomplain (); +} + +static void +delegate_set_permissions (struct target_ops *self) +{ + self = self->beneath; + self->to_set_permissions (self); +} + +static void +tdefault_set_permissions (struct target_ops *self) +{ +} + +static int +delegate_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR arg1, struct static_tracepoint_marker *arg2) +{ + self = self->beneath; + return self->to_static_tracepoint_marker_at (self, arg1, arg2); +} + +static int +tdefault_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR arg1, struct static_tracepoint_marker *arg2) +{ + return 0; +} + +static VEC(static_tracepoint_marker_p) * +delegate_static_tracepoint_markers_by_strid (struct target_ops *self, const char *arg1) +{ + self = self->beneath; + return self->to_static_tracepoint_markers_by_strid (self, arg1); +} + +static VEC(static_tracepoint_marker_p) * +tdefault_static_tracepoint_markers_by_strid (struct target_ops *self, const char *arg1) +{ + tcomplain (); +} + +static struct traceframe_info * +delegate_traceframe_info (struct target_ops *self) +{ + self = self->beneath; + return self->to_traceframe_info (self); +} + +static struct traceframe_info * +tdefault_traceframe_info (struct target_ops *self) +{ + return 0; +} + +static int +delegate_use_agent (struct target_ops *self, int arg1) +{ + self = self->beneath; + return self->to_use_agent (self, arg1); +} + +static int +tdefault_use_agent (struct target_ops *self, int arg1) +{ + tcomplain (); +} + +static int +delegate_can_use_agent (struct target_ops *self) +{ + self = self->beneath; + return self->to_can_use_agent (self); +} + +static int +tdefault_can_use_agent (struct target_ops *self) +{ + return 0; +} + static int delegate_supports_btrace (struct target_ops *self) { @@ -650,6 +1099,19 @@ tdefault_supports_btrace (struct target_ops *self) return 0; } +static int +delegate_augmented_libraries_svr4_read (struct target_ops *self) +{ + self = self->beneath; + return self->to_augmented_libraries_svr4_read (self); +} + +static int +tdefault_augmented_libraries_svr4_read (struct target_ops *self) +{ + return 0; +} + static void install_delegators (struct target_ops *ops) { @@ -663,6 +1125,8 @@ install_delegators (struct target_ops *ops) ops->to_resume = delegate_resume; if (ops->to_wait == NULL) ops->to_wait = delegate_wait; + if (ops->to_fetch_registers == NULL) + ops->to_fetch_registers = delegate_fetch_registers; if (ops->to_store_registers == NULL) ops->to_store_registers = delegate_store_registers; if (ops->to_prepare_to_store == NULL) @@ -675,6 +1139,8 @@ install_delegators (struct target_ops *ops) ops->to_remove_breakpoint = delegate_remove_breakpoint; if (ops->to_can_use_hw_breakpoint == NULL) ops->to_can_use_hw_breakpoint = delegate_can_use_hw_breakpoint; + if (ops->to_ranged_break_num_registers == NULL) + ops->to_ranged_break_num_registers = delegate_ranged_break_num_registers; if (ops->to_insert_hw_breakpoint == NULL) ops->to_insert_hw_breakpoint = delegate_insert_hw_breakpoint; if (ops->to_remove_hw_breakpoint == NULL) @@ -683,6 +1149,8 @@ install_delegators (struct target_ops *ops) ops->to_remove_watchpoint = delegate_remove_watchpoint; if (ops->to_insert_watchpoint == NULL) ops->to_insert_watchpoint = delegate_insert_watchpoint; + if (ops->to_insert_mask_watchpoint == NULL) + ops->to_insert_mask_watchpoint = delegate_insert_mask_watchpoint; if (ops->to_stopped_by_watchpoint == NULL) ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint; if (ops->to_stopped_data_address == NULL) @@ -729,6 +1197,8 @@ install_delegators (struct target_ops *ops) ops->to_extra_thread_info = delegate_extra_thread_info; if (ops->to_thread_name == NULL) ops->to_thread_name = delegate_thread_name; + if (ops->to_stop == NULL) + ops->to_stop = delegate_stop; if (ops->to_rcmd == NULL) ops->to_rcmd = delegate_rcmd; if (ops->to_pid_to_exec_file == NULL) @@ -763,10 +1233,74 @@ install_delegators (struct target_ops *ops) ops->to_supports_enable_disable_tracepoint = delegate_supports_enable_disable_tracepoint; if (ops->to_supports_string_tracing == NULL) ops->to_supports_string_tracing = delegate_supports_string_tracing; + if (ops->to_supports_evaluation_of_breakpoint_conditions == NULL) + ops->to_supports_evaluation_of_breakpoint_conditions = delegate_supports_evaluation_of_breakpoint_conditions; + if (ops->to_can_run_breakpoint_commands == NULL) + ops->to_can_run_breakpoint_commands = delegate_can_run_breakpoint_commands; if (ops->to_thread_architecture == NULL) ops->to_thread_architecture = delegate_thread_architecture; + if (ops->to_trace_init == NULL) + ops->to_trace_init = delegate_trace_init; + if (ops->to_download_tracepoint == NULL) + ops->to_download_tracepoint = delegate_download_tracepoint; + if (ops->to_can_download_tracepoint == NULL) + ops->to_can_download_tracepoint = delegate_can_download_tracepoint; + if (ops->to_download_trace_state_variable == NULL) + ops->to_download_trace_state_variable = delegate_download_trace_state_variable; + if (ops->to_enable_tracepoint == NULL) + ops->to_enable_tracepoint = delegate_enable_tracepoint; + if (ops->to_disable_tracepoint == NULL) + ops->to_disable_tracepoint = delegate_disable_tracepoint; + if (ops->to_trace_set_readonly_regions == NULL) + ops->to_trace_set_readonly_regions = delegate_trace_set_readonly_regions; + if (ops->to_trace_start == NULL) + ops->to_trace_start = delegate_trace_start; + if (ops->to_get_trace_status == NULL) + ops->to_get_trace_status = delegate_get_trace_status; + if (ops->to_get_tracepoint_status == NULL) + ops->to_get_tracepoint_status = delegate_get_tracepoint_status; + if (ops->to_trace_stop == NULL) + ops->to_trace_stop = delegate_trace_stop; + if (ops->to_trace_find == NULL) + ops->to_trace_find = delegate_trace_find; + if (ops->to_get_trace_state_variable_value == NULL) + ops->to_get_trace_state_variable_value = delegate_get_trace_state_variable_value; + if (ops->to_save_trace_data == NULL) + ops->to_save_trace_data = delegate_save_trace_data; + if (ops->to_upload_tracepoints == NULL) + ops->to_upload_tracepoints = delegate_upload_tracepoints; + if (ops->to_upload_trace_state_variables == NULL) + ops->to_upload_trace_state_variables = delegate_upload_trace_state_variables; + if (ops->to_get_raw_trace_data == NULL) + ops->to_get_raw_trace_data = delegate_get_raw_trace_data; + if (ops->to_get_min_fast_tracepoint_insn_len == NULL) + ops->to_get_min_fast_tracepoint_insn_len = delegate_get_min_fast_tracepoint_insn_len; + if (ops->to_set_disconnected_tracing == NULL) + ops->to_set_disconnected_tracing = delegate_set_disconnected_tracing; + if (ops->to_set_circular_trace_buffer == NULL) + ops->to_set_circular_trace_buffer = delegate_set_circular_trace_buffer; + if (ops->to_set_trace_buffer_size == NULL) + ops->to_set_trace_buffer_size = delegate_set_trace_buffer_size; + if (ops->to_set_trace_notes == NULL) + ops->to_set_trace_notes = delegate_set_trace_notes; + if (ops->to_get_tib_address == NULL) + ops->to_get_tib_address = delegate_get_tib_address; + if (ops->to_set_permissions == NULL) + ops->to_set_permissions = delegate_set_permissions; + if (ops->to_static_tracepoint_marker_at == NULL) + ops->to_static_tracepoint_marker_at = delegate_static_tracepoint_marker_at; + if (ops->to_static_tracepoint_markers_by_strid == NULL) + ops->to_static_tracepoint_markers_by_strid = delegate_static_tracepoint_markers_by_strid; + if (ops->to_traceframe_info == NULL) + ops->to_traceframe_info = delegate_traceframe_info; + if (ops->to_use_agent == NULL) + ops->to_use_agent = delegate_use_agent; + if (ops->to_can_use_agent == NULL) + ops->to_can_use_agent = delegate_can_use_agent; if (ops->to_supports_btrace == NULL) ops->to_supports_btrace = delegate_supports_btrace; + if (ops->to_augmented_libraries_svr4_read == NULL) + ops->to_augmented_libraries_svr4_read = delegate_augmented_libraries_svr4_read; } static void @@ -777,16 +1311,19 @@ install_dummy_methods (struct target_ops *ops) ops->to_detach = tdefault_detach; ops->to_resume = tdefault_resume; ops->to_wait = tdefault_wait; + ops->to_fetch_registers = tdefault_fetch_registers; ops->to_store_registers = tdefault_store_registers; ops->to_prepare_to_store = tdefault_prepare_to_store; ops->to_files_info = tdefault_files_info; ops->to_insert_breakpoint = memory_insert_breakpoint; ops->to_remove_breakpoint = memory_remove_breakpoint; ops->to_can_use_hw_breakpoint = tdefault_can_use_hw_breakpoint; + ops->to_ranged_break_num_registers = tdefault_ranged_break_num_registers; ops->to_insert_hw_breakpoint = tdefault_insert_hw_breakpoint; ops->to_remove_hw_breakpoint = tdefault_remove_hw_breakpoint; ops->to_remove_watchpoint = tdefault_remove_watchpoint; ops->to_insert_watchpoint = tdefault_insert_watchpoint; + ops->to_insert_mask_watchpoint = tdefault_insert_mask_watchpoint; ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint; ops->to_stopped_data_address = tdefault_stopped_data_address; ops->to_watchpoint_addr_within_range = default_watchpoint_addr_within_range; @@ -810,6 +1347,7 @@ install_dummy_methods (struct target_ops *ops) ops->to_has_exited = tdefault_has_exited; ops->to_extra_thread_info = tdefault_extra_thread_info; ops->to_thread_name = tdefault_thread_name; + ops->to_stop = tdefault_stop; ops->to_rcmd = default_rcmd; ops->to_pid_to_exec_file = tdefault_pid_to_exec_file; ops->to_log_command = tdefault_log_command; @@ -827,6 +1365,38 @@ install_dummy_methods (struct target_ops *ops) ops->to_supports_multi_process = tdefault_supports_multi_process; ops->to_supports_enable_disable_tracepoint = tdefault_supports_enable_disable_tracepoint; ops->to_supports_string_tracing = tdefault_supports_string_tracing; + ops->to_supports_evaluation_of_breakpoint_conditions = tdefault_supports_evaluation_of_breakpoint_conditions; + ops->to_can_run_breakpoint_commands = tdefault_can_run_breakpoint_commands; ops->to_thread_architecture = default_thread_architecture; + ops->to_trace_init = tdefault_trace_init; + ops->to_download_tracepoint = tdefault_download_tracepoint; + ops->to_can_download_tracepoint = tdefault_can_download_tracepoint; + ops->to_download_trace_state_variable = tdefault_download_trace_state_variable; + ops->to_enable_tracepoint = tdefault_enable_tracepoint; + ops->to_disable_tracepoint = tdefault_disable_tracepoint; + ops->to_trace_set_readonly_regions = tdefault_trace_set_readonly_regions; + ops->to_trace_start = tdefault_trace_start; + ops->to_get_trace_status = tdefault_get_trace_status; + ops->to_get_tracepoint_status = tdefault_get_tracepoint_status; + ops->to_trace_stop = tdefault_trace_stop; + ops->to_trace_find = tdefault_trace_find; + ops->to_get_trace_state_variable_value = tdefault_get_trace_state_variable_value; + ops->to_save_trace_data = tdefault_save_trace_data; + ops->to_upload_tracepoints = tdefault_upload_tracepoints; + ops->to_upload_trace_state_variables = tdefault_upload_trace_state_variables; + ops->to_get_raw_trace_data = tdefault_get_raw_trace_data; + ops->to_get_min_fast_tracepoint_insn_len = tdefault_get_min_fast_tracepoint_insn_len; + ops->to_set_disconnected_tracing = tdefault_set_disconnected_tracing; + ops->to_set_circular_trace_buffer = tdefault_set_circular_trace_buffer; + ops->to_set_trace_buffer_size = tdefault_set_trace_buffer_size; + ops->to_set_trace_notes = tdefault_set_trace_notes; + ops->to_get_tib_address = tdefault_get_tib_address; + ops->to_set_permissions = tdefault_set_permissions; + ops->to_static_tracepoint_marker_at = tdefault_static_tracepoint_marker_at; + ops->to_static_tracepoint_markers_by_strid = tdefault_static_tracepoint_markers_by_strid; + ops->to_traceframe_info = tdefault_traceframe_info; + ops->to_use_agent = tdefault_use_agent; + ops->to_can_use_agent = tdefault_can_use_agent; ops->to_supports_btrace = tdefault_supports_btrace; + ops->to_augmented_libraries_svr4_read = tdefault_augmented_libraries_svr4_read; }