public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Add more info to ViewsetCommand.
@ 2008-02-20  1:31 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-02-20  1:31 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  2f1786f6895999c01fd41be95f3e902a1d760acc (commit)
      from  de07feec18073e8ca5a736bb15a28551e7219290 (commit)

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

- Log -----------------------------------------------------------------
commit 2f1786f6895999c01fd41be95f3e902a1d760acc
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Tue Feb 19 19:28:42 2008 -0600

    Add more info to ViewsetCommand.
    
    * ViewsetCommand.java: Add executable path to listing;
      add new printLoop method so other classes can call it.
    * TestRunCommand.java: Update for above change.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog           |    6 +++
 frysk-core/frysk/hpd/TestRunCommand.java |    2 +-
 frysk-core/frysk/hpd/ViewsetCommand.java |   50 ++++++++++++++++++++++--------
 3 files changed, 44 insertions(+), 14 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 91236af..60b8e8f 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-19  Rick Moseley  <rmoseley@redhat.com>
+
+	* ViewsetCommand.java: Add executable path to listing; 
+	add new printLoop method so other classes can call it.
+	* TestRunCommand.java: Update for above change.
+
 2008-02-15  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* CLI.java: Added ArrayStoreException and ClassCastException
diff --git a/frysk-core/frysk/hpd/TestRunCommand.java b/frysk-core/frysk/hpd/TestRunCommand.java
index 30735bb..af1034e 100644
--- a/frysk-core/frysk/hpd/TestRunCommand.java
+++ b/frysk-core/frysk/hpd/TestRunCommand.java
@@ -58,7 +58,7 @@ public class TestRunCommand extends TestLib {
 		"Attached to process ([0-9]+).*Running process ([0-9]+).*");
 	try { Thread.sleep(1000); } catch (Exception e) {}
 	e.sendCommandExpectPrompt("focus","Target set.*\\[0\\.0\\]\t\t([0-9]+)" +
-		"\t([0-9]+)\r\n" + "\\[0\\.1\\]\t\t([0-9]+)\t([0-9]+)\r\n");
+		"\t([0-9]+).*" + "\\[0\\.1\\]\t\t([0-9]+)\t([0-9]+).*");
 	e.send("quit\n");
 	e.expect("Quitting\\.\\.\\.");
 	e.close();
diff --git a/frysk-core/frysk/hpd/ViewsetCommand.java b/frysk-core/frysk/hpd/ViewsetCommand.java
index 6941495..25be163 100644
--- a/frysk-core/frysk/hpd/ViewsetCommand.java
+++ b/frysk-core/frysk/hpd/ViewsetCommand.java
@@ -41,6 +41,7 @@ package frysk.hpd;
 
 import java.util.Iterator;
 import java.util.List;
+
 import frysk.proc.Task;
 
 class ViewsetCommand extends ParameterizedCommand {
@@ -59,7 +60,6 @@ class ViewsetCommand extends ParameterizedCommand {
 
     public void interpret(CLI cli, Input input, Object options) {
 	PTSet tempset = null;
-	TaskData temptd = null;
 	String setname = "";
 	String displayedName;
 
@@ -80,21 +80,45 @@ class ViewsetCommand extends ParameterizedCommand {
 	default:
 	    throw new InvalidCommandException("too many arguments");
 	}
-
+	printLoop(tempset, cli, displayedName, false);
+    }
+    
+    /**
+     * printLoop goes through the specified set of procs/tasks and prints them out
+     * 
+     * @param tempset is the target set to use in printing
+     * @param cli is the current command line interface object
+     */
+    
+    static void printLoop(PTSet tempset, CLI cli, String displayedName, boolean loadedOnly) {
+	TaskData temptd = null;
+	int parent = -1;
 	cli.outWriter.print(displayedName);
-	cli.outWriter.println("\tpid\tid");
+	cli.outWriter.println("\tpid\tid\tpath-to-executable");
 	for (Iterator iter = tempset.getTaskData(); iter.hasNext();) {
 	    temptd = (TaskData) iter.next();
-	    cli.outWriter.print("[");
-	    cli.outWriter.print(temptd.getParentID());
-	    cli.outWriter.print(".");
-	    cli.outWriter.print(temptd.getID());
-	    cli.outWriter.print("]");
-	    Task task = temptd.getTask();
-	    cli.outWriter.print("\t\t");
-	    cli.outWriter.print(task.getProc().getPid());
-	    cli.outWriter.print("\t");
-	    cli.outWriter.println(task.getTid());
+	    if (loadedOnly && cli.loadedProcs.containsKey(temptd.getTask().getProc())
+		    || !loadedOnly) {
+		cli.outWriter.print("[");
+		cli.outWriter.print(temptd.getParentID());
+		cli.outWriter.print(".");
+		cli.outWriter.print(temptd.getID());
+		cli.outWriter.print("]");
+		Task task = temptd.getTask();
+		cli.outWriter.print("\t\t");
+		cli.outWriter.print(task.getProc().getPid());
+		cli.outWriter.print("\t");
+		cli.outWriter.print(task.getTid());
+		cli.outWriter.print("\t");
+		if (parent != temptd.getParentID()) {
+		    cli.outWriter.println(temptd.getTask().getProc().getExe());
+		    parent = temptd.getParentID();
+		}
+		else {
+		    cli.outWriter.println("(same)");
+		}
+	    }
 	}
+	cli.outWriter.flush();
     }
 }


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


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

only message in thread, other threads:[~2008-02-20  1:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20  1:31 [SCM] master: Add more info to ViewsetCommand 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).