* eliminate deprecated_add_set_cmd
@ 2008-12-31 1:15 Pedro Alves
2008-12-31 4:10 ` Joel Brobecker
2008-12-31 4:22 ` Eli Zaretskii
0 siblings, 2 replies; 10+ messages in thread
From: Pedro Alves @ 2008-12-31 1:15 UTC (permalink / raw)
To: gdb-patches; +Cc: Eli Zaretskii, ams, Thomas Schwinge
[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]
Hi!
I just noticed that we're close to being able to eliminate
the old deprecated_add_set_cmd interface. The only two commands
left using it are:
"maint show-debug-regs"
(gdb) help maint show-debug-regs
Set whether to show variables that mirror the x86 debug registers.
Use "on" to enable, "off" to disable.
If enabled, the debug registers values are shown when GDB inserts
or removes a hardware breakpoint or watchpoint, and when the inferior
triggers a breakpoint or watchpoint.
And, "maint gnu-debug"
(gdb) help maint gnu-debug
Set debugging output for the gnu backend.
The attached patch converts them to use the add_setshow
alternatives, in the least intrusive way. Well, it has one
immediate benefit: 'maint show-debug-regs <tab>' now autocompletes:
(gdb) maint show-debug-regs o
off on
However, the new interfaces (add_setshow_*) were added mainly because
every set command should be paired with a show command -- both these
commands in their current state have no way to let the user know the
status of the setting --- they're write-only. While I'm at it, this
would be a good time to fix it up for these remaining commands.
Hence, the million dollar question:
Would you prefer the commands to stay as they are, or, to rename
the commands to be able to add a "show" facility ?
E.g., say, for the x86 debug registers debug output,
maint show-debug-regs -> maint set show-debug-regs on|off
maint show show-debug-regs
Alternatively:
maint show-debug-regs -> set debug debug-regs on|off
maint show debug-regs
?
And, for the gnu/hurd people debugging the debugger:
maint gnu-debug -> maint set gnu-debug
maint show gnu-debug
Alternatively:
maint gnu-debug -> set debug gnu (, gnu-nat, gnu-hurd, gnu-whatever, ...)
show debug gnu
?
--
Pedro Alves
[-- Attachment #2: eliminate_deprecated_add_set_cmd.diff --]
[-- Type: text/x-diff, Size: 4173 bytes --]
---
gdb/cli/cli-decode.c | 11 -----------
gdb/command.h | 10 ----------
gdb/gnu-nat.c | 13 +++++++++----
gdb/i386-nat.c | 14 ++++++++++----
4 files changed, 19 insertions(+), 29 deletions(-)
Index: src/gdb/cli/cli-decode.c
===================================================================
--- src.orig/gdb/cli/cli-decode.c 2008-12-31 00:03:06.000000000 +0000
+++ src/gdb/cli/cli-decode.c 2008-12-31 00:45:14.000000000 +0000
@@ -407,17 +407,6 @@ add_setshow_cmd_full (char *name,
*show_result = show;
}
-struct cmd_list_element *
-deprecated_add_set_cmd (char *name,
- enum command_class class,
- var_types var_type,
- void *var,
- char *doc,
- struct cmd_list_element **list)
-{
- return add_set_or_show_cmd (name, set_cmd, class, var_type, var, doc, list);
-}
-
/* Add element named NAME to command list LIST (the list for set or
some sublist thereof). CLASS is as in add_cmd. ENUMLIST is a list
of strings which may follow NAME. VAR is address of the variable
Index: src/gdb/command.h
===================================================================
--- src.orig/gdb/command.h 2008-12-31 00:03:02.000000000 +0000
+++ src/gdb/command.h 2008-12-31 00:44:58.000000000 +0000
@@ -201,16 +201,6 @@ extern void help_list (struct cmd_list_e
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
-/* NOTE: cagney/2005-02-21: Since every set command should be paired
- with a corresponding show command (i.e., add_setshow_*) this call
- should not be needed. Unfortunatly some are not (e.g.,
- "maintenance <variable> <value>") and those need to be fixed. */
-extern struct cmd_list_element *deprecated_add_set_cmd (char *name, enum
- command_class class,
- var_types var_type, void *var,
- char *doc,
- struct cmd_list_element **list);
-
/* Method for show a set/show variable's VALUE on FILE. If this
method isn't supplied deprecated_show_value_hack() is called (which
is not good). */
Index: src/gdb/gnu-nat.c
===================================================================
--- src.orig/gdb/gnu-nat.c 2008-12-31 00:02:58.000000000 +0000
+++ src/gdb/gnu-nat.c 2008-12-31 00:27:56.000000000 +0000
@@ -3398,6 +3398,8 @@ to the thread's initial suspend-count wh
void
_initialize_gnu_nat (void)
{
+ static struct cmd_list_element *dummy_showlist;
+
proc_server = getproc ();
init_gnu_ops ();
@@ -3405,10 +3407,13 @@ _initialize_gnu_nat (void)
add_task_commands ();
add_thread_commands ();
- deprecated_add_set_cmd ("gnu-debug", class_maintenance,
- var_boolean, (char *) &gnu_debug_flag,
- "Set debugging output for the gnu backend.",
- &maintenancelist);
+ add_setshow_boolean_cmd ("gnu-debug", class_maintenance,
+ &gnu_debug_flag,
+ _("Set debugging output for the gnu backend."),
+ NULL,
+ NULL,
+ &maintenancelist,
+ &dummy_showlist);
}
\f
#ifdef FLUSH_INFERIOR_CACHE
Index: src/gdb/i386-nat.c
===================================================================
--- src.orig/gdb/i386-nat.c 2008-12-31 00:02:56.000000000 +0000
+++ src/gdb/i386-nat.c 2008-12-31 00:26:13.000000000 +0000
@@ -706,15 +706,21 @@ void
_initialize_i386_nat (void)
{
#ifdef I386_USE_GENERIC_WATCHPOINTS
+ static struct cmd_list_element *dummy_showlist;
+
/* A maintenance command to enable printing the internal DRi mirror
variables. */
- deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
- var_boolean, (char *) &maint_show_dr, _("\
-Set whether to show variables that mirror the x86 debug registers.\n\
+ add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
+ &maint_show_dr, _("\
+Set whether to show variables that mirror the x86 debug registers."),
+NULL, _("\
Use \"on\" to enable, \"off\" to disable.\n\
If enabled, the debug registers values are shown when GDB inserts\n\
or removes a hardware breakpoint or watchpoint, and when the inferior\n\
triggers a breakpoint or watchpoint."),
- &maintenancelist);
+ NULL,
+ NULL,
+ &maintenancelist,
+ &dummy_showlist);
#endif
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2008-12-31 1:15 eliminate deprecated_add_set_cmd Pedro Alves
@ 2008-12-31 4:10 ` Joel Brobecker
2009-01-04 17:36 ` Thomas Schwinge
2008-12-31 4:22 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2008-12-31 4:10 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Eli Zaretskii, ams, Thomas Schwinge
My 2 cents:
For these particular commands, I think it's fine to change their name.
I suspect only a few people would use them, and they won't have much
trouble finding the new command (or asking here if not).
I would prefer the set and show commands to be consistent, but that's
only a very mild preference based purely on aesthetics.
> E.g., say, for the x86 debug registers debug output,
>
> maint show-debug-regs -> maint set show-debug-regs on|off
> maint show show-debug-regs
I like this one better.
> maint gnu-debug -> set debug gnu (, gnu-nat, gnu-hurd, gnu-whatever, ...)
> show debug gnu
I like this one better.
--
Joel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2008-12-31 1:15 eliminate deprecated_add_set_cmd Pedro Alves
2008-12-31 4:10 ` Joel Brobecker
@ 2008-12-31 4:22 ` Eli Zaretskii
2008-12-31 4:28 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2008-12-31 4:22 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, ams, tschwinge
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Wed, 31 Dec 2008 01:14:44 +0000
> Cc: Eli Zaretskii <eliz@gnu.org>, ams@gnu.org, Thomas Schwinge <tschwinge@gnu.org>
>
> Would you prefer the commands to stay as they are, or, to rename
> the commands to be able to add a "show" facility ?
I don't mind making the change you suggest.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2008-12-31 4:22 ` Eli Zaretskii
@ 2008-12-31 4:28 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2008-12-31 4:28 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: pedro, gdb-patches, ams, tschwinge
> Date: Wed, 31 Dec 2008 06:21:54 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: gdb-patches@sourceware.org, ams@gnu.org, tschwinge@gnu.org
>
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Wed, 31 Dec 2008 01:14:44 +0000
> > Cc: Eli Zaretskii <eliz@gnu.org>, ams@gnu.org, Thomas Schwinge <tschwinge@gnu.org>
> >
> > Would you prefer the commands to stay as they are, or, to rename
> > the commands to be able to add a "show" facility ?
>
> I don't mind making the change you suggest.
But please also change the manual, if you do.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2008-12-31 4:10 ` Joel Brobecker
@ 2009-01-04 17:36 ` Thomas Schwinge
2009-01-05 19:31 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Schwinge @ 2009-01-04 17:36 UTC (permalink / raw)
To: Joel Brobecker, Pedro Alves; +Cc: gdb-patches, Eli Zaretskii, ams
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
Hello!
Pedro, first, thanks for the heads-up.
On Wed, Dec 31, 2008 at 08:09:58AM +0400, Joel Brobecker wrote:
> For these particular commands, I think it's fine to change their name.
> I suspect only a few people would use them, and they won't have much
> trouble finding the new command (or asking here if not).
Agreed.
> I would prefer the set and show commands to be consistent, but that's
> only a very mild preference based purely on aesthetics.
Also agreed.
> > maint gnu-debug -> set debug gnu (, gnu-nat, gnu-hurd, gnu-whatever, ...)
> > show debug gnu
>
> I like this one better.
Yes, and also perhaps indeed change the name to ``debug gnu-nat'', as
that's exactly what it does.
Pedro, even if I don't expect any breakage, did you check your patch on a
GNU/Hurd system or shall I do so?
Also, I found another (doc-only) reference of `deprecated_add_set_cmd' in
`valprint.c'.
Regards,
Thomas
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2009-01-04 17:36 ` Thomas Schwinge
@ 2009-01-05 19:31 ` Pedro Alves
2009-01-07 21:33 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-01-05 19:31 UTC (permalink / raw)
To: gdb-patches; +Cc: Thomas Schwinge, Joel Brobecker, Eli Zaretskii, ams
On Sunday 04 January 2009 17:35:20, Thomas Schwinge wrote:
[...]
Okay, I think we're all in sync.
>
> Yes, and also perhaps indeed change the name to ``debug gnu-nat'', as
> that's exactly what it does.
Okay, I'll do that. Thanks.
> Pedro, even if I don't expect any breakage, did you check your patch on a
> GNU/Hurd system or shall I do so?
The patch I posted didn't change the commands at all. I'll write a new one
up, and I'll make sure it builds and works on GNU/Hurd before posting.
I'll also adjust the docs.
> Also, I found another (doc-only) reference of `deprecated_add_set_cmd' in
> `valprint.c'.
Yeah, I'd noticed that. That comment still has some relevance.
I'll see about rewriting it a bit to not mention the two methods
that have been removed since, but I may do that separatelly.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2009-01-05 19:31 ` Pedro Alves
@ 2009-01-07 21:33 ` Pedro Alves
2009-01-09 14:09 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-01-07 21:33 UTC (permalink / raw)
To: gdb-patches; +Cc: Thomas Schwinge, Joel Brobecker, Eli Zaretskii, ams
[-- Attachment #1: Type: text/plain, Size: 294 bytes --]
Here goes, new patch adjusting the commands to your feedback. I've also
confirmed that this builds and works correctly on gnu/Hurd.
Eli, are the doco bits OK? The old 'maint gnu-debug' wasn't
documented, so this adds a short blurb cloned from the
'set debug lin-lwp' docs.
--
Pedro Alves
[-- Attachment #2: eliminate_deprecated_add_set_cmd.diff --]
[-- Type: text/x-diff, Size: 6110 bytes --]
2009-01-07 Pedro Alves <pedro@codesourcery.com>
* cli/cli-decode.c (deprecated_add_set_cmd): Delete.
* command.h (deprecated_add_set_cmd): Delete declaration.
* gnu-nat.c (_initialize_gnu_nat): Replace 'maint gnu-debug' with
'set debug gnu-nat' and 'show debug gnu-nat'.
* i386-nat.c (_initialize_i386_nat): Replace 'maint
show-debug-registers' with 'maint set show-debug-registers' and
'maint show show-debug-registers'.
2009-01-07 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo: Document set/show debug gnu-nat. Replace 'maint
show-debug-regs' docs by 'maint set show-debug-regs' and 'maint
show show-debug-regs' docs.
---
gdb/cli/cli-decode.c | 11 -----------
gdb/command.h | 10 ----------
gdb/doc/gdb.texinfo | 11 +++++++++--
gdb/gnu-nat.c | 13 +++++++++----
gdb/i386-nat.c | 12 ++++++++----
5 files changed, 26 insertions(+), 31 deletions(-)
Index: src/gdb/cli/cli-decode.c
===================================================================
--- src.orig/gdb/cli/cli-decode.c 2009-01-05 17:16:49.000000000 +0000
+++ src/gdb/cli/cli-decode.c 2009-01-06 15:41:25.000000000 +0000
@@ -407,17 +407,6 @@ add_setshow_cmd_full (char *name,
*show_result = show;
}
-struct cmd_list_element *
-deprecated_add_set_cmd (char *name,
- enum command_class class,
- var_types var_type,
- void *var,
- char *doc,
- struct cmd_list_element **list)
-{
- return add_set_or_show_cmd (name, set_cmd, class, var_type, var, doc, list);
-}
-
/* Add element named NAME to command list LIST (the list for set or
some sublist thereof). CLASS is as in add_cmd. ENUMLIST is a list
of strings which may follow NAME. VAR is address of the variable
Index: src/gdb/command.h
===================================================================
--- src.orig/gdb/command.h 2009-01-05 17:16:39.000000000 +0000
+++ src/gdb/command.h 2009-01-06 15:41:25.000000000 +0000
@@ -201,16 +201,6 @@ extern void help_list (struct cmd_list_e
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
-/* NOTE: cagney/2005-02-21: Since every set command should be paired
- with a corresponding show command (i.e., add_setshow_*) this call
- should not be needed. Unfortunatly some are not (e.g.,
- "maintenance <variable> <value>") and those need to be fixed. */
-extern struct cmd_list_element *deprecated_add_set_cmd (char *name, enum
- command_class class,
- var_types var_type, void *var,
- char *doc,
- struct cmd_list_element **list);
-
/* Method for show a set/show variable's VALUE on FILE. If this
method isn't supplied deprecated_show_value_hack() is called (which
is not good). */
Index: src/gdb/gnu-nat.c
===================================================================
--- src.orig/gdb/gnu-nat.c 2009-01-05 17:16:41.000000000 +0000
+++ src/gdb/gnu-nat.c 2009-01-07 18:42:31.000000000 +0000
@@ -3405,10 +3405,15 @@ _initialize_gnu_nat (void)
add_task_commands ();
add_thread_commands ();
- deprecated_add_set_cmd ("gnu-debug", class_maintenance,
- var_boolean, (char *) &gnu_debug_flag,
- "Set debugging output for the gnu backend.",
- &maintenancelist);
+ add_setshow_boolean_cmd ("gnu-nat", class_maintenance,
+ &gnu_debug_flag,
+ _("Set debugging output for the gnu backend."),
+ _("Show debugging output for the gnu backend."),
+ NULL,
+ NULL,
+ NULL,
+ &setdebuglist,
+ &showdebuglist);
}
\f
#ifdef FLUSH_INFERIOR_CACHE
Index: src/gdb/i386-nat.c
===================================================================
--- src.orig/gdb/i386-nat.c 2009-01-05 17:16:42.000000000 +0000
+++ src/gdb/i386-nat.c 2009-01-07 00:47:47.000000000 +0000
@@ -709,13 +709,17 @@ _initialize_i386_nat (void)
#ifdef I386_USE_GENERIC_WATCHPOINTS
/* A maintenance command to enable printing the internal DRi mirror
variables. */
- deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
- var_boolean, (char *) &maint_show_dr, _("\
-Set whether to show variables that mirror the x86 debug registers.\n\
+ add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
+ &maint_show_dr, _("\
+Set whether to show variables that mirror the x86 debug registers."), _("\
+Show whether to show variables that mirror the x86 debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\
If enabled, the debug registers values are shown when GDB inserts\n\
or removes a hardware breakpoint or watchpoint, and when the inferior\n\
triggers a breakpoint or watchpoint."),
- &maintenancelist);
+ NULL,
+ NULL,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
#endif
}
Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo 2009-01-07 00:41:17.000000000 +0000
+++ src/gdb/doc/gdb.texinfo 2009-01-07 00:45:33.000000000 +0000
@@ -17416,6 +17416,11 @@ default is off.
@item show debug frame
Displays the current state of displaying @value{GDBN} frame debugging
info.
+@item set debug gnu-nat
+@cindex @sc{gnu}/Hurd debug messages
+Turns on or off debugging messages from the @sc{gnu}/Hurd debug support.
+@item show debug gnu-nat
+Show the current state of @sc{gnu}/Hurd debugging messages.
@item set debug infrun
@cindex inferior debugging info
Turns on or off display of @value{GDBN} debugging info for running the inferior.
@@ -24980,9 +24985,11 @@ Control the remote asynchronous support
Remote asynchronous support will be disabled until you use
the @samp{maint set remote-async} command to enable it.
-@kindex maint show-debug-regs
+@kindex maint set show-debug-regs
+@kindex maint show show-debug-regs
@cindex x86 hardware debug registers
-@item maint show-debug-regs
+@item maint set show-debug-regs
+@itemx maint show show-debug-regs
Control whether to show variables that mirror the x86 hardware debug
registers. Use @code{ON} to enable, @code{OFF} to disable. If
enabled, the debug registers values are shown when @value{GDBN} inserts or
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2009-01-07 21:33 ` Pedro Alves
@ 2009-01-09 14:09 ` Eli Zaretskii
2009-05-12 17:10 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2009-01-09 14:09 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, tschwinge, brobecker, ams
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Wed, 7 Jan 2009 21:33:56 +0000
> Cc: Thomas Schwinge <tschwinge@gnu.org>, Joel Brobecker <brobecker@adacore.com>, Eli Zaretskii <eliz@gnu.org>, ams@gnu.org
>
> Eli, are the doco bits OK?
Yes, but I think the change in show-debug-regs warrants an entry in
NEWS.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eliminate deprecated_add_set_cmd
2009-01-09 14:09 ` Eli Zaretskii
@ 2009-05-12 17:10 ` Pedro Alves
2009-05-14 14:37 ` Pierre Muller
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-05-12 17:10 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii; +Cc: tschwinge, brobecker, ams
Hi guys, I apologise for the delay in getting back to this.
On Friday 09 January 2009 14:09:26, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Wed, 7 Jan 2009 21:33:56 +0000
> > Cc: Thomas Schwinge <tschwinge@gnu.org>, Joel Brobecker <brobecker@adacore.com>, Eli Zaretskii <eliz@gnu.org>, ams@gnu.org
> >
> > Eli, are the doco bits OK?
>
The patch at the bottom is now checked in. I've managed to bork
up my debian/Hurd VM (*), and I don't remember if I ever build this
patch on the Hurd. :-/ I apologise if this breaks anything, but it
should be trivial/obvious to fix if so. :-)
* - hint: don't apt-get dist-upgrade with no drive space left!
> Yes, but I think the change in show-debug-regs warrants an entry in
> NEWS.
How's this?
* NEWS: Mention that the `maint show-debug-registers' and
`gnu-debug' commands were renamed to `maint set
show-debug-registers' and `set debug gnu-nat' respectivelly.
---
gdb/NEWS | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: src/gdb/NEWS
===================================================================
--- src.orig/gdb/NEWS 2009-05-12 17:51:36.000000000 +0100
+++ src/gdb/NEWS 2009-05-12 18:03:34.000000000 +0100
@@ -300,6 +300,20 @@ show tcp connect-timeout
with a specified timeout period; this is useful if the stub is launched
in parallel with GDB but may not be ready to accept connections immediately.
+maint set show-debug-registers (on|off)
+maint show show-debug-registers
+ The `maint show-debug-registers' command found in previous versions
+ of GDB has been renamed `maint set show-debug-registers' for
+ consistency with other commands, and `maint show
+ show-debug-registers' has been added.
+
+set debug gnu-nat (on|off)
+show debug gnu-nat
+ The previously undocumented `gnu-debug' command has been renamed
+ `set debug gnu-nat' for consistency with other commands, and `show
+ debug gnu-nat' has been added. These commands allow turning on or
+ off debugging messages from the GNU Hurd debug support.
+
* New native configurations
x86/x86_64 Darwin i[34567]86-*-darwin*
=============================================================
This is what I've already applied:
2009-05-12 Pedro Alves <pedro@codesourcery.com>
* cli/cli-decode.c (deprecated_add_set_cmd): Delete.
* command.h (deprecated_add_set_cmd): Delete declaration.
* gnu-nat.c (_initialize_gnu_nat): Replace 'maint gnu-debug' with
'set debug gnu-nat' and 'show debug gnu-nat'.
* i386-nat.c (_initialize_i386_nat): Replace 'maint
show-debug-registers' with 'maint set show-debug-registers' and
'maint show show-debug-registers'.
* mips-linux-nat.c (_initialize_mips_linux_nat): Replace 'maint
show-debug-registers' with 'maint set show-debug-registers' and
'maint show show-debug-registers'.
2009-05-12 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo: Document 'set/show debug gnu-nat'. Replace 'maint
show-debug-regs' docs by 'maint set show-debug-regs' and 'maint
show show-debug-regs' docs.
---
gdb/cli/cli-decode.c | 11 -----------
gdb/command.h | 10 ----------
gdb/doc/gdb.texinfo | 11 +++++++++--
gdb/gnu-nat.c | 13 +++++++++----
gdb/i386-nat.c | 12 ++++++++----
gdb/mips-linux-nat.c | 13 ++++++++-----
6 files changed, 34 insertions(+), 36 deletions(-)
Index: src/gdb/cli/cli-decode.c
===================================================================
--- src.orig/gdb/cli/cli-decode.c 2009-03-25 21:42:34.000000000 +0000
+++ src/gdb/cli/cli-decode.c 2009-05-12 17:22:14.000000000 +0100
@@ -397,17 +397,6 @@ add_setshow_cmd_full (char *name,
*show_result = show;
}
-struct cmd_list_element *
-deprecated_add_set_cmd (char *name,
- enum command_class class,
- var_types var_type,
- void *var,
- char *doc,
- struct cmd_list_element **list)
-{
- return add_set_or_show_cmd (name, set_cmd, class, var_type, var, doc, list);
-}
-
/* Add element named NAME to command list LIST (the list for set or
some sublist thereof). CLASS is as in add_cmd. ENUMLIST is a list
of strings which may follow NAME. VAR is address of the variable
Index: src/gdb/command.h
===================================================================
--- src.orig/gdb/command.h 2009-02-06 21:33:58.000000000 +0000
+++ src/gdb/command.h 2009-05-12 17:22:14.000000000 +0100
@@ -205,16 +205,6 @@ extern void help_list (struct cmd_list_e
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
-/* NOTE: cagney/2005-02-21: Since every set command should be paired
- with a corresponding show command (i.e., add_setshow_*) this call
- should not be needed. Unfortunatly some are not (e.g.,
- "maintenance <variable> <value>") and those need to be fixed. */
-extern struct cmd_list_element *deprecated_add_set_cmd (char *name, enum
- command_class class,
- var_types var_type, void *var,
- char *doc,
- struct cmd_list_element **list);
-
/* Method for show a set/show variable's VALUE on FILE. If this
method isn't supplied deprecated_show_value_hack() is called (which
is not good). */
Index: src/gdb/gnu-nat.c
===================================================================
--- src.orig/gdb/gnu-nat.c 2009-04-19 18:17:08.000000000 +0100
+++ src/gdb/gnu-nat.c 2009-05-12 17:22:14.000000000 +0100
@@ -3410,10 +3410,15 @@ _initialize_gnu_nat (void)
add_task_commands ();
add_thread_commands ();
- deprecated_add_set_cmd ("gnu-debug", class_maintenance,
- var_boolean, (char *) &gnu_debug_flag,
- "Set debugging output for the gnu backend.",
- &maintenancelist);
+ add_setshow_boolean_cmd ("gnu-nat", class_maintenance,
+ &gnu_debug_flag,
+ _("Set debugging output for the gnu backend."),
+ _("Show debugging output for the gnu backend."),
+ NULL,
+ NULL,
+ NULL,
+ &setdebuglist,
+ &showdebuglist);
}
\f
#ifdef FLUSH_INFERIOR_CACHE
Index: src/gdb/i386-nat.c
===================================================================
--- src.orig/gdb/i386-nat.c 2009-04-30 11:39:38.000000000 +0100
+++ src/gdb/i386-nat.c 2009-05-12 17:22:14.000000000 +0100
@@ -700,13 +700,17 @@ _initialize_i386_nat (void)
#ifdef I386_USE_GENERIC_WATCHPOINTS
/* A maintenance command to enable printing the internal DRi mirror
variables. */
- deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
- var_boolean, (char *) &maint_show_dr, _("\
-Set whether to show variables that mirror the x86 debug registers.\n\
+ add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
+ &maint_show_dr, _("\
+Set whether to show variables that mirror the x86 debug registers."), _("\
+Show whether to show variables that mirror the x86 debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\
If enabled, the debug registers values are shown when GDB inserts\n\
or removes a hardware breakpoint or watchpoint, and when the inferior\n\
triggers a breakpoint or watchpoint."),
- &maintenancelist);
+ NULL,
+ NULL,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
#endif
}
Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo 2009-05-04 10:51:47.000000000 +0100
+++ src/gdb/doc/gdb.texinfo 2009-05-12 17:23:28.000000000 +0100
@@ -17817,6 +17817,11 @@ default is off.
@item show debug frame
Displays the current state of displaying @value{GDBN} frame debugging
info.
+@item set debug gnu-nat
+@cindex @sc{gnu}/Hurd debug messages
+Turns on or off debugging messages from the @sc{gnu}/Hurd debug support.
+@item show debug gnu-nat
+Show the current state of @sc{gnu}/Hurd debugging messages.
@item set debug infrun
@cindex inferior debugging info
Turns on or off display of @value{GDBN} debugging info for running the inferior.
@@ -25935,9 +25940,11 @@ data in a @file{gmon.out} file, be sure
Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be
compiled with the @samp{-pg} compiler option.
-@kindex maint show-debug-regs
+@kindex maint set show-debug-regs
+@kindex maint show show-debug-regs
@cindex hardware debug registers
-@item maint show-debug-regs
+@item maint set show-debug-regs
+@itemx maint show show-debug-regs
Control whether to show variables that mirror the hardware debug
registers. Use @code{ON} to enable, @code{OFF} to disable. If
enabled, the debug registers values are shown when @value{GDBN} inserts or
Index: src/gdb/mips-linux-nat.c
===================================================================
--- src.orig/gdb/mips-linux-nat.c 2009-05-12 17:35:13.000000000 +0100
+++ src/gdb/mips-linux-nat.c 2009-05-12 17:36:36.000000000 +0100
@@ -1044,15 +1044,18 @@ _initialize_mips_linux_nat (void)
{
struct target_ops *t;
- deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
- var_boolean, (char *) &maint_show_dr, _("\
-Set whether to show variables that mirror the mips debug registers.\n\
+ add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
+ &maint_show_dr, _("\
+Set whether to show variables that mirror the mips debug registers."), _("\
+Show whether to show variables that mirror the mips debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\
If enabled, the debug registers values are shown when GDB inserts\n\
or removes a hardware breakpoint or watchpoint, and when the inferior\n\
triggers a breakpoint or watchpoint."),
- &maintenancelist);
-
+ NULL,
+ NULL,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
t = linux_trad_target (mips_linux_register_u_offset);
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: eliminate deprecated_add_set_cmd
2009-05-12 17:10 ` Pedro Alves
@ 2009-05-14 14:37 ` Pierre Muller
0 siblings, 0 replies; 10+ messages in thread
From: Pierre Muller @ 2009-05-14 14:37 UTC (permalink / raw)
To: 'Pedro Alves', gdb-patches, 'Eli Zaretskii'
Cc: tschwinge, brobecker, ams
As I follow-up to this patch,
I move the var_boolean rule in the A.R.Index
to ari_regression.
Pierre
as ARI stuff "maintainer".
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : Tuesday, May 12, 2009 7:11 PM
> À : gdb-patches@sourceware.org; Eli Zaretskii
> Cc : tschwinge@gnu.org; brobecker@adacore.com; ams@gnu.org
> Objet : Re: eliminate deprecated_add_set_cmd
>
> Hi guys, I apologise for the delay in getting back to this.
>
> On Friday 09 January 2009 14:09:26, Eli Zaretskii wrote:
> > > From: Pedro Alves <pedro@codesourcery.com>
> > > Date: Wed, 7 Jan 2009 21:33:56 +0000
> > > Cc: Thomas Schwinge <tschwinge@gnu.org>, Joel Brobecker
> <brobecker@adacore.com>, Eli Zaretskii <eliz@gnu.org>, ams@gnu.org
> > >
> > > Eli, are the doco bits OK?
> >
>
> The patch at the bottom is now checked in. I've managed to bork
> up my debian/Hurd VM (*), and I don't remember if I ever build this
> patch on the Hurd. :-/ I apologise if this breaks anything, but it
> should be trivial/obvious to fix if so. :-)
>
> * - hint: don't apt-get dist-upgrade with no drive space left!
>
> > Yes, but I think the change in show-debug-regs warrants an entry in
> > NEWS.
>
> How's this?
>
> * NEWS: Mention that the `maint show-debug-registers' and
> `gnu-debug' commands were renamed to `maint set
> show-debug-registers' and `set debug gnu-nat' respectivelly.
>
> ---
> gdb/NEWS | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> Index: src/gdb/NEWS
> ===================================================================
> --- src.orig/gdb/NEWS 2009-05-12 17:51:36.000000000 +0100
> +++ src/gdb/NEWS 2009-05-12 18:03:34.000000000 +0100
> @@ -300,6 +300,20 @@ show tcp connect-timeout
> with a specified timeout period; this is useful if the stub is
> launched
> in parallel with GDB but may not be ready to accept connections
> immediately.
>
> +maint set show-debug-registers (on|off)
> +maint show show-debug-registers
> + The `maint show-debug-registers' command found in previous versions
> + of GDB has been renamed `maint set show-debug-registers' for
> + consistency with other commands, and `maint show
> + show-debug-registers' has been added.
> +
> +set debug gnu-nat (on|off)
> +show debug gnu-nat
> + The previously undocumented `gnu-debug' command has been renamed
> + `set debug gnu-nat' for consistency with other commands, and `show
> + debug gnu-nat' has been added. These commands allow turning on or
> + off debugging messages from the GNU Hurd debug support.
> +
> * New native configurations
>
> x86/x86_64 Darwin i[34567]86-*-darwin*
>
> =============================================================
> This is what I've already applied:
>
> 2009-05-12 Pedro Alves <pedro@codesourcery.com>
>
> * cli/cli-decode.c (deprecated_add_set_cmd): Delete.
> * command.h (deprecated_add_set_cmd): Delete declaration.
> * gnu-nat.c (_initialize_gnu_nat): Replace 'maint gnu-debug' with
> 'set debug gnu-nat' and 'show debug gnu-nat'.
> * i386-nat.c (_initialize_i386_nat): Replace 'maint
> show-debug-registers' with 'maint set show-debug-registers' and
> 'maint show show-debug-registers'.
> * mips-linux-nat.c (_initialize_mips_linux_nat): Replace 'maint
> show-debug-registers' with 'maint set show-debug-registers' and
> 'maint show show-debug-registers'.
>
> 2009-05-12 Pedro Alves <pedro@codesourcery.com>
>
> * gdb.texinfo: Document 'set/show debug gnu-nat'. Replace 'maint
> show-debug-regs' docs by 'maint set show-debug-regs' and 'maint
> show show-debug-regs' docs.
>
> ---
> gdb/cli/cli-decode.c | 11 -----------
> gdb/command.h | 10 ----------
> gdb/doc/gdb.texinfo | 11 +++++++++--
> gdb/gnu-nat.c | 13 +++++++++----
> gdb/i386-nat.c | 12 ++++++++----
> gdb/mips-linux-nat.c | 13 ++++++++-----
> 6 files changed, 34 insertions(+), 36 deletions(-)
>
> Index: src/gdb/cli/cli-decode.c
> ===================================================================
> --- src.orig/gdb/cli/cli-decode.c 2009-03-25 21:42:34.000000000 +0000
> +++ src/gdb/cli/cli-decode.c 2009-05-12 17:22:14.000000000 +0100
> @@ -397,17 +397,6 @@ add_setshow_cmd_full (char *name,
> *show_result = show;
> }
>
> -struct cmd_list_element *
> -deprecated_add_set_cmd (char *name,
> - enum command_class class,
> - var_types var_type,
> - void *var,
> - char *doc,
> - struct cmd_list_element **list)
> -{
> - return add_set_or_show_cmd (name, set_cmd, class, var_type, var,
> doc, list);
> -}
> -
> /* Add element named NAME to command list LIST (the list for set or
> some sublist thereof). CLASS is as in add_cmd. ENUMLIST is a list
> of strings which may follow NAME. VAR is address of the variable
> Index: src/gdb/command.h
> ===================================================================
> --- src.orig/gdb/command.h 2009-02-06 21:33:58.000000000 +0000
> +++ src/gdb/command.h 2009-05-12 17:22:14.000000000 +0100
> @@ -205,16 +205,6 @@ extern void help_list (struct cmd_list_e
> extern void help_cmd_list (struct cmd_list_element *, enum
> command_class,
> char *, int, struct ui_file *);
>
> -/* NOTE: cagney/2005-02-21: Since every set command should be paired
> - with a corresponding show command (i.e., add_setshow_*) this call
> - should not be needed. Unfortunatly some are not (e.g.,
> - "maintenance <variable> <value>") and those need to be fixed. */
> -extern struct cmd_list_element *deprecated_add_set_cmd (char *name,
> enum
> - command_class class,
> - var_types var_type,
void
> *var,
> - char *doc,
> - struct
cmd_list_element
> **list);
> -
> /* Method for show a set/show variable's VALUE on FILE. If this
> method isn't supplied deprecated_show_value_hack() is called (which
> is not good). */
> Index: src/gdb/gnu-nat.c
> ===================================================================
> --- src.orig/gdb/gnu-nat.c 2009-04-19 18:17:08.000000000 +0100
> +++ src/gdb/gnu-nat.c 2009-05-12 17:22:14.000000000 +0100
> @@ -3410,10 +3410,15 @@ _initialize_gnu_nat (void)
>
> add_task_commands ();
> add_thread_commands ();
> - deprecated_add_set_cmd ("gnu-debug", class_maintenance,
> - var_boolean, (char *) &gnu_debug_flag,
> - "Set debugging output for the gnu backend.",
> - &maintenancelist);
> + add_setshow_boolean_cmd ("gnu-nat", class_maintenance,
> + &gnu_debug_flag,
> + _("Set debugging output for the gnu backend."),
> + _("Show debugging output for the gnu backend."),
> + NULL,
> + NULL,
> + NULL,
> + &setdebuglist,
> + &showdebuglist);
> }
>
> #ifdef FLUSH_INFERIOR_CACHE
> Index: src/gdb/i386-nat.c
> ===================================================================
> --- src.orig/gdb/i386-nat.c 2009-04-30 11:39:38.000000000 +0100
> +++ src/gdb/i386-nat.c 2009-05-12 17:22:14.000000000 +0100
> @@ -700,13 +700,17 @@ _initialize_i386_nat (void)
> #ifdef I386_USE_GENERIC_WATCHPOINTS
> /* A maintenance command to enable printing the internal DRi mirror
> variables. */
> - deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
> - var_boolean, (char *) &maint_show_dr, _("\
> -Set whether to show variables that mirror the x86 debug registers.\n\
> + add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
> + &maint_show_dr, _("\
> +Set whether to show variables that mirror the x86 debug registers."),
> _("\
> +Show whether to show variables that mirror the x86 debug registers."),
> _("\
> Use \"on\" to enable, \"off\" to disable.\n\
> If enabled, the debug registers values are shown when GDB inserts\n\
> or removes a hardware breakpoint or watchpoint, and when the
> inferior\n\
> triggers a breakpoint or watchpoint."),
> - &maintenancelist);
> + NULL,
> + NULL,
> + &maintenance_set_cmdlist,
> + &maintenance_show_cmdlist);
> #endif
> }
> Index: src/gdb/doc/gdb.texinfo
> ===================================================================
> --- src.orig/gdb/doc/gdb.texinfo 2009-05-04 10:51:47.000000000 +0100
> +++ src/gdb/doc/gdb.texinfo 2009-05-12 17:23:28.000000000 +0100
> @@ -17817,6 +17817,11 @@ default is off.
> @item show debug frame
> Displays the current state of displaying @value{GDBN} frame debugging
> info.
> +@item set debug gnu-nat
> +@cindex @sc{gnu}/Hurd debug messages
> +Turns on or off debugging messages from the @sc{gnu}/Hurd debug
> support.
> +@item show debug gnu-nat
> +Show the current state of @sc{gnu}/Hurd debugging messages.
> @item set debug infrun
> @cindex inferior debugging info
> Turns on or off display of @value{GDBN} debugging info for running the
> inferior.
> @@ -25935,9 +25940,11 @@ data in a @file{gmon.out} file, be sure
> Configuring with @samp{--enable-profiling} arranges for @value{GDBN}
> to be
> compiled with the @samp{-pg} compiler option.
>
> -@kindex maint show-debug-regs
> +@kindex maint set show-debug-regs
> +@kindex maint show show-debug-regs
> @cindex hardware debug registers
> -@item maint show-debug-regs
> +@item maint set show-debug-regs
> +@itemx maint show show-debug-regs
> Control whether to show variables that mirror the hardware debug
> registers. Use @code{ON} to enable, @code{OFF} to disable. If
> enabled, the debug registers values are shown when @value{GDBN}
> inserts or
> Index: src/gdb/mips-linux-nat.c
> ===================================================================
> --- src.orig/gdb/mips-linux-nat.c 2009-05-12 17:35:13.000000000 +0100
> +++ src/gdb/mips-linux-nat.c 2009-05-12 17:36:36.000000000 +0100
> @@ -1044,15 +1044,18 @@ _initialize_mips_linux_nat (void)
> {
> struct target_ops *t;
>
> - deprecated_add_set_cmd ("show-debug-regs", class_maintenance,
> - var_boolean, (char *) &maint_show_dr, _("\
> -Set whether to show variables that mirror the mips debug registers.\n\
> + add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
> + &maint_show_dr, _("\
> +Set whether to show variables that mirror the mips debug registers."),
> _("\
> +Show whether to show variables that mirror the mips debug
> registers."), _("\
> Use \"on\" to enable, \"off\" to disable.\n\
> If enabled, the debug registers values are shown when GDB inserts\n\
> or removes a hardware breakpoint or watchpoint, and when the
> inferior\n\
> triggers a breakpoint or watchpoint."),
> - &maintenancelist);
> -
> + NULL,
> + NULL,
> + &maintenance_set_cmdlist,
> + &maintenance_show_cmdlist);
>
> t = linux_trad_target (mips_linux_register_u_offset);
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-05-14 14:37 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-31 1:15 eliminate deprecated_add_set_cmd Pedro Alves
2008-12-31 4:10 ` Joel Brobecker
2009-01-04 17:36 ` Thomas Schwinge
2009-01-05 19:31 ` Pedro Alves
2009-01-07 21:33 ` Pedro Alves
2009-01-09 14:09 ` Eli Zaretskii
2009-05-12 17:10 ` Pedro Alves
2009-05-14 14:37 ` Pierre Muller
2008-12-31 4:22 ` Eli Zaretskii
2008-12-31 4:28 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox