public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Get commandline args from proc's getCmdLine() method.
@ 2008-06-06 18:34 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-06-06 18:34 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  1cfab34772f780f0496b3d5007217b41c04264d6 (commit)
      from  0b84d1552a760ccbf0df4e6caa2948cc2a952012 (commit)

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

- Log -----------------------------------------------------------------
commit 1cfab34772f780f0496b3d5007217b41c04264d6
Author: Rick Moseley <rmoseley@dhcp-215.hsv.redhat.com>
Date:   Fri Jun 6 13:32:35 2008 -0500

    Get commandline args from proc's getCmdLine() method.
    
    * CoreCommand.java: Get args from commandline for run.
    * TestCoreCommand.java: Add test for above.
    * testbed/SlaveOffspring.java: Add methods to accept commandline args.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog               |    5 +++++
 frysk-core/frysk/hpd/CoreCommand.java        |    1 +
 frysk-core/frysk/hpd/TestCoreCommand.java    |   21 +++++++++++++++++++++
 frysk-core/frysk/testbed/ChangeLog           |    4 ++++
 frysk-core/frysk/testbed/SlaveOffspring.java |   10 ++++++++++
 5 files changed, 41 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 33e1546..417a8e9 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-06  Rick Moseley  <rmoseley@redhat.com>
+
+	* CoreCommand.java: Get args from commandline for run.
+	* TestCoreCommand.java: Add test for above.
+
 2008-06-05  Rick Moseley  <rmoseley@redhat.com>
 
 	* UnloadCommand.java: Fix errors for unloading processes.
diff --git a/frysk-core/frysk/hpd/CoreCommand.java b/frysk-core/frysk/hpd/CoreCommand.java
index 7677ee9..ced6d22 100644
--- a/frysk-core/frysk/hpd/CoreCommand.java
+++ b/frysk-core/frysk/hpd/CoreCommand.java
@@ -140,6 +140,7 @@ public class CoreCommand extends ParameterizedCommand {
 	// Finally, done.
 	synchronized (cli) {
 	    cli.coreProcs.put(coreProc, new Integer(procID));
+	    cli.ptsetParams.put(new Integer(procID), coreProc.getCmdLine());
 	}
 	cli.outWriter.println("Attached to core file: "
 			      + coreProc.getHost().getName());
diff --git a/frysk-core/frysk/hpd/TestCoreCommand.java b/frysk-core/frysk/hpd/TestCoreCommand.java
index 9ba3eb1..787edf8 100644
--- a/frysk-core/frysk/hpd/TestCoreCommand.java
+++ b/frysk-core/frysk/hpd/TestCoreCommand.java
@@ -41,6 +41,7 @@ package frysk.hpd;
 
 import java.io.File;
 import frysk.testbed.CorefileFactory;
+import frysk.testbed.SlaveOffspring;
 import frysk.config.Prefix;
 
 public class TestCoreCommand extends TestLib {
@@ -85,4 +86,24 @@ public class TestCoreCommand extends TestLib {
 	e.sendCommandExpectPrompt("run",
 				  "Attached to process.*");
     }
+    
+    public void testCoreLoadedParams() {
+	
+	if (unresolved(6602))
+	    return;
+	String[] args = {"zzz", "yyy" };
+	SlaveOffspring newProc = SlaveOffspring.createDaemon(args);
+	int pid = newProc.getPid().intValue();
+	e = new HpdTestbed();
+	e.sendCommandExpectPrompt("start", "starting.*zzz yyy.*" +
+		"Attached to process ([0-9]+).*");
+	e.sendCommandExpectPrompt("dump -a -o test_core." + pid, "Generating corefile.*");
+	e.sendCommandExpectPrompt("unload -t 0", "Removed Target set \\[0\\].*");
+	e.sendCommandExpectPrompt("core test_core." + pid, "Attached to core.*");
+	e.sendCommandExpectPrompt("run", "running.*zzz yyy.*" +
+		"Attached to process ([0-9]+).*" + "Running process ([0-9]+).*");
+	e.send("quit\n");
+	e.expect("Quitting\\.\\.\\.");
+	e.close();
+    }
 }
diff --git a/frysk-core/frysk/testbed/ChangeLog b/frysk-core/frysk/testbed/ChangeLog
index 68af896..1babdc8 100644
--- a/frysk-core/frysk/testbed/ChangeLog
+++ b/frysk-core/frysk/testbed/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-06  Rick Moseley  <rmoseley@redhat.com>
+
+	* SlaveOffspring.java: Add methods to accept commandline args.
+
 2008-05-09  Andrew Cagney  <cagney@redhat.com>
 
 	* OffspringType.java: Pass File to Fork.daemon.
diff --git a/frysk-core/frysk/testbed/SlaveOffspring.java b/frysk-core/frysk/testbed/SlaveOffspring.java
index ad1382f..7c07fd6 100644
--- a/frysk-core/frysk/testbed/SlaveOffspring.java
+++ b/frysk-core/frysk/testbed/SlaveOffspring.java
@@ -109,6 +109,10 @@ public class SlaveOffspring
 	super(type, CHILD_ACK, funitSlaveCommand(false, null));
     }
 
+    /** Create an ack process with args. */
+    private SlaveOffspring (OffspringType type, String[] args) {
+	super(type, CHILD_ACK, funitSlaveCommand(false, args));
+    }
     /**
      * Create an SlaveOffspring; if BUSY, the process will use a
      * busy-loop, instead of suspending, when waiting for signal
@@ -264,6 +268,12 @@ public class SlaveOffspring
 	return new SlaveOffspring(OffspringType.DAEMON);
     }
     /**
+     * Create a slave-process that is a child of this process with args.
+     */
+    static public SlaveOffspring createDaemon(String[] args) {
+	return new SlaveOffspring(OffspringType.DAEMON, args);
+    }
+    /**
      * Create a slave-process that is a child of this process.
      */
     static public SlaveOffspring createDaemon(boolean busy) {


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


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

only message in thread, other threads:[~2008-06-06 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-06 18:34 [SCM] master: Get commandline args from proc's getCmdLine() method 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).