From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12674 invoked by alias); 20 Feb 2008 01:31:40 -0000 Received: (qmail 12649 invoked by uid 9519); 20 Feb 2008 01:31:38 -0000 Date: Wed, 20 Feb 2008 01:31:00 -0000 Message-ID: <20080220013138.12633.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Add more info to ViewsetCommand. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: de07feec18073e8ca5a736bb15a28551e7219290 X-Git-Newrev: 2f1786f6895999c01fd41be95f3e902a1d760acc 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/msg00231.txt.bz2 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 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 + + * 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 * 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