This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 00/32] clean up target delegation
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 16 Jan 2014 17:33:41 +0000
- Subject: Re: [RFC 00/32] clean up target delegation
- Authentication-results: sourceware.org; auth=none
- References: <1389640367-5571-1-git-send-email-tromey at redhat dot com> <52D6852E dot 6080400 at redhat dot com> <87wqi1rzrn dot fsf at fleche dot redhat dot com> <87r489ovt3 dot fsf at fleche dot redhat dot com>
On 01/15/2014 08:05 PM, Tom Tromey wrote:
> Tom> I started implementing the easy bits but then I realized that the debug
> Tom> target puts a wrinkle into this. For instance, inheriting to_shortname
> Tom> is needed when target debug is active.
>
> I did go ahead and write the appended, which removes the calls that
> truly aren't needed.
Excellent. Thanks.
For the archives, last night I updated my deprecated_xfer_memory removal
branch (in github), rebasing on top of Tom's. After that, de_fault
is gone.
>
> Tom
>
> commit b15ac78fa8b7c50df3eae348871c0e0d2e231199
> Author: Tom Tromey <tromey@redhat.com>
> Date: Wed Jan 15 12:58:50 2014 -0700
>
> remove some calls to INHERIT and de_fault
>
> This removes a few unnecessary calls to INHERIT and de_fault:
>
> * to_doc is only used when a target is registered
> * to_magic is only used when a target is pushed and not useful for
> current_target.
> * to_open and to_close are only ever called using a specific
> target_ops object; there is no need to de_fault them.
>
> 2014-01-15 Tom Tromey <tromey@redhat.com>
>
> * target.c (update_current_target): Do not INHERIT to_doc or
> to_magic. Do not de_fault to_open or to_close.
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 7a1b817..f4c9923 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,5 +1,10 @@
> 2014-01-15 Tom Tromey <tromey@redhat.com>
>
> + * target.c (update_current_target): Do not INHERIT to_doc or
> + to_magic. Do not de_fault to_open or to_close.
> +
> +2014-01-15 Tom Tromey <tromey@redhat.com>
> +
> * gcore.h (objfile_find_memory_regions): Declare.
> * gcore.c (objfile_find_memory_regions): No longer static. Add
> "self" argument.
> diff --git a/gdb/target.c b/gdb/target.c
> index 44e2490..f121e91 100644
> --- a/gdb/target.c
> +++ b/gdb/target.c
> @@ -604,13 +604,11 @@ update_current_target (void)
> {
> INHERIT (to_shortname, t);
> INHERIT (to_longname, t);
> - INHERIT (to_doc, t);
> INHERIT (to_attach_no_wait, t);
> INHERIT (deprecated_xfer_memory, t);
> INHERIT (to_have_steppable_watchpoint, t);
> INHERIT (to_have_continuable_watchpoint, t);
> INHERIT (to_has_thread_control, t);
> - INHERIT (to_magic, t);
> }
> #undef INHERIT
>
> @@ -622,12 +620,6 @@ update_current_target (void)
> if (!current_target.field) \
> current_target.field = value
>
> - de_fault (to_open,
> - (void (*) (char *, int))
> - tcomplain);
> - de_fault (to_close,
> - (void (*) (struct target_ops *))
> - target_ignore);
> de_fault (deprecated_xfer_memory,
> (int (*) (CORE_ADDR, gdb_byte *, int, int,
> struct mem_attrib *, struct target_ops *))
>
--
Pedro Alves