This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Added output to kill command and added unload command.


The branch, master has been updated
       via  63b760ae473b2baa4b520bcbc5e0f725a5e6d7a8 (commit)
      from  fe1332147611ba2f06e3f5ad38339c2763847dc2 (commit)

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

- Log -----------------------------------------------------------------
commit 63b760ae473b2baa4b520bcbc5e0f725a5e6d7a8
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Mon Feb 11 17:27:04 2008 -0600

    Added output to kill command and added unload command.
    
    * KillCommand.java: Added path-to-proc to the output info.
    * TopLevelCommand.java: Added UnloadCommand.java.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog            |    2 ++
 frysk-core/frysk/hpd/KillCommand.java     |   28 +++++++++++++++++-----------
 frysk-core/frysk/hpd/TopLevelCommand.java |    1 +
 3 files changed, 20 insertions(+), 11 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 18c0667..0f710d5 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -3,6 +3,8 @@
 	* UnloadCommand.java: New to unload loaded processes.
 	* LoadCommand.java: Add capability to list loaded procs.
 	* TestLoadCommand.java: Test above.
+	* KillCommand.java: Added path-to-proc to the output info.
+	* TopLevelCommand.java: Added UnloadCommand.java.
 
 
 2008-02-08  Stan Cox  <scox@redhat.com>
diff --git a/frysk-core/frysk/hpd/KillCommand.java b/frysk-core/frysk/hpd/KillCommand.java
index 66fc1f4..5291c87 100644
--- a/frysk-core/frysk/hpd/KillCommand.java
+++ b/frysk-core/frysk/hpd/KillCommand.java
@@ -39,8 +39,11 @@
 
 package frysk.hpd;
 
-import java.util.ArrayList;
+//import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
 import frysk.proc.Proc;
 import frysk.proc.Task;
 import java.util.List;
@@ -60,18 +63,20 @@ public class KillCommand extends ParameterizedCommand {
 
     public void interpret(CLI cli, Input cmd, Object options) {
 	
-	ArrayList saveProcs = new ArrayList();
+	Map saveProcs = new HashMap();
+	saveProcs = new TreeMap();
 	int procPID = 0;
-	Iterator foo = cli.targetset.getTasks();
+	Iterator foo = cli.targetset.getTaskData();
 	while (foo.hasNext()) {
-	    Task task = (Task) foo.next();
+	    TaskData taskData = (TaskData) foo.next();
+	    Task task = taskData.getTask();
 	    Proc proc = task.getProc();
 	    if (proc.getPid() != procPID) {
-		cli.addMessage("Killing process " + proc.getPid(),
-		//	" that was created from " + proc.getExe(),
+		cli.addMessage("Killing process " + proc.getPid() +
+			" that was created from " + proc.getExe(),
 			Message.TYPE_NORMAL);
 		// Save the procs we are killing so we can re-load them later
-		saveProcs.add(proc.getExe());
+		saveProcs.put(new Integer(taskData.getParentID()), proc.getExe());
 		procPID = proc.getPid();
 		// Now, call the Proc object to kill off the executable(s)
 		proc.requestKill();
@@ -81,19 +86,20 @@ public class KillCommand extends ParameterizedCommand {
 	synchronized (cli) {
 	    // Clear the running procs set
 	    cli.runningProcs.clear();
-	    // Clear the current targetset
-	    cli.idManager.clearProcIDs();
 	    // Clear the stepping engine structures
 	    cli.steppingEngine.clear();
 	    // Add back in the stepping observer for cli
 	    cli.steppingEngine.addObserver(cli.steppingObserver);
 	}
 	// Now loop through and re-load all of the killed procs
-	Iterator bar = saveProcs.iterator();
+	Iterator bar = saveProcs.keySet().iterator();
 	while (bar.hasNext()) {
-	    String cmdline = (String) bar.next();
+	    Integer procId = (Integer) bar.next();
+	    String cmdline = (String) saveProcs.get(procId);
+	    cli.taskID = procId.intValue();
 	    cli.execCommand("load " + cmdline + "\n");
 	}
+	cli.taskID = -1;
     }
 
     int completer(CLI cli, Input input, int cursor, List completions) {
diff --git a/frysk-core/frysk/hpd/TopLevelCommand.java b/frysk-core/frysk/hpd/TopLevelCommand.java
index af6e2b4..78c226b 100644
--- a/frysk-core/frysk/hpd/TopLevelCommand.java
+++ b/frysk-core/frysk/hpd/TopLevelCommand.java
@@ -114,6 +114,7 @@ public class TopLevelCommand extends MultiLevelCommand {
         add(new StepInstructionCommand(), "stepi");
         add(new StepNextCommand(), "n|ext");
         add(new StepNextiCommand(), "nexti");
+        add(new UnloadCommand(), "un|load");
         add(new WhatCommand(), "what");
         add(new WhichsetsCommand(), "whichsets");
         add(new ViewsetCommand(), "viewset");


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]