This is the mail archive of the
mailing list for the Archer project.
[python] [commit] alias.py removal
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: archer at sourceware dot org
- Date: Mon, 19 Dec 2011 21:46:25 +0100
- Subject: [python] [commit] alias.py removal
removed alias.py from archer-tromey-python as it is IMO obsolete.
And it would at least need to be renamed otherwise.
Author: Jan Kratochvil <firstname.lastname@example.org>
Date: Mon Dec 19 21:42:38 2011 +0100
Remove alias.py as it conflicts with "alias" GDB built-in command from:
Author: Doug Evans <email@example.com>
Date: Sun Oct 9 22:21:41 2011 +0000
Add new "alias" command.
causing regression for gdb.base/alias.exp.
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index dfab89d..f06b6da 100644
@@ -57,7 +57,6 @@ PYTHON_FILES = \
- gdb/command/alias.py \
diff --git a/gdb/python/lib/gdb/command/alias.py b/gdb/python/lib/gdb/command/alias.py
deleted file mode 100644
@@ -1,59 +0,0 @@
-# Alias command.
-# Copyright (C) 2008 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-class AliasImplementation (gdb.Command):
- def __init__ (self, name, real, doc):
- # Have to set __doc__ before the super init call.
- # It would be nice if gdb's help looked up __doc__ dynamically.
- self.__doc__ = doc
- # Note: no good way to complete :(
- super (AliasImplementation, self).__init__ (name, gdb.COMMAND_NONE)
- self.real = real
- def invoke(self, arg, from_tty):
- gdb.execute (self.real + ' ' + arg, from_tty)
-class AliasCommand (gdb.Command):
- """Alias one command to another.
-In the simplest form, the first word is the name of the alias, and
-the remaining words are the the expansion.
-An '=' by itself can be used to define a multi-word alias; words
-before the '=' are the name of the new command."""
- def __init__ (self):
- # Completion is not quite right here.
- super (AliasCommand, self).__init__ ("alias", gdb.COMMAND_NONE,
- def invoke (self, arg, from_tty):
- self.dont_repeat ()
- # Without some form of quoting we can't alias a multi-word
- # command to another command.
- args = arg.split()
- start = args.index ('=')
- end = start + 1
- except ValueError:
- start = 1
- end = 1
- target = " ".join(args[end:])
- AliasImplementation (" ".join (args[0:start]), target,
- "This command is an alias for '%s'." % target)