public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: mark@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Use Comparator inside ActionPointCommands. Fixes bug #5809.
Date: Wed, 05 Mar 2008 18:11:00 -0000	[thread overview]
Message-ID: <20080305181151.27725.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  225b857e68be8aaace9cc2736e330f3b3b471809 (commit)
       via  9bb0e1ddb504de1bf456b810f47a6533bea6c89c (commit)
      from  ed3e465f0588c2297480be91501c431a5ccf2b22 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 225b857e68be8aaace9cc2736e330f3b3b471809
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Wed Mar 5 19:11:02 2008 +0100

    Use Comparator inside ActionPointCommands. Fixes bug #5809.
    
    2008-03-05  Tom Tromey  <tromey@redhat.com>
    
           Bug 5809
           * ActionPointCommands.java (Actions.interpret): Use Comparator to
           sort the task set.

commit 9bb0e1ddb504de1bf456b810f47a6533bea6c89c
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Wed Mar 5 19:09:17 2008 +0100

    Add new test TestActionsCommand.
    
    frysk-core/frysk/hpd/ChangeLog
    2008-03-05  Mark Wielaard  <mwielaard@redhat.com>
    
           * TestActionsCommand.java: New test.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/hpd/ActionPointCommands.java      |    9 ++++-
 frysk-core/frysk/hpd/ChangeLog                     |   10 +++++
 .../TestActionsCommand.java}                       |   40 +++++++++----------
 3 files changed, 37 insertions(+), 22 deletions(-)
 copy frysk-core/frysk/{debuginfo/CompilerVersion.java => hpd/TestActionsCommand.java} (78%)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ActionPointCommands.java b/frysk-core/frysk/hpd/ActionPointCommands.java
index 5fdaaf1..3c6c681 100644
--- a/frysk-core/frysk/hpd/ActionPointCommands.java
+++ b/frysk-core/frysk/hpd/ActionPointCommands.java
@@ -46,6 +46,7 @@ import frysk.rt.SourceBreakpoint;
 import frysk.rt.UpdatingDisplayValue;
 import java.util.List;
 import java.util.Arrays;
+import java.util.Comparator;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -213,7 +214,13 @@ abstract class ActionPointCommands extends ParameterizedCommand {
 		    Map.Entry[] taskEntries
 			= new Map.Entry[taskEntrySet.size()];
 		    taskEntrySet.toArray(taskEntries);
-		    Arrays.sort(taskEntries);
+		    Arrays.sort(taskEntries, new Comparator() {
+			public int compare(Object o1, Object o2) {
+			  Map.Entry me1 = (Map.Entry) o1;
+			  Map.Entry me2 = (Map.Entry) o2;
+			  return ((Task) me1.getKey()).compareTo(me2.getKey());
+			}
+		      });
 		    for (int i = 0; i < taskEntries.length; i++) {
 			int id = ((Task) taskEntries[i].getKey()).getTid();
 			SourceBreakpoint.State state = (SourceBreakpoint.State) taskEntries[i]
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 650bcd4..4f4d065 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,13 @@
+2008-03-05  Tom Tromey  <tromey@redhat.com>
+
+	Bug 5809
+	* ActionPointCommands.java (Actions.interpret): Use Comparator to
+	sort the task set.
+
+2008-03-05  Mark Wielaard  <mwielaard@redhat.com>
+
+	* TestActionsCommand.java: New test.
+
 2008-03-04  Andrew Cagney  <cagney@redhat.com>
 
 	* LoadCommand.java (interpret()): Simplify; add -exe option.
diff --git a/frysk-core/frysk/debuginfo/CompilerVersion.java b/frysk-core/frysk/hpd/TestActionsCommand.java
similarity index 78%
copy from frysk-core/frysk/debuginfo/CompilerVersion.java
copy to frysk-core/frysk/hpd/TestActionsCommand.java
index 8b174c0..a01b9e8 100644
--- a/frysk-core/frysk/debuginfo/CompilerVersion.java
+++ b/frysk-core/frysk/hpd/TestActionsCommand.java
@@ -37,30 +37,28 @@
 // version and license this file solely under the GPL without
 // exception.
 
-package frysk.debuginfo;
+package frysk.hpd;
 
-import frysk.rsl.Log;
+public class TestActionsCommand extends TestLib {
 
-public class CompilerVersion {
+  public void testBreakpointActionsCommand()
+  {
+      HpdTestbed hpd = new HpdTestbed();
+      hpd = HpdTestbed.load("funit-hello");
 
-    protected static Log fine = Log.fine(CompilerVersion.class);
-    public final String compilerString;
-    
-    CompilerVersion(String compString) {
-	this.compilerString = compString;
-	fine.log(this, "Created compilerVersion for:", compString);
-    }
+      hpd.send("break print\n");
+      hpd.expect("breakpoint.*\n" + prompt);
 
-    public boolean supportsClassType() {
-	return false;
-    }
-    
-    public boolean supportsInterFaceType() {
-	return false;
-    }
-    
-    public String toString() {
-	return "Compiler: " + compilerString;
-    }
+      hpd.send("run\n");
+      hpd.expect("Breakpoint 0.*\n");
 
+      hpd.send("actions\n");
+      hpd.expect("actions.*\n");
+      hpd.expect("BREAKPOINTS.*\n");
+      hpd.expect("0  y print [0-9]+.*\n");
+
+      hpd.send("quit\n");
+      hpd.expect("quit.*\nQuitting...");
+      hpd.close();
+  }
 }


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-03-05 18:11 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=20080305181151.27725.qmail@sourceware.org \
    --to=mark@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).