public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Updated how args are retrieved by InfoArgsCommands. Date: Fri, 30 May 2008 17:47:00 -0000 [thread overview] Message-ID: <20080530174759.12477.qmail@sourceware.org> (raw) 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
reply other threads:[~2008-05-30 17:47 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080530174759.12477.qmail@sourceware.org \ --to=rmoseley@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).