From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28927 invoked by alias); 29 Feb 2008 21:52:56 -0000 Received: (qmail 28902 invoked by uid 9519); 29 Feb 2008 21:52:55 -0000 Date: Fri, 29 Feb 2008 21:52:00 -0000 Message-ID: <20080229215255.28887.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Add TestUnloadCommand, fix regexp errors, add info message, remove unnecessary remove proc call. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5b833702426e587b5ca96e851d338d1a1b948709 X-Git-Newrev: 2f59fef898b23d942b8091b7c5fdfa992888039d Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00295.txt.bz2 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 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 * 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 * 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