From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12520 invoked by alias); 30 May 2008 17:47:59 -0000 Received: (qmail 12492 invoked by uid 9519); 30 May 2008 17:47:59 -0000 Date: Fri, 30 May 2008 17:47:00 -0000 Message-ID: <20080530174759.12477.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Updated how args are retrieved by InfoArgsCommands. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4534ebccc1d0c6b21464f0b5cffda72943079b73 X-Git-Newrev: 5aee88eb9df989c6b3fa83f6c2dea8fe1ba7f605 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/msg00309.txt.bz2 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 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 + + * InfoArgsCommand.java: Updated how args are gotten. + * TestInfoArgsCommand.java: Added new more comprehensive + tests. + 2008-05-29 Teresa Thomas * 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