From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7394 invoked by alias); 19 Nov 2007 21:58:06 -0000 Received: (qmail 7369 invoked by uid 9519); 19 Nov 2007 21:58:05 -0000 Date: Mon, 19 Nov 2007 21:58:00 -0000 Message-ID: <20071119215805.7354.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix bz# 5351. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e885dc3eb4142c9a1787b55c0dc33a30b7a07b1f X-Git-Newrev: 3e6a814efd3e79779a6e472ba385e74513f0ca34 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/msg00400.txt.bz2 The branch, master has been updated via 3e6a814efd3e79779a6e472ba385e74513f0ca34 (commit) from e885dc3eb4142c9a1787b55c0dc33a30b7a07b1f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 3e6a814efd3e79779a6e472ba385e74513f0ca34 Author: Rick Moseley Date: Mon Nov 19 15:57:44 2007 -0600 Fix bz# 5351. * CLI.java: Fix bz# 5351. * RunCommand.java: Ditto. * LoadCommand.java: Ditto. * AttachCommand.java: Ditto. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/AttachCommand.java | 2 +- frysk-core/frysk/hpd/CLI.java | 12 ++++++---- frysk-core/frysk/hpd/ChangeLog | 7 ++++++ frysk-core/frysk/hpd/LoadCommand.java | 2 +- frysk-core/frysk/hpd/RunCommand.java | 34 +++++++++++++++--------------- 5 files changed, 33 insertions(+), 24 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/AttachCommand.java b/frysk-core/frysk/hpd/AttachCommand.java index b19a6c9..90b014f 100644 --- a/frysk-core/frysk/hpd/AttachCommand.java +++ b/frysk-core/frysk/hpd/AttachCommand.java @@ -100,7 +100,7 @@ class AttachCommand extends ParameterizedCommand { cli.outWriter.println(pid); continue; } - cli.doAttach(findProc.proc, -1); + cli.doAttach(findProc.proc); } } diff --git a/frysk-core/frysk/hpd/CLI.java b/frysk-core/frysk/hpd/CLI.java index c996366..c7374e2 100644 --- a/frysk-core/frysk/hpd/CLI.java +++ b/frysk-core/frysk/hpd/CLI.java @@ -74,7 +74,9 @@ public class CLI { //Processes started with run command final HashSet runningProcs = new HashSet(); //Processes loaded with load command - final HashSet loadedProcs = new HashSet(); + final HashMap loadedProcs = new HashMap(); + //Task ID to use + int taskID = -1; private class TaskInfo { DebugInfoFrame frame; @@ -138,7 +140,7 @@ public class CLI { /* * Command handlers */ - public void doAttach(Proc proc, int procID) { + public void doAttach(Proc proc) { synchronized (this) { attached = -1; attachedLatch = new CountDownLatch(1); @@ -159,11 +161,11 @@ public class CLI { } steppingEngine.getBreakpointManager().manageProcess(proc); // If passed a taskID < 0, request a reserved ProcID - if (procID < 0) + if (this.taskID < 0) idManager.manageProc(proc, idManager.reserveProcID()); // Assign this proc to the passed in procID else - idManager.manageProcSelect(proc, procID); + idManager.manageProcSelect(proc, this.taskID); } final PrintWriter outWriter; @@ -448,7 +450,7 @@ public class CLI { * CLI object should be synchronized when using the set. * @return the set */ - public HashSet getLoadedProcs() { + public HashMap getLoadedProcs() { return loadedProcs; } diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 29d6c82..7080fa4 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,10 @@ +2007-11-19 Rick Moseley + + * CLI.java: Fix bz #5351. + * RunCommand.java: Ditto. + * LoadCommand.java: Ditto. + * AttachCommand.java: Ditto. + 2007-11-17 Andrew Cagney * EvalCommands.java (Printer): New. diff --git a/frysk-core/frysk/hpd/LoadCommand.java b/frysk-core/frysk/hpd/LoadCommand.java index d3f61e9..38fd2d0 100644 --- a/frysk-core/frysk/hpd/LoadCommand.java +++ b/frysk-core/frysk/hpd/LoadCommand.java @@ -99,7 +99,7 @@ public class LoadCommand extends ParameterizedCommand { } } synchronized (cli) { - cli.getLoadedProcs().add(exeProc); + cli.getLoadedProcs().put(exeProc, new Integer(procID)); } } diff --git a/frysk-core/frysk/hpd/RunCommand.java b/frysk-core/frysk/hpd/RunCommand.java index e680334..3e9bba1 100644 --- a/frysk-core/frysk/hpd/RunCommand.java +++ b/frysk-core/frysk/hpd/RunCommand.java @@ -50,6 +50,8 @@ import frysk.util.CountDownLatch; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Set; class RunCommand extends Command { // Used to synchronize with updateAttached method @@ -133,21 +135,25 @@ class RunCommand extends Command { } /* If we made it here, a run command was given with no parameters - * and there are either running procs or loaded procs + * and there should be either running procs or loaded procs */ /* This is the case where there are loaded procs */ if (!cli.loadedProcs.isEmpty()) { - Iterator foo = cli.targetset.getTasks(); + Set procSet = cli.loadedProcs.entrySet(); + Iterator foo = procSet.iterator(); while (foo.hasNext()) { - Task task = (Task) foo.next(); - int taskID = cli.idManager.getProcID(task.getProc()); - cli.execCommand("run " + task.getProc().getExe() + " " + - Integer.toString(taskID)); - } - // Clear all of the loaded procs now that they have been run - synchronized(cli) { - cli.loadedProcs.clear(); + Map.Entry me = (Map.Entry)foo.next(); + Proc proc = (Proc) me.getKey(); + Integer taskid = (Integer)me.getValue(); + synchronized(cli) { + cli.taskID = taskid.intValue(); + } + cli.execCommand("run " + proc.getExe()); + procSet.remove(proc); + synchronized(cli) { + cli.taskID = -1; + } } } // Found no loaded procs, print usage message @@ -164,13 +170,7 @@ class RunCommand extends Command { return; } // register with SteppingEngine et.al. - // If a second parameter was passed, it was a specific ProcTaskID to use - if (cmd.size() > 1) - cli.doAttach(runner.launchedTask.getProc(), - Integer.parseInt(cmd.parameter(1))); - // If not, pass a -1 so a new ProcTaskID will be assigned - else - cli.doAttach(runner.launchedTask.getProc(), -1); + cli.doAttach(runner.launchedTask.getProc()); runner.launchedTask.requestUnblock(runner); } hooks/post-receive -- frysk system monitor/debugger