public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix error when 'go' command used before 'start' command and after 'load'/'core'. Date: Sat, 02 Feb 2008 08:38:00 -0000 [thread overview] Message-ID: <20080202083832.14011.qmail@sourceware.org> (raw) The branch, master has been updated via 12f10b3aab52bfe1a88c2715cce51d65db013258 (commit) from d80d5af416877aef88bc9ac2bcd38d17568244cd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 12f10b3aab52bfe1a88c2715cce51d65db013258 Author: Rick Moseley <rmoseley@localhost.localdomain> Date: Sat Feb 2 02:37:10 2008 -0600 Fix error when 'go' command used before 'start' command and after 'load'/'core'. * GoCommand.java: Fix bz #5714. * TestGoCommand.java(testGoCommandError()): New for above fix. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 5 ++++ frysk-core/frysk/hpd/GoCommand.java | 33 +++++++++++++++++------------- frysk-core/frysk/hpd/TestGoCommand.java | 31 +++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 20 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index ca5c749..434c3c3 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,8 @@ +2008-02-02 Rick Moseley <rmoseley@redhat.com> + + * GoCommand.java: Fix bz #5714. + * TestGoCommand.java(testGoCommandError()): New for above fix. + 2008-02-01 Rick Moseley <rmoseley@redhat.com> * GoCommand.java: Fix bz#5674. diff --git a/frysk-core/frysk/hpd/GoCommand.java b/frysk-core/frysk/hpd/GoCommand.java index 321d7c4..246d79d 100644 --- a/frysk-core/frysk/hpd/GoCommand.java +++ b/frysk-core/frysk/hpd/GoCommand.java @@ -62,14 +62,10 @@ class GoCommand extends ParameterizedCommand { if (cli.steppingObserver != null) { Iterator taskIter = ptset.getTasks(); SteppingEngine steppingEngine = cli.getSteppingEngine(); -// HashMap loadedProcs = cli.getLoadedProcs(); -// HashMap coreProcs = cli.getCoreProcs(); + while (taskIter.hasNext()) { Task task = (Task) taskIter.next(); -// int taskPid = task.getProc().getPid(); - if (!steppingEngine.isTaskRunning(task)) { //&& -// CLI.notRunningProc(taskPid, loadedProcs) && -// CLI.notRunningProc(taskPid, coreProcs)) { + if (!steppingEngine.isTaskRunning(task)) { /* Try to continue task, if an exception occurs it is * probably because it is already running and previously * has not been marked as such. Until the @@ -77,17 +73,26 @@ class GoCommand extends ParameterizedCommand { * can do for now. */ try { + if (CLI.notRunningProc(task.getProc().getPid(), cli.getLoadedProcs()) || + CLI.notRunningProc(task.getProc().getPid(), cli.getCoreProcs())) { + cli.addMessage("Cannot use 'go' on a loaded or core file, must " + + "use 'start' first", + Message.TYPE_ERROR); + continue; + } steppingEngine.continueExecution(task); + cli.addMessage("Running process " + task.getProc().getPid(), + Message.TYPE_NORMAL); } catch (Exception e) { - // OK, caught an exception, set the task to running - steppingEngine.setTaskRunning(task); + // OK, caught an exception, try to set the task to running + try { + steppingEngine.setTaskRunning(task); + } catch (Exception err) { + cli.addMessage("Process " + task.getProc().getPid() + " already running", + Message.TYPE_NORMAL); + } } - } // else if (CLI.notRunningProc(taskPid, loadedProcs) || - // CLI.notRunningProc(taskPid, coreProcs)) - // cli.addMessage("Cannot use 'go' on a loaded or core file, must 'start' first", Message.TYPE_WARNING); - //else - cli.addMessage("Running process " + task.getProc().getPid(), - Message.TYPE_NORMAL); + } } } else cli.addMessage("Not attached to any process", Message.TYPE_ERROR); diff --git a/frysk-core/frysk/hpd/TestGoCommand.java b/frysk-core/frysk/hpd/TestGoCommand.java index c332887..2242ee1 100644 --- a/frysk-core/frysk/hpd/TestGoCommand.java +++ b/frysk-core/frysk/hpd/TestGoCommand.java @@ -53,20 +53,39 @@ public class TestGoCommand extends TestLib { "Loaded executable file.*"); //e.sendCommandExpectPrompt("run ", // "Attached to process ([0-9]+).*Running process ([0-9]+).*"); - e.send("run\n"); - e.expect("Attached to process ([0-9]+).*"); - e.expect("Running process ([0-9]+).*" + prompt); - e.sendCommandExpectPrompt("go","Running process ([0-9]+).*"); + e.sendCommandExpectPrompt("start", "Attached to process ([0-9]+).*"); + e.sendCommandExpectPrompt("go", "Running process ([0-9]+).*"); e.send("quit\n"); e.expect("Quitting\\.\\.\\."); e.close(); } -/* public void testGoCommandError() { + /** + * testGoCommandError tests the condition when a 'go' command is issued on + * a loaded core file or executable before a 'start' or 'run' is issued. + */ + public void testGoCommandError() { e = new HpdTestbed(); e.sendCommandExpectPrompt("load " + Config.getPkgLibFile("funit-threads-looper").getPath(), "Loaded executable file.*"); - e.sendCommandExpectPrompt("go", "Warning: Cannot use.*"); + e.sendCommandExpectPrompt("go", "Error: Cannot use.*"); + e.send("quit\n"); + e.expect("Quitting\\.\\.\\."); + e.close(); + } + + /** + * testGoCommandErrorTwo tests the condition when a 'go' command is issued on + * a loaded core file or executable before a 'start' or 'run' is issued. + * + * Future test when bz #5674 is resolved. + */ + /* public void testGoCommandErrorTwo() { + e = new HpdTestbed(); + e.sendCommandExpectPrompt("load " + Config.getPkgLibFile("funit-threads-looper").getPath(), + "Loaded executable file.*"); + e.sendCommandExpectPrompt("run", "Attached to process.*Running process.*"); + e.sendCommandExpectPrompt("go", "Error: Cannot use.*"); e.send("quit\n"); e.expect("Quitting\\.\\.\\."); e.close(); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-02 8:38 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=20080202083832.14011.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).