public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Updated how args are retrieved by InfoArgsCommands.
@ 2008-05-30 17:47 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-05-30 17:47 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  5aee88eb9df989c6b3fa83f6c2dea8fe1ba7f605 (commit)
      from  4534ebccc1d0c6b21464f0b5cffda72943079b73 (commit)

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

- Log -----------------------------------------------------------------
commit 5aee88eb9df989c6b3fa83f6c2dea8fe1ba7f605
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Fri May 30 12:46:54 2008 -0500

    Updated how args are retrieved by InfoArgsCommands.
    
     * InfoArgsCommand.java: Updated how args are gotten.
     * TestInfoArgsCommand.java: Added new more comprehensive
       tests.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog                |    6 +++
 frysk-core/frysk/hpd/InfoArgsCommand.java     |   21 ++++++++----
 frysk-core/frysk/hpd/TestInfoArgsCommand.java |   43 ++++++++++++++++++++++++-
 3 files changed, 62 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index fb7cdfa..c11876d 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-30  Rick Moseley  <rmoseley@redhat.com>
+
+	* InfoArgsCommand.java: Updated how args are gotten.
+	* TestInfoArgsCommand.java: Added new more comprehensive 
+	tests.
+
 2008-05-29  Teresa Thomas  <tthomas@redhat.com>
 
 	* TestWatchCommand.java (testWatchpointSetMessage): New.	
diff --git a/frysk-core/frysk/hpd/InfoArgsCommand.java b/frysk-core/frysk/hpd/InfoArgsCommand.java
index 4202951..c357ac8 100644
--- a/frysk-core/frysk/hpd/InfoArgsCommand.java
+++ b/frysk-core/frysk/hpd/InfoArgsCommand.java
@@ -40,14 +40,14 @@
 package frysk.hpd;
 
 import java.util.Iterator;
-import frysk.proc.Proc;
+//import frysk.proc.Proc;
 import java.util.List;
 
 class InfoArgsCommand extends ParameterizedCommand {
-    
+
     InfoArgsCommand() {
 	super("print arguments", "args",
-	      "print the processes command-line arguments");
+		"print the processes command-line arguments");
     }
 
     void interpret(CLI cli, Input cmd, Object options) {
@@ -55,11 +55,18 @@ class InfoArgsCommand extends ParameterizedCommand {
 	Iterator taskDataIter = ptset.getTaskData();
 	while (taskDataIter.hasNext()) {
 	    TaskData td = (TaskData) taskDataIter.next();
-	    Proc proc = td.getTask().getProc();
 	    td.printHeader(cli.outWriter);
-	    String[] args = proc.getCmdLine();
-	    for (int i = 0; i < args.length; i++) {
-		cli.outWriter.println(args[i]);
+	    int parentID = td.getParentID();
+	    String[] args = (String[]) cli.ptsetParams
+		    .get(new Integer(parentID));
+	    cli.outWriter.println("The args list for: " + args[0] +
+		    " is.....");
+	    if (args.length > 1)
+		for (int i = 1; i < args.length; i++) {
+		    cli.outWriter.println("   " + args[i]);
+		}
+	    else {
+		cli.outWriter.println("   ");
 	    }
 	}
     }
diff --git a/frysk-core/frysk/hpd/TestInfoArgsCommand.java b/frysk-core/frysk/hpd/TestInfoArgsCommand.java
index bbd58f2..d0c3a4c 100644
--- a/frysk-core/frysk/hpd/TestInfoArgsCommand.java
+++ b/frysk-core/frysk/hpd/TestInfoArgsCommand.java
@@ -39,10 +39,51 @@
 
 package frysk.hpd;
 
+import frysk.config.Prefix;
+
 public class TestInfoArgsCommand extends TestLib {
 
     public void testInfoArgs() {
 	e = HpdTestbed.load("funit-stacks");
-	e.sendCommandExpectPrompt("info args", "funit-stacks\r\n");
+	e.sendCommandExpectPrompt("info args", "   .*");
+	e.send("quit\n");
+	e.expect("Quitting\\.\\.\\.");
+	e.close();
+    }
+    
+    public void testInfoArgsLoad() {
+	e = new HpdTestbed();
+	e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-threads-looper").getPath() +
+		" abcd efgh", "\\[0\\.0\\] Loaded executable file.*");
+	e.sendCommandExpectPrompt("info args", "The args list.*abcd.*efgh.*");
+	e.send("quit\n");
+	e.expect("Quitting\\.\\.\\.");
+	e.close();
+    }
+    
+    public void testInfoArgsRun() {
+	e = new HpdTestbed();
+	e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-parameters").getPath() +
+		" abcd efgh", "\\[0\\.0\\] Loaded executable file.*");
+	e.sendCommandExpectPrompt("info args", "The args list.*abcd.*efgh.*");
+	e.sendCommandExpectPrompt("run 1111 2222", "running.*1111 2222.*" +
+		"Attached to process ([0-9]+).*" + "Running process ([0-9]+).*");
+	e.sendCommandExpectPrompt("info args", "The args list.*1111.*2222.*");
+	e.send("quit\n");
+	e.expect("Quitting\\.\\.\\.");
+	e.close();
+    }
+    
+    public void testInfoArgsLoadTwo() {
+	e = new HpdTestbed();
+	e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-threads-looper").getPath() +
+		" abcd efgh", "\\[0\\.0\\] Loaded executable file.*");
+	e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-parameters").getPath() +
+		" 1234 5678 zzzz yyyy", "\\[1\\.0\\] Loaded executable file.*");
+	e.sendCommandExpectPrompt("info args", "The args list.*funit-threads-looper.*abcd.*efgh.*" +
+		"The args list.*funit-parameters.*1234.*5678.*zzzz.*yyyy.*");
+	e.send("quit\n");
+	e.expect("Quitting\\.\\.\\.");
+	e.close();
     }
 }


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


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

only message in thread, other threads:[~2008-05-30 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-30 17:47 [SCM] master: Updated how args are retrieved by InfoArgsCommands 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).