From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [RFC v2 31/38] minor cleanups to update_current_target
Date: Thu, 06 Feb 2014 21:24:00 -0000 [thread overview]
Message-ID: <1391720136-2121-32-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1391720136-2121-1-git-send-email-tromey@redhat.com>
During the conversion I kept all the "do not inherit" comments in
update_current_target. However, now they are not needed. This patch
updates the comments for INHERIT and de_fault, and removes the
somewhat odd INHERIT of to_stratum.
2014-02-06 Tom Tromey <tromey@redhat.com>
* target.c (update_current_target): Update comments. Do not
INHERIT to_stratum.
---
gdb/ChangeLog | 5 +++
gdb/target.c | 128 +++-------------------------------------------------------
2 files changed, 11 insertions(+), 122 deletions(-)
diff --git a/gdb/target.c b/gdb/target.c
index 6f87671..eded617 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -592,147 +592,31 @@ update_current_target (void)
/* Install the delegators. */
install_delegators (¤t_target);
+ current_target.to_stratum = target_stack->to_stratum;
+
#define INHERIT(FIELD, TARGET) \
if (!current_target.FIELD) \
current_target.FIELD = (TARGET)->FIELD
+ /* Do not add any new INHERITs here. Instead, use the delegation
+ mechanism provided by make-target-delegates. */
for (t = target_stack; t; t = t->beneath)
{
INHERIT (to_shortname, t);
INHERIT (to_longname, t);
INHERIT (to_doc, t);
- /* Do not inherit to_open. */
- /* Do not inherit to_close. */
- /* Do not inherit to_attach. */
- /* Do not inherit to_post_attach. */
INHERIT (to_attach_no_wait, t);
- /* Do not inherit to_detach. */
- /* Do not inherit to_disconnect. */
- /* Do not inherit to_resume. */
- /* Do not inherit to_wait. */
- /* Do not inherit to_fetch_registers. */
- /* Do not inherit to_store_registers. */
- /* Do not inherit to_prepare_to_store. */
INHERIT (deprecated_xfer_memory, t);
- /* Do not inherit to_files_info. */
- /* Do not inherit to_insert_breakpoint. */
- /* Do not inherit to_remove_breakpoint. */
- /* Do not inherit to_can_use_hw_breakpoint. */
- /* Do not inherit to_insert_hw_breakpoint. */
- /* Do not inherit to_remove_hw_breakpoint. */
- /* Do not inherit to_ranged_break_num_registers. */
- /* Do not inherit to_insert_watchpoint. */
- /* Do not inherit to_remove_watchpoint. */
- /* Do not inherit to_insert_mask_watchpoint. */
- /* Do not inherit to_remove_mask_watchpoint. */
- /* Do not inherit to_stopped_data_address. */
INHERIT (to_have_steppable_watchpoint, t);
INHERIT (to_have_continuable_watchpoint, t);
- /* Do not inherit to_stopped_by_watchpoint. */
- /* Do not inherit to_watchpoint_addr_within_range. */
- /* Do not inherit to_region_ok_for_hw_watchpoint. */
- /* Do not inherit to_can_accel_watchpoint_condition. */
- /* Do not inherit to_masked_watch_num_registers. */
- /* Do not inherit to_terminal_init. */
- /* Do not inherit to_terminal_inferior. */
- /* Do not inherit to_terminal_ours_for_output. */
- /* Do not inherit to_terminal_ours. */
- /* Do not inherit to_terminal_save_ours. */
- /* Do not inherit to_terminal_info. */
- /* Do not inherit to_kill. */
- /* Do not inherit to_load. */
- /* Do no inherit to_create_inferior. */
- /* Do not inherit to_post_startup_inferior. */
- /* Do not inherit to_insert_fork_catchpoint. */
- /* Do not inherit to_remove_fork_catchpoint. */
- /* Do not inherit to_insert_vfork_catchpoint. */
- /* Do not inherit to_remove_vfork_catchpoint. */
- /* Do not inherit to_follow_fork. */
- /* Do not inherit to_insert_exec_catchpoint. */
- /* Do not inherit to_remove_exec_catchpoint. */
- /* Do not inherit to_set_syscall_catchpoint. */
- /* Do not inherit to_has_exited. */
- /* Do not inherit to_mourn_inferior. */
- /* Do not inherit to_can_run. */
- /* Do not inherit to_pass_signals. */
- /* Do not inherit to_program_signals. */
- /* Do not inherit to_thread_alive. */
- /* Do not inherit to_find_new_threads. */
- /* Do not inherit to_pid_to_str. */
- /* Do not inherit to_extra_thread_info. */
- /* Do not inherit to_thread_name. */
- /* Do not inherit to_stop. */
- /* Do not inherit to_xfer_partial. */
- /* Do not inherit to_rcmd. */
- /* Do not inherit to_pid_to_exec_file. */
- /* Do not inherit to_log_command. */
- INHERIT (to_stratum, t);
- /* Do not inherit to_has_all_memory. */
- /* Do not inherit to_has_memory. */
- /* Do not inherit to_has_stack. */
- /* Do not inherit to_has_registers. */
- /* Do not inherit to_has_execution. */
INHERIT (to_has_thread_control, t);
- /* Do not inherit to_can_async_p. */
- /* Do not inherit to_is_async_p. */
- /* Do not inherit to_async. */
- /* Do not inherit to_find_memory_regions. */
- /* Do not inherit to_make_corefile_notes. */
- /* Do not inherit to_get_bookmark. */
- /* Do not inherit to_goto_bookmark. */
- /* Do not inherit to_get_thread_local_address. */
- /* Do not inherit to_can_execute_reverse. */
- /* Do not inherit to_execution_direction. */
- /* Do not inherit to_thread_architecture. */
- /* Do not inherit to_read_description. */
- /* Do not inherit to_get_ada_task_ptid. */
- /* Do not inherit to_search_memory. */
- /* Do not inherit to_supports_multi_process. */
- /* Do not inherit to_supports_enable_disable_tracepoint. */
- /* Do not inherit to_supports_string_tracing. */
- /* Do not inherit to_trace_init. */
- /* Do not inherit to_download_tracepoint. */
- /* Do not inherit to_can_download_tracepoint. */
- /* Do not inherit to_download_trace_state_variable. */
- /* Do not inherit to_enable_tracepoint. */
- /* Do not inherit to_disable_tracepoint. */
- /* Do not inherit to_trace_set_readonly_regions. */
- /* Do not inherit to_trace_start. */
- /* Do not inherit to_get_trace_status. */
- /* Do not inherit to_get_tracepoint_status. */
- /* Do not inherit to_trace_stop. */
- /* Do not inherit to_trace_find. */
- /* Do not inherit to_get_trace_state_variable_value. */
- /* Do not inherit to_save_trace_data. */
- /* Do not inherit to_upload_tracepoints. */
- /* Do not inherit to_upload_trace_state_variables. */
- /* Do not inherit to_get_raw_trace_data. */
- /* Do not inherit to_get_min_fast_tracepoint_insn_len. */
- /* Do not inherit to_set_disconnected_tracing. */
- /* Do not inherit to_set_circular_trace_buffer. */
- /* Do not inherit to_set_trace_buffer_size. */
- /* Do not inherit to_set_trace_notes. */
- /* Do not inherit to_get_tib_address. */
- /* Do not inherit to_set_permissions. */
- /* Do not inherit to_static_tracepoint_marker_at. */
- /* Do not inherit to_static_tracepoint_markers_by_strid. */
- /* Do not inherit to_traceframe_info. */
- /* Do not inherit to_use_agent. */
- /* Do not inherit to_can_use_agent. */
- /* Do not inherit to_augmented_libraries_svr4_read. */
INHERIT (to_magic, t);
- /* Do not inherit
- to_supports_evaluation_of_breakpoint_conditions. */
- /* Do not inherit to_can_run_breakpoint_commands. */
- /* Do not inherit to_memory_map. */
- /* Do not inherit to_flash_erase. */
- /* Do not inherit to_flash_done. */
}
#undef INHERIT
/* Clean up a target struct so it no longer has any zero pointers in
- it. Some entries are defaulted to a method that print an error,
- others are hard-wired to a standard recursive default. */
+ it. Do not add any new de_faults here. Instead, use the
+ delegation mechanism provided by make-target-delegates. */
#define de_fault(field, value) \
if (!current_target.field) \
--
1.8.1.4
next prev parent reply other threads:[~2014-02-06 21:24 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 20:55 [RFC v2 00/38] clean up target delegation Tom Tromey
2014-02-06 20:55 ` [RFC v2 02/38] introduce and use find_target_at Tom Tromey
2014-02-07 15:43 ` Pedro Alves
2014-02-07 21:54 ` Tom Tromey
2014-02-10 14:28 ` Pedro Alves
2014-02-06 20:55 ` [RFC v2 03/38] add make-target-delegates Tom Tromey
2014-02-06 20:55 ` [RFC v2 16/38] Add target_ops argument to to_static_tracepoint_markers_by_strid Tom Tromey
2014-02-06 20:55 ` [RFC v2 08/38] Add target_ops argument to to_terminal_init Tom Tromey
2014-02-06 20:55 ` [RFC v2 09/38] Add target_ops argument to to_insert_vfork_catchpoint Tom Tromey
2014-02-06 20:56 ` [RFC v2 21/38] convert to_extra_thread_info Tom Tromey
2014-02-06 20:56 ` [RFC v2 28/38] convert to_insn_history Tom Tromey
2014-02-06 20:56 ` [RFC v2 23/38] convert to_disable_tracepoint Tom Tromey
2014-02-06 20:56 ` [RFC v2 10/38] Add target_ops argument to to_thread_name Tom Tromey
2014-02-06 20:56 ` [RFC v2 32/38] remove function casts from target.c Tom Tromey
2014-02-06 20:56 ` [RFC v2 24/38] convert to_upload_trace_state_variables Tom Tromey
2014-02-06 20:56 ` [RFC v2 36/38] convert to_decr_pc_after_break Tom Tromey
2014-02-06 20:56 ` [RFC v2 26/38] convert to_insert_mask_watchpoint Tom Tromey
2014-02-06 20:56 ` [RFC v2 34/38] remove exec_set_find_memory_regions Tom Tromey
2014-02-06 20:56 ` [RFC v2 07/38] Add target_ops argument to to_close Tom Tromey
2014-02-08 3:00 ` Yao Qi
2014-02-10 17:50 ` Tom Tromey
2014-02-06 20:56 ` [RFC v2 29/38] convert to_search_memory Tom Tromey
2014-02-06 20:56 ` [RFC v2 22/38] convert to_thread_architecture Tom Tromey
2014-02-06 20:56 ` [RFC v2 01/38] add "this" pointers to more target APIs Tom Tromey
2014-02-08 5:19 ` Doug Evans
2014-02-10 22:36 ` Doug Evans
2014-02-10 23:01 ` Doug Evans
2014-02-12 19:56 ` Tom Tromey
2014-02-12 20:22 ` Doug Evans
2014-02-06 20:56 ` [RFC v2 35/38] remove some calls to INHERIT and de_fault Tom Tromey
2014-02-06 20:56 ` [RFC v2 27/38] convert to_get_section_table Tom Tromey
2014-02-06 20:56 ` [RFC v2 37/38] fix buglet in nto-procfs.c Tom Tromey
2014-02-07 16:01 ` Pedro Alves
2014-02-06 20:58 ` [RFC v2 04/38] add target method delegation Tom Tromey
2014-02-07 15:53 ` Pedro Alves
2014-02-07 21:37 ` Tom Tromey
2014-02-06 20:58 ` [RFC v2 17/38] Add target_ops argument to to_save_record Tom Tromey
2014-02-06 20:58 ` [RFC v2 20/38] convert to_load Tom Tromey
2014-02-06 20:58 ` [RFC v2 25/38] convert to_static_tracepoint_markers_by_strid Tom Tromey
2014-02-06 20:58 ` [RFC v2 11/38] Add target_ops argument to to_get_ada_task_ptid Tom Tromey
2014-02-06 21:23 ` [RFC v2 19/38] convert to_remove_watchpoint Tom Tromey
2014-02-06 21:23 ` [RFC v2 15/38] Add target_ops argument to to_upload_trace_state_variables Tom Tromey
2014-02-06 21:23 ` [RFC v2 12/38] Add target_ops argument to to_can_execute_reverse Tom Tromey
2014-02-06 21:23 ` [RFC v2 06/38] introduce remote_load Tom Tromey
2014-02-06 21:24 ` [RFC v2 05/38] convert to_supports_btrace Tom Tromey
2014-02-06 21:24 ` Tom Tromey [this message]
2014-02-06 21:24 ` [RFC v2 14/38] Add target_ops argument to to_disable_tracepoint Tom Tromey
2014-02-06 21:24 ` [RFC v2 13/38] Add target_ops argument to to_fileio_pwrite Tom Tromey
2014-02-06 21:38 ` [RFC v2 33/38] pass NULL to TARGET_DEFAULT_RETURN when appropriate Tom Tromey
2014-02-06 21:38 ` [RFC v2 30/38] change delegation for to_read_description Tom Tromey
2014-02-06 21:42 ` [RFC v2 18/38] convert to_detach Tom Tromey
2014-02-06 21:47 ` [RFC v2 38/38] convert to_get_unwinder and to_get_tailcall_unwinder to methods Tom Tromey
2014-02-07 16:02 ` Pedro Alves
2014-02-07 16:47 ` [RFC v2 00/38] clean up target delegation Pedro Alves
2014-02-19 16:35 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391720136-2121-32-git-send-email-tromey@redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox