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 bz# 5351.
Date: Mon, 19 Nov 2007 21:58:00 -0000	[thread overview]
Message-ID: <20071119215805.7354.qmail@sourceware.org> (raw)

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 <rmoseley@redhat.com>
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  <rmoseley@redhat.com>
+
+	* CLI.java: Fix bz #5351.
+	* RunCommand.java: Ditto.
+	* LoadCommand.java: Ditto.
+	* AttachCommand.java: Ditto.
+
 2007-11-17  Andrew Cagney  <cagney@redhat.com>
 
 	* 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


                 reply	other threads:[~2007-11-19 21:58 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=20071119215805.7354.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: link
Be 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).