* Disable redefinition of built-in commands.
@ 2002-06-06 12:02 Don Howard
2002-06-06 12:44 ` Joel Brobecker
0 siblings, 1 reply; 5+ messages in thread
From: Don Howard @ 2002-06-06 12:02 UTC (permalink / raw)
To: gdb-patches
The following patch disables redefinition of built-in commands. This
corrects two problems:
Redefining a built-in command leaves the command's alias in an
inconsistent state. Invoking the alias of a redefined command can cause
gdb to crash.
Once a built-in command has been redefined, there is no way to access that
command's original functionality.
Index: cli/cli-script.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-script.c,v
retrieving revision 1.12
diff -p -u -w -r1.12 cli-script.c
--- cli/cli-script.c 12 Apr 2002 22:31:23 -0000 1.12
+++ cli/cli-script.c 6 Jun 2002 18:05:08 -0000
@@ -1070,9 +1070,7 @@ define_command (char *comname, int from_
if (c->class == class_user || c->class == class_alias)
tem = "Redefine command \"%s\"? ";
else
- tem = "Really redefine built-in command \"%s\"? ";
- if (!query (tem, c->name))
- error ("Command \"%s\" not redefined.", c->name);
+ error ("Redefinition of built-in commands is not supported.");
}
/* If this new command is a hook, then mark the command which it
--
dhoward@redhat.com
gdb engineering
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Disable redefinition of built-in commands.
@ 2002-06-06 12:16 Don Howard
2002-06-06 12:26 ` Elena Zannoni
2002-06-07 6:16 ` Eli Zaretskii
0 siblings, 2 replies; 5+ messages in thread
From: Don Howard @ 2002-06-06 12:16 UTC (permalink / raw)
To: gdb-patches
On Thu, 6 Jun 2002, Elena Zannoni wrote:
>
>
> Don,
> you forgot the ChangeLog.
>
> Elena
>
Woops - thanks, Elena.
The following patch disables redefinition of built-in commands. This
corrects two problems:
Redefining a built-in command leaves the command's alias in an
inconsistent state. Invoking the alias of a redefined command can cause
gdb to crash.
Once a built-in command has been redefined, there is no way to access that
command's original functionality.
2002-06-06 Don Howard <dhoward@redhat.com>
* cli/cli-script.c (define_command): Disable redefinition of
built-in commands.
Index: cli/cli-script.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-script.c,v
retrieving revision 1.12
diff -p -u -w -r1.12 cli-script.c
--- cli/cli-script.c 12 Apr 2002 22:31:23 -0000 1.12
+++ cli/cli-script.c 6 Jun 2002 18:05:08 -0000
@@ -1070,9 +1070,7 @@ define_command (char *comname, int from_
if (c->class == class_user || c->class == class_alias)
tem = "Redefine command \"%s\"? ";
else
- tem = "Really redefine built-in command \"%s\"? ";
- if (!query (tem, c->name))
- error ("Command \"%s\" not redefined.", c->name);
+ error ("Redefinition of built-in commands is not supported.");
}
/* If this new command is a hook, then mark the command which it
--
dhoward@redhat.com
gdb engineering
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Disable redefinition of built-in commands.
2002-06-06 12:16 Don Howard
@ 2002-06-06 12:26 ` Elena Zannoni
2002-06-07 6:16 ` Eli Zaretskii
1 sibling, 0 replies; 5+ messages in thread
From: Elena Zannoni @ 2002-06-06 12:26 UTC (permalink / raw)
To: Don Howard; +Cc: gdb-patches
Don Howard writes:
>
> On Thu, 6 Jun 2002, Elena Zannoni wrote:
>
> >
> >
> > Don,
> > you forgot the ChangeLog.
> >
> > Elena
> >
>
> Woops - thanks, Elena.
>
>
>
>
> The following patch disables redefinition of built-in commands. This
> corrects two problems:
>
> Redefining a built-in command leaves the command's alias in an
> inconsistent state. Invoking the alias of a redefined command can cause
> gdb to crash.
>
> Once a built-in command has been redefined, there is no way to access that
> command's original functionality.
>
Looks ok to me. But it's Fernando's call, no?
Elena
>
>
> 2002-06-06 Don Howard <dhoward@redhat.com>
>
> * cli/cli-script.c (define_command): Disable redefinition of
> built-in commands.
>
>
>
> Index: cli/cli-script.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/cli/cli-script.c,v
> retrieving revision 1.12
> diff -p -u -w -r1.12 cli-script.c
> --- cli/cli-script.c 12 Apr 2002 22:31:23 -0000 1.12
> +++ cli/cli-script.c 6 Jun 2002 18:05:08 -0000
> @@ -1070,9 +1070,7 @@ define_command (char *comname, int from_
> if (c->class == class_user || c->class == class_alias)
> tem = "Redefine command \"%s\"? ";
> else
> - tem = "Really redefine built-in command \"%s\"? ";
> - if (!query (tem, c->name))
> - error ("Command \"%s\" not redefined.", c->name);
> + error ("Redefinition of built-in commands is not supported.");
> }
>
> /* If this new command is a hook, then mark the command which it
>
>
> --
> dhoward@redhat.com
> gdb engineering
>
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Disable redefinition of built-in commands.
2002-06-06 12:16 Don Howard
2002-06-06 12:26 ` Elena Zannoni
@ 2002-06-07 6:16 ` Eli Zaretskii
1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2002-06-07 6:16 UTC (permalink / raw)
To: dhoward; +Cc: gdb-patches
> Date: Thu, 6 Jun 2002 12:16:26 -0700 (PDT)
> From: Don Howard <dhoward@redhat.com>
>
> The following patch disables redefinition of built-in commands.
I think we should tell in the manual that such redefinitions are not
allowed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-06-07 13:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-06 12:02 Disable redefinition of built-in commands Don Howard
2002-06-06 12:44 ` Joel Brobecker
2002-06-06 12:16 Don Howard
2002-06-06 12:26 ` Elena Zannoni
2002-06-07 6:16 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox