public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: rmoseley@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Add more info to ViewsetCommand.
Date: Wed, 20 Feb 2008 01:31:00 -0000	[thread overview]
Message-ID: <20080220013138.12633.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2008-02-20  1:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080220013138.12633.qmail@sourceware.org \
    --to=rmoseley@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).