Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 13/16] gdb: remove cmd_list_element::function::sfunc
Date: Wed, 28 Jul 2021 17:17:43 -0400	[thread overview]
Message-ID: <3fd5929e-1818-fc57-425b-2b0065f3f252@polymtl.ca> (raw)
In-Reply-To: <871r7idzl7.fsf@tromey.com>

On 2021-07-28 3:10 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> I don't understand what the sfunc function type in
> Simon> cmd_list_element::function is for.
> 
> Thanks for cleaning this stuff up.
> My feeling is that, probably, some of this was from a planned transition
> that was never completed.  It's hard to know for sure though.

That's what I thought as well.

> Simon>  int
> Simon>  cli_user_command_p (struct cmd_list_element *cmd)
> Simon>  {
> Simon> -  return (cmd->theclass == class_user
> Simon> -	  && (cmd->func == do_simple_func || cmd->func == do_sfunc));
> Simon> +  return cmd->theclass == class_user && cmd->func == do_simple_func;
> 
> This seems to change the semantics of this function, but I wonder if it
> matters at all.  (Ideally, though, cli_user_command_p would simply go
> away.)

I'm not 100% sure either, this is all very confusing.

The ways to create commands with class_user I know of are:

 - do_define_command
 - Python and Guile, if the user passes gdb.COMMAND_USER as the class.

do_define_command passes the dummy user_defined_command function as the
command's function, which makes it have a "simple func".  Python and
Guile do not.  So in the end that check will filter out Python and Guile
commands, which I think is what we want to do.

Simon

  reply	other threads:[~2021-07-28 21:18 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14  4:55 [PATCH 00/16] Bunch of commands related cleanups Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 01/16] gdb/testsuite: split gdb.python/py-parameter.exp in procs Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 02/16] gdb.base/setshow.exp: use save_vars to save/restore gdb_prompt Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 03/16] gdb.base/setshow.exp: split in procs Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 04/16] gdb.base/setshow.exp: fix duplicate test name Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 05/16] gdb: un-share set_inferior_cwd declaration Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 06/16] gdb: remove inferior::{argc,argv} Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 07/16] gdb: add setter/getter for inferior arguments Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 08/16] gdb: add setter/getter for inferior cwd Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 09/16] gdb: make inferior::m_args an std::string Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 10/16] gdb: make inferior::m_cwd " Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 11/16] gdb: make inferior::m_terminal " Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 12/16] gdb: rename cfunc to simple_func Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 13/16] gdb: remove cmd_list_element::function::sfunc Simon Marchi via Gdb-patches
2021-07-28 19:10   ` Tom Tromey
2021-07-28 21:17     ` Simon Marchi via Gdb-patches [this message]
2021-07-29 17:33       ` Tom Tromey
2021-07-14  4:55 ` [PATCH 14/16] gdb/testsuite: test get/set value of unregistered Guile parameter Simon Marchi via Gdb-patches
2021-07-23 19:42   ` Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 15/16] gdb: make cmd_list_element var an optional union Simon Marchi via Gdb-patches
2021-07-14 12:08   ` Lancelot SIX via Gdb-patches
2021-07-14 17:12     ` Lancelot SIX via Gdb-patches
2021-07-14 19:22       ` Simon Marchi via Gdb-patches
2021-07-14 23:22         ` Lancelot SIX via Gdb-patches
2021-07-19 14:32           ` Simon Marchi via Gdb-patches
2021-07-19 19:52             ` Simon Marchi via Gdb-patches
2021-07-20 23:03               ` Lancelot SIX via Gdb-patches
2021-07-23 19:56                 ` Simon Marchi via Gdb-patches
2021-07-23 20:46                   ` Lancelot SIX via Gdb-patches
2021-07-23 21:15                     ` Simon Marchi via Gdb-patches
2021-07-23 22:55                       ` Lancelot SIX via Gdb-patches
2021-07-24  2:04                         ` Simon Marchi via Gdb-patches
2021-07-28 20:13                 ` Tom Tromey
2021-07-28 20:45                   ` Lancelot SIX via Gdb-patches
2021-07-29 17:47                     ` Tom Tromey
2021-07-29 20:12                       ` Lancelot SIX via Gdb-patches
2021-07-30  2:09                         ` Simon Marchi via Gdb-patches
2021-07-30 17:47                           ` Lancelot SIX via Gdb-patches
2021-07-18 15:44   ` Lancelot SIX via Gdb-patches
2021-07-19 14:19     ` Simon Marchi via Gdb-patches
2021-07-19 20:58       ` Lancelot SIX via Gdb-patches
2021-07-28 19:47   ` Tom Tromey
2021-07-28 20:59     ` Simon Marchi via Gdb-patches
2021-07-29 17:41       ` Tom Tromey
2021-07-29 17:44         ` Simon Marchi via Gdb-patches
2021-07-29 17:49           ` Tom Tromey
2021-07-29 18:00             ` Simon Marchi via Gdb-patches
2021-07-14  4:55 ` [PATCH 16/16] gdb: make string-like set show commands use std::string variable Simon Marchi via Gdb-patches
2021-07-28 20:27   ` Tom Tromey
2021-07-28 21:03     ` Simon Marchi via Gdb-patches

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=3fd5929e-1818-fc57-425b-2b0065f3f252@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --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