* RFA: make add_setshow_cmd public
@ 2002-06-25 10:40 Tom Tromey
2002-06-25 11:53 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2002-06-25 10:40 UTC (permalink / raw)
To: gdb-patches
This patch changes add_setshow_cmd to be public.
After this goes in I can change all the callers to add_set_cmd and
add_show_from_set. Then I will delete those functions.
Ok?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* command.h (add_setshow_cmd): Declare.
* cli/cli-decode.c (add_setshow_cmd): No longer static.
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.33
diff -u -r1.33 command.h
--- command.h 15 Jun 2002 22:05:32 -0000 1.33
+++ command.h 25 Jun 2002 17:38:55 -0000
@@ -210,6 +210,15 @@
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
+extern struct cmd_list_element *add_setshow_cmd (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
extern struct cmd_list_element *add_set_cmd (char *name, enum
command_class class,
var_types var_type, void *var,
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.25
diff -u -r1.25 cli-decode.c
--- cli/cli-decode.c 25 Jun 2002 05:39:18 -0000 1.25
+++ cli/cli-decode.c 25 Jun 2002 17:38:56 -0000
@@ -331,7 +331,7 @@
command. SET_FUNC and SHOW_FUNC are the callback functions (if
non-NULL). SET_DOC and SHOW_DOC are the documentation strings. */
-static struct cmd_list_element *
+struct cmd_list_element *
add_setshow_cmd (char *name,
enum command_class class,
var_types var_type, void *var,
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: RFA: make add_setshow_cmd public
2002-06-25 10:40 RFA: make add_setshow_cmd public Tom Tromey
@ 2002-06-25 11:53 ` Andrew Cagney
2002-06-25 11:58 ` Tom Tromey
2002-06-25 12:02 ` Tom Tromey
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Cagney @ 2002-06-25 11:53 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
> This patch changes add_setshow_cmd to be public.
> After this goes in I can change all the callers to add_set_cmd and
> add_show_from_set. Then I will delete those functions.
Can the public version return void?
> +extern struct cmd_list_element *add_setshow_cmd (char *name,
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: make add_setshow_cmd public
2002-06-25 11:53 ` Andrew Cagney
@ 2002-06-25 11:58 ` Tom Tromey
2002-06-25 12:02 ` Tom Tromey
1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2002-06-25 11:58 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> Can the public version return void?
Good question. In most cases, yes.
In some cases we need both command structures so we can deprecate
them; I've been punting on this for now.
I've switched about half the calls so far. I seem to recall one that
needed the return value. I'll have to look for it.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: make add_setshow_cmd public
2002-06-25 11:53 ` Andrew Cagney
2002-06-25 11:58 ` Tom Tromey
@ 2002-06-25 12:02 ` Tom Tromey
1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2002-06-25 12:02 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> Can the public version return void?
I looked. There is this code in cli-cmds.c that uses the return value:
set_verbose (NULL, 0, c);
This whole joke function is pretty stale though and could be removed.
IMHO.
Also from infcmd.c:
set_cmd_completer (c, filename_completer);
All other uses (that I've run into so far) are for deprecation.
Right now the straightforward translation breaks these uses.
Any preferences here?
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-06-25 19:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-25 10:40 RFA: make add_setshow_cmd public Tom Tromey
2002-06-25 11:53 ` Andrew Cagney
2002-06-25 11:58 ` Tom Tromey
2002-06-25 12:02 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox