Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Philipp Rudo <prudo@linux.vnet.ibm.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
	Tom Tromey <tom@tromey.com>,
		"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Andreas Arnez <arnez@linux.vnet.ibm.com>,
		Patrick Monnerat <Patrick.Monnerat@datasphere.ch>,
	Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
Date: Wed, 01 Mar 2017 22:17:00 -0000	[thread overview]
Message-ID: <CAH=s-PPWRUqxd8BoJe4v4f033G53jMtQUWHRkAtfbtTxXJ6-qg@mail.gmail.com> (raw)
In-Reply-To: <20170301101132.12dfd0b2@ThinkPad>

On 17-03-01 10:11:32, Philipp Rudo wrote:
> >
> > However, I think we are in a weird position where we have some
> > deprecated features used by a program that we don't want to break,
> > but that will most likely not change to stop using these features.
> > If we want to exit that endless loop some day, I guess Insight should
> > be converted to use MI, like other frontends.
>
> This really is a tricky situation.  I think converting to MI will be
> the best for insight.  Although I fear that this will be a bigger
> task.  What I found out when I looked at deprecated_query_hook (still
> used in MI interpreter) this is not so simple as setting this hook only
> changes GDBs behavior on certain conditions.  Such that just checking
> for "interp->is_mi_like ()" would not help.  I fear for insight this
> will be similar.
>
> @Patrick: Can you estimate how much work convering to MI would be?

Why is it MI?  MI is for inter-process communication between front-end,
such as Emacs and Eclipse, and GDB.  The way Insight using GDB doesn't
fall in this model.  It just build with GDB source with gdbtk.  There is
no inter-process communication.  Observer is a better choice.

Andrew Cagney introduced observers and the deprecated hooks in 2004.
https://sourceware.org/ml/gdb-patches/2004-04/msg00271.html
Some of hooks were replaced by observers, but there are still some
leftovers, as we see today.  To be clear, I don't suggest we need to
convert these hooks to observers now.

> From https://sourceware.org/ml/gdb-patches/2017-02/msg00730.html
> Keith> However, I don't think this patch should be dismissed solely
> Keith> because Insight still uses them. [Insight was "kicked out" of
> Keith> the official GDB repository several years ago.]
> Keith>
> Keith> Instead, I would like to ask maintainers to consider
> Keith> that the "true" deprecation of these hooks be phased in over
> Keith> a release or three to give time to either replace
> Keith> them or assess how much time may be needed to properly replace
> Keith> these hooks.
>
> Considering that insight still uses the hooks waiting for N releases so
> they have time to adept sounds fair.
>
> By the way, is there something like a deprecation policy for GDB?  Or a
> place where deprecated features are collected?  If not a policy like
>
> "When GDB deprecates features they are prefixed with 'deprecated_' and
> deleted N releases after deprecation.  Deprecated features and their
> time of deletion are collected in the Wiki/NEWS/FIXME."

Insight is a special case, because GDB isn't compiled with/for other
programs, so the interfaces are CLI and MI.  AFAIK, we have
deprecated_cmd_warning.  We deprecated some hooks in 2004, but we
didn't provide alternatives.

>
> might be good.  What would that mean for code in GDB which still uses
> those features?  As mentioned before MI also uses two of those
> deprecated hooks.  Furthermore other parts of GDB also have deprecated
> features...
>

If these deprecated_ functions are not used by Insight, we are free to
remove them.

> frame.h:740:extern int deprecated_frame_register_read (struct frame_info *frame, int regnum,
> frame.h:830:extern struct frame_info *deprecated_safe_get_selected_frame (void);
> gdbarch.h:388:extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
> gdbarch.h:389:extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
> gdbarch.h:600:extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
> gdbarch.h:601:extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
> gdbarch.h:1745:extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
> gdbcore.h:237:extern void deprecated_add_core_fns (struct core_fns *cf);

We can remove them, no problem.

> target.h:2327:extern void add_deprecated_target_alias (struct target_ops *t, char *alias);
> tracepoint.h:305:extern void (*deprecated_trace_find_hook) (char *arg, int from_tty);
> tracepoint.h:306:extern void (*deprecated_trace_start_stop_hook) (int start, int from_tty);

These two hooks are not used at all.

> value.h:110:extern void deprecated_set_value_type (struct value *value,
> value.h:145:extern int deprecated_value_modifiable (const struct value *value);
> value.h:414:extern enum lval_type *deprecated_value_lval_hack (struct value *);
> value.h:434:extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
> value.h:441:extern struct frame_id *deprecated_value_next_frame_id_hack (struct value *);
> value.h:451:extern int *deprecated_value_regnum_hack (struct value *);

We can remove them too.

-- 
Yao


  reply	other threads:[~2017-03-01 22:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 14:50 Philipp Rudo
2017-02-28 14:50 ` [PATCH 09/11] Remove unused deprecated_call_command_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 02/11] Remove unused deprecated_ui_loop_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 01/11] Remove unused deprecated_{pre|post}_add_symbol_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 05/11] Remove unused deprecated_readline{_begin|_end}_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 11/11] Remove deprecated_print_frame_info_listing_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 08/11] Remove unused deprecated_{attach|detach}_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 06/11] Remove unused deprecated_context_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 03/11] Remove unused deprecated_warning_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 10/11] Remove unused deprecated_ui_load_progress_hook Philipp Rudo
2017-02-28 15:28 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Tom Tromey
2017-02-28 15:52   ` Simon Marchi
2017-03-01  9:11     ` Philipp Rudo
2017-03-01 22:17       ` Yao Qi [this message]
2017-02-28 18:01 ` [PATCH 04/11] Remove unused deprecated_interactive_hook Philipp Rudo
2017-02-28 19:37 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Keith Seitz
2017-02-28 19:45 ` [PATCH 07/11] Remove unused deprecated_target_wait_hook Philipp Rudo

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='CAH=s-PPWRUqxd8BoJe4v4f033G53jMtQUWHRkAtfbtTxXJ6-qg@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=Patrick.Monnerat@datasphere.ch \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=prudo@linux.vnet.ibm.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /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