From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9284 invoked by alias); 13 Dec 2007 03:14:42 -0000 Received: (qmail 9258 invoked by uid 9519); 13 Dec 2007 03:14:40 -0000 Date: Thu, 13 Dec 2007 03:14:00 -0000 Message-ID: <20071213031440.9242.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix SteppingEngine aborting when tasks have been only run(bz# 5482). X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1cc9d6f4bc5db27bf30ff59207d5588bf090495c X-Git-Newrev: 6e336c8e877a60dc82d621ae7f06f0c8dcb01099 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: 2007-q4/txt/msg00581.txt.bz2 The branch, master has been updated via 6e336c8e877a60dc82d621ae7f06f0c8dcb01099 (commit) from 1cc9d6f4bc5db27bf30ff59207d5588bf090495c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 6e336c8e877a60dc82d621ae7f06f0c8dcb01099 Author: Rick Moseley Date: Wed Dec 12 21:14:03 2007 -0600 Fix SteppingEngine aborting when tasks have been only run(bz# 5482). SteppingEngine.java (updateTerminated): Fix bz #5482. TestKillCommand.java (testLoadKill): For testing bz #5482. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 1 + frysk-core/frysk/hpd/TestKillCommand.java | 24 ++++++++++++++++++++++-- frysk-core/frysk/stepping/ChangeLog | 4 ++++ frysk-core/frysk/stepping/SteppingEngine.java | 5 +++-- 4 files changed, 30 insertions(+), 4 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index f1326c3..4313944 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,6 +1,7 @@ 2007-12-12 Rick Moseley * TestHpdTestHarness.java: New for testing bz #5480. + * TestKillCommand.java (testLoadKill): New for bz #5482. 2007-12-11 Rick Moseley diff --git a/frysk-core/frysk/hpd/TestKillCommand.java b/frysk-core/frysk/hpd/TestKillCommand.java index 338ff8f..fd5571d 100644 --- a/frysk-core/frysk/hpd/TestKillCommand.java +++ b/frysk-core/frysk/hpd/TestKillCommand.java @@ -79,8 +79,9 @@ public class TestKillCommand extends TestLib { * more than the set of commands you see here in one sequence. Just * uncommenting the next 2 statements after this comment causes this * test to fail for no good reason. A bug will be filed on this and the - * lines can be uncommented when fixed. - e.send("run\n"); + * lines can be uncommented when fixed. */ + /* + e.send(5, "run", "Attached to process*"); e.expect(5, "Attached to process*"); e.send("go\n"); e.expect(5, "Running process*"); @@ -93,4 +94,23 @@ public class TestKillCommand extends TestLib { e.expect(5, "Quitting*"); */ e.close(); } + + /** + * Test when all you have done is loaded/run the process and not + * have done a "go" on it. + */ + public void testLoadKill() { + e = new HpdTestbed(); + e.send("load " + Config.getPkgLibFile("funit-threads-looper").getPath() + + "\n"); + e.expect(5, "Loaded executable file*"); + e.send("run\n"); + e.expect(5, "Attached to process*"); + e.send("kill\n"); + e.expect(5, "Killing process*"); + //e.send("quit\n"); + //e.expect("Quitting*"); + e.close(); + } + } diff --git a/frysk-core/frysk/stepping/ChangeLog b/frysk-core/frysk/stepping/ChangeLog index 787279a..40001c8 100644 --- a/frysk-core/frysk/stepping/ChangeLog +++ b/frysk-core/frysk/stepping/ChangeLog @@ -1,3 +1,7 @@ +2007-12-12 Rick Moseley + + * SteppingEngine.java (updateTerminated): Fix bz# 5482. + 2007-12-11 Andrew Cagney * TestStepping.java: Update; DebugInfoFrame's .getLines() replaced diff --git a/frysk-core/frysk/stepping/SteppingEngine.java b/frysk-core/frysk/stepping/SteppingEngine.java index 9daaf4b..68584ca 100644 --- a/frysk-core/frysk/stepping/SteppingEngine.java +++ b/frysk-core/frysk/stepping/SteppingEngine.java @@ -1167,14 +1167,15 @@ public class SteppingEngine { * as terminated and notify the observers of the event. */ Proc proc = task.getProc(); Integer context = (Integer)SteppingEngine.this.contextMap.get(proc); - SteppingEngine.this.contextMap.put(proc, new Integer( + if (!SteppingEngine.this.contextMap.isEmpty()) + SteppingEngine.this.contextMap.put(proc, new Integer( context.intValue() - 1)); TaskStepEngine tse = (TaskStepEngine)SteppingEngine.this.taskStateMap .get(task); // Must have missed the terminating event - if (tse.isAlive()) { + if (tse != null && tse.isAlive()) { tse.setState(new StepTerminatedState(task)); if (signal) hooks/post-receive -- frysk system monitor/debugger