public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Add TestUnloadCommand, fix regexp errors, add info message, remove unnecessary remove proc call.
@ 2008-02-29 21:52 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-02-29 21:52 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  2f59fef898b23d942b8091b7c5fdfa992888039d (commit)
      from  5b833702426e587b5ca96e851d338d1a1b948709 (commit)

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

- Log -----------------------------------------------------------------
commit 2f59fef898b23d942b8091b7c5fdfa992888039d
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Fri Feb 29 15:51:10 2008 -0600

    Add TestUnloadCommand, fix regexp errors, add info message, remove unnecessary remove proc call.
    
     * TestUnloadommand.java; New.
     * TestLoadCommand.java: Fix regexp errors.
     * UnloadCommand.java: Add info message when removing id's;
       remove proc.getHost().remove(proc) call.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog            |    7 ++++++-
 frysk-core/frysk/hpd/TestLoadCommand.java |    4 ++--
 frysk-core/frysk/hpd/UnloadCommand.java   |   14 +++++++++-----
 3 files changed, 17 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 2759746..68eaa90 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -7,7 +7,12 @@
 2008-02-29  Rick Moseley  <rmoseley@redhat.com>
 
 	* TestKillCommand.java: Add test that points to bz 5615.
-
+	
+	* TestUnloadommand.java; New.
+	* TestLoadCommand.java: Fix regexp errors.
+	* UnloadCommand.java: Add info message when removing id's;
+	remove proc.getHost().remove(proc) call.
+	
 2008-02-28  Andrew Cagney  <cagney@redhat.com>
 
 	* HardList.java: Use frysk.rsl.
diff --git a/frysk-core/frysk/hpd/TestLoadCommand.java b/frysk-core/frysk/hpd/TestLoadCommand.java
index dba8d10..40e1134 100644
--- a/frysk-core/frysk/hpd/TestLoadCommand.java
+++ b/frysk-core/frysk/hpd/TestLoadCommand.java
@@ -77,7 +77,7 @@ public class TestLoadCommand extends TestLib {
 	e.sendCommandExpectPrompt("focus", "Target set.*\\[0\\.0\\]\t\t0\t0.*"+
 		"\\[1\\.0\\]\t\t0*\\t0.*");
 	e.sendCommandExpectPrompt("start", "Attached to process.*Attached to process.*");
-	e.sendCommandExpectPrompt("focus", "Target set.*\\[0\\.0\\].*\\[1\\.0].*");
+	e.sendCommandExpectPrompt("focus", "Target set.*\\[0\\.0\\].*\\[1\\.0\\].*");
 	e.send("quit\n");
 	e.expect("Quitting\\.\\.\\.");
 	e.close();
@@ -109,7 +109,7 @@ public class TestLoadCommand extends TestLib {
 		"Loaded executable file.*");
 	e.sendCommandExpectPrompt("load " + Config.getPkgLibFile("funit-hello").getPath(),
 		"Loaded executable file.*");
-	e.sendCommandExpectPrompt("load", "Target set.*\\[0\\.0\\].*\\[1\\.0].*");
+	e.sendCommandExpectPrompt("load", "Target set.*\\[0\\.0\\].*\\[1\\.0\\].*");
 	e.send("quit\n");
 	e.expect("Quitting\\.\\.\\.");
 	e.close();
diff --git a/frysk-core/frysk/hpd/UnloadCommand.java b/frysk-core/frysk/hpd/UnloadCommand.java
index 741c587..68d15e0 100644
--- a/frysk-core/frysk/hpd/UnloadCommand.java
+++ b/frysk-core/frysk/hpd/UnloadCommand.java
@@ -90,9 +90,12 @@ public class UnloadCommand extends ParameterizedCommand {
 		cli.addMessage("Trying to remove a proc that has not been loaded", Message.TYPE_ERROR);
 		return;
 	    }
-	    removeFromHashMap(proc, cli.getLoadedProcs(), cli);
-	    cli.targetset.removeProc(id);
-	    proc.getHost().remove(proc);
+	    if (removeFromHashMap(proc, cli.getLoadedProcs(), cli)) {
+		cli.targetset.removeProc(id);
+		cli.addMessage("Removed Target set [" + id + "]" , Message.TYPE_NORMAL);
+	    } else {
+		cli.addMessage("Target id " + id + " could not be found", Message.TYPE_ERROR);
+	    }
 	    return;
 	}
 	if (cmd.parameter(0).equals("-all")) {
@@ -109,7 +112,7 @@ public class UnloadCommand extends ParameterizedCommand {
      * @param procMap is the HashMap of the procs to search for removal
      * @param cli is the current command line interface object
      */
-    private void removeFromHashMap(Proc proc, HashMap procMap, CLI cli) {
+    private boolean removeFromHashMap(Proc proc, HashMap procMap, CLI cli) {
 	Set procSet = procMap.entrySet();
 	Iterator foo = procSet.iterator();
 	while (foo.hasNext()) {
@@ -119,9 +122,10 @@ public class UnloadCommand extends ParameterizedCommand {
 		synchronized (cli) {
 		    foo.remove();
 		}
-		return;
+		return true;
 	    }
 	}
+	return false;
     }
 
     /**


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-29 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29 21:52 [SCM] master: Add TestUnloadCommand, fix regexp errors, add info message, remove unnecessary remove proc call rmoseley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).