From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19236 invoked by alias); 6 Jun 2008 18:34:46 -0000 Received: (qmail 19210 invoked by uid 9519); 6 Jun 2008 18:34:45 -0000 Date: Fri, 06 Jun 2008 18:34:00 -0000 Message-ID: <20080606183445.19195.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Get commandline args from proc's getCmdLine() method. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 0b84d1552a760ccbf0df4e6caa2948cc2a952012 X-Git-Newrev: 1cfab34772f780f0496b3d5007217b41c04264d6 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-q2/txt/msg00346.txt.bz2 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 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 + + * CoreCommand.java: Get args from commandline for run. + * TestCoreCommand.java: Add test for above. + 2008-06-05 Rick Moseley * 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 + + * SlaveOffspring.java: Add methods to accept commandline args. + 2008-05-09 Andrew Cagney * 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