[SCM] master: Eliminate unused UserHelp

cagney@sourceware.org cagney@sourceware.org
Sat Nov 10 03:56:00 GMT 2007


The branch, master has been updated
       via  bddcc9f83077db2a97348cb8689975794c819d55 (commit)
      from  17a8d02379e74546d0fe49a54839248d92e66ad7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit bddcc9f83077db2a97348cb8689975794c819d55
Author: Andrew Cagney <cagney@redhat.com>
Date:   Fri Nov 9 22:55:37 2007 -0500

    Eliminate unused UserHelp
    
    frysk-core/frysk/hpd/ChangeLog
    2007-11-09  Andrew Cagney  <cagney@redhat.com>
    
    	* UserHelp.java: Delete.
    	* CLI.java (printUsage(String)): Delete.
    	(userhelp): Delete.
    	(handlers): Delete.
    	(addHandler): Delete.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/hpd/CLI.java      |   76 +-----------------------------------
 frysk-core/frysk/hpd/ChangeLog     |    6 +++
 frysk-core/frysk/hpd/UserHelp.java |   67 -------------------------------
 3 files changed, 7 insertions(+), 142 deletions(-)
 delete mode 100644 frysk-core/frysk/hpd/UserHelp.java

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/CLI.java b/frysk-core/frysk/hpd/CLI.java
index 1fafa3c..3c14b2e 100644
--- a/frysk-core/frysk/hpd/CLI.java
+++ b/frysk-core/frysk/hpd/CLI.java
@@ -41,8 +41,6 @@ package frysk.hpd;
 
 import java.io.PrintStream;
 import java.io.PrintWriter;
-import java.util.SortedMap;
-import java.util.TreeMap;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -156,13 +154,10 @@ public class CLI {
         idManager.manageProc(proc, idManager.reserveProcID());
     }
 
-    //private static PrintStream out = null;// = System.out;
     final PrintWriter outWriter;
     private Preprocessor prepro;
     private String prompt; // string to represent prompt, will be moved
-    private final SortedMap handlers = new TreeMap();
-    private final Command topLevelCommand;
-    final UserHelp userhelp;
+    private final Command topLevelCommand = new TopLevelCommand();
     final DbgVariables dbgvars = new DbgVariables();
 
     // PT set related stuff
@@ -183,16 +178,6 @@ public class CLI {
      * Public methods
      */
 
-    /**
-     * Add a CLIHandler, along with its help messages.
-     * @param handler the handler
-     */
-    public void addHandler(Command handler) {
-        String name = handler.getName();
-        handlers.put(name, handler);
-        userhelp.addHelp(name, handler.getHelp());
-    }
- 
     Value parseValue(Task task, String value) {
 	return parseValue(task, value, false);
     }
@@ -219,55 +204,6 @@ public class CLI {
         idManager = ProcTaskIDManager.getSingleton();
 
         prepro = new Preprocessor();
-        userhelp = new UserHelp();
-   
-        //XXX: Must make a reference to every command that is used
-        //otherwise build system will discard those classes. Therefore
-        //CLI cannot be made to be a singleton.
-        addHandler(new AliasCommands.Alias());
-        addHandler(new AliasCommands.Unalias());
-        addHandler(new AssignCommand());
-        addHandler(new AttachCommand());
-        addHandler(new BreakpointCommand());
-        addHandler(new DebuginfoCommand());
-        addHandler(new DefsetCommand());
-        addHandler(new ActionPointCommands.Actions());
-        addHandler(new ActionPointCommands.Delete());
-        addHandler(new ActionPointCommands.Disable());
-        addHandler(new ActionPointCommands.Enable());
-        addHandler(new DetachCommand());
-        addHandler(new FrameCommands("down"));
-        addHandler(new StepFinishCommand());
-        addHandler(new FocusCommand());
-        addHandler(new GoCommand());
-        addHandler(new HaltCommand());
-        addHandler(new ListCommand());
-        addHandler(new StepNextCommand());
-        addHandler(new StepNextiCommand());
-        addHandler(new PrintCommand());
-        addHandler(new PlocationCommand());
-        addHandler(new PtypeCommand());
-        addHandler(new QuitCommand("quit"));
-        addHandler(new QuitCommand("exit"));
-        addHandler(new DbgVariableCommands.Set());
-        addHandler(new StepCommand());
-        addHandler(new StepInstructionCommand());
-        addHandler(new UndefsetCommand());
-        addHandler(new DbgVariableCommands.Unset());
-        addHandler(new FrameCommands("up"));
-        addHandler(new ViewsetCommand());
-        addHandler(new WhatCommand());
-        addHandler(new WhereCommand());
-        addHandler(new WhichsetsCommand());
-        addHandler(new DisplayCommand());
-        addHandler(new RunCommand());
-        addHandler(new CoreCommand());
-        addHandler(new DisassembleCommand());
-        addHandler(new RegsCommand());
-        addHandler(new ExamineCommand());
-        addHandler(new LoadCommand());
-        addHandler(new PeekCommand());
-	topLevelCommand = new TopLevelCommand();
 
         // initialize PT set stuff
         setparser = new SetNotationParser();
@@ -467,16 +403,6 @@ public class CLI {
     }
 
     /**
-     * Prints a usage message for a command.
-     *
-     * @param cmd the command
-     */
-    public void printUsage(Input cmd) {
-        addMessage("Usage: " + userhelp.getCmdSyntax(cmd.getAction()),
-                   Message.TYPE_NORMAL);
-    }
- 
-    /**
      * Return output writer.
      */
     public PrintWriter getPrintWriter() {
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 2d484f3..0146871 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,5 +1,11 @@
 2007-11-09  Andrew Cagney  <cagney@redhat.com>
 
+	* UserHelp.java: Delete.
+	* CLI.java (printUsage(String)): Delete.
+	(userhelp): Delete.
+	(handlers): Delete.
+	(addHandler): Delete.
+	
 	* TestParameterizedCommand.java (testOptionWithDashArg()): New.
 	(testUnknownOpt()): New.
 	(testTooManyArgs(), testExtraArg(), testMissingOption()): Delete.
diff --git a/frysk-core/frysk/hpd/UserHelp.java b/frysk-core/frysk/hpd/UserHelp.java
deleted file mode 100644
index 77f2603..0000000
--- a/frysk-core/frysk/hpd/UserHelp.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// This file is part of the program FRYSK.
-//
-// Copyright 2006, 2007, Red Hat Inc.
-//
-// FRYSK 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; version 2 of the License.
-//
-// FRYSK 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 FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-
-package frysk.hpd;
-
-import java.util.TreeMap;
-import java.util.ArrayList;
-
-class UserHelp {
-    private final TreeMap commandHelp = new TreeMap();
-
-    public void addHelp(String commandName, CommandHelp help) {
-	commandHelp.put(commandName, help);
-    }
-
-    public ArrayList getCmdList() {
-	return new ArrayList(commandHelp.keySet());
-    }
-
-    public String getCmdDescription(String cmd) {
-	return ((CommandHelp) commandHelp.get(cmd)).getDescription();
-    }
-
-    public String getCmdSyntax(String cmd) {
-	return ((CommandHelp) commandHelp.get(cmd)).getSyntax();
-    }
-
-    public String getCmdFullDescr(String cmd) {
-	return ((CommandHelp) commandHelp.get(cmd)).getFull();
-    }
-}


hooks/post-receive
--
frysk system monitor/debugger



More information about the Frysk-cvs mailing list