This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Eliminate Task.set.


The branch, master has been updated
       via  db09f6ef565b9afe958f9e248c918f01a02c2144 (commit)
       via  5f2bca9ce34399a2c22a58edf65f683dfe65749f (commit)
      from  b20d1b8ac6c297e412316e42ff53cb49f52284e4 (commit)

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

- Log -----------------------------------------------------------------
commit db09f6ef565b9afe958f9e248c918f01a02c2144
Author: Andrew Cagney <cagney@redhat.com>
Date:   Wed Jan 2 22:07:30 2008 -0500

    Eliminate Task.set.
    
    frysk-core/frysk/proc/ChangeLog
    2008-01-02  Andrew Cagney  <cagney@redhat.com>
    
    	* Task.java (set(TaskState)): Delete.
    	(Task(TaskId,Proc,Task)): Replace Task(TaskId,Proc,Task,TaskState).
    
    frysk-core/frysk/proc/dead/ChangeLog
    2008-01-02  Andrew Cagney  <cagney@redhat.com>
    
    	* DeadTask.java (set(TaskState)): Delete.
    
    frysk-core/frysk/proc/dummy/ChangeLog
    2008-01-02  Andrew Cagney  <cagney@redhat.com>
    
    	* DummyTask.java (set(TaskState)): Delete.
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-01-02  Andrew Cagney  <cagney@redhat.com>
    
    	* LiveTask.java: Set newState in constructor.
    	(set(TaskState)): Make package private.

commit 5f2bca9ce34399a2c22a58edf65f683dfe65749f
Author: Andrew Cagney <cagney@redhat.com>
Date:   Wed Jan 2 21:40:33 2008 -0500

    Delete frysk.proc.dead.LinuxTaskState.
    
    frysk-core/frysk/proc/dead/ChangeLog
    2008-01-02  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxTaskState.java: Delete.
    	* DeadTask.java: Update.
    	* LinuxExeTask.java: Update.
    	* LinuxTask.java: Update.

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

Summary of changes:
 frysk-core/frysk/proc/ChangeLog                |    3 +
 frysk-core/frysk/proc/Task.java                |   19 ++---
 frysk-core/frysk/proc/dead/ChangeLog           |    7 ++
 frysk-core/frysk/proc/dead/DeadTask.java       |   12 +---
 frysk-core/frysk/proc/dead/LinuxExeProc.java   |    5 +-
 frysk-core/frysk/proc/dead/LinuxExeTask.java   |    5 +-
 frysk-core/frysk/proc/dead/LinuxTask.java      |   24 +++---
 frysk-core/frysk/proc/dead/LinuxTaskState.java |   95 ------------------------
 frysk-core/frysk/proc/dummy/ChangeLog          |    2 +
 frysk-core/frysk/proc/dummy/DummyTask.java     |   10 +--
 frysk-core/frysk/proc/live/ChangeLog           |    3 +
 frysk-core/frysk/proc/live/LiveTask.java       |   11 ++-
 12 files changed, 47 insertions(+), 149 deletions(-)
 delete mode 100644 frysk-core/frysk/proc/dead/LinuxTaskState.java

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index f227862..f5d5c4f 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,8 @@
 2008-01-02  Andrew Cagney  <cagney@redhat.com>
 
+	* Task.java (set(TaskState)): Delete.
+	(Task(TaskId,Proc,Task)): Replace Task(TaskId,Proc,Task,TaskState).
+
 	* Proc.java (getInitialState(boolean)): Delete.
 	(setStateFIXME(TaskState)): Delete.
 
diff --git a/frysk-core/frysk/proc/Task.java b/frysk-core/frysk/proc/Task.java
index 0005dfc..2f142aa 100644
--- a/frysk-core/frysk/proc/Task.java
+++ b/frysk-core/frysk/proc/Task.java
@@ -92,10 +92,6 @@ public abstract class Task {
      * Return the state as a string; do not use!!!!
      */
     protected abstract String getStateFIXME();
-    /**
-     * Set the new state.
-     */
-    protected abstract void set(TaskState newState);
 
     /**
      * Return's this Task's Instruction Set Architecture.
@@ -158,28 +154,27 @@ public abstract class Task {
     /**
      * Create a new Task skeleton.
      */
-    private Task(TaskId id, Proc proc, Task creator, TaskState state) {
+    private Task(TaskId id, Proc proc, Task creator) {
 	this.proc = proc;
 	this.id = id;
 	this.creator = creator;
 	proc.add(this);
 	proc.getHost().add(this);
-	set(state);
     }
 
     /**
      * Create a new unattached Task.
      */
-    protected Task(Proc proc, TaskId id, TaskState state) {
-	this(id, proc, null, state);
+    protected Task(Proc proc, TaskId id) {
+	this(id, proc, null);
 	logger.log(Level.FINEST, "{0} new -- create unattached\n", this);
     }
 
     /**
      * Create a new attached clone of Task.
      */
-    protected Task(Task task, TaskId cloneId, TaskState state) {
-	this(cloneId, task.proc, task, state);
+    protected Task(Task task, TaskId cloneId) {
+	this(cloneId, task.proc, task);
 	logger.log(Level.FINE, "{0} new -- create attached clone\n", this);
     }
 
@@ -192,8 +187,8 @@ public abstract class Task {
      * Conversely, for a Task, while it has the Observable, it doesn't
      * have the containing proc.
      */
-    protected Task(Proc proc, TaskObserver.Attached attached, TaskState state) {
-	this(new TaskId(proc.getPid()), proc, proc.creator, state);
+    protected Task(Proc proc, TaskObserver.Attached attached) {
+	this(new TaskId(proc.getPid()), proc, proc.creator);
     }
 
     // Send operation to corresponding underlying [kernel] task.  The
diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
index 0124cdb..61dfe43 100644
--- a/frysk-core/frysk/proc/dead/ChangeLog
+++ b/frysk-core/frysk/proc/dead/ChangeLog
@@ -1,5 +1,12 @@
 2008-01-02  Andrew Cagney  <cagney@redhat.com>
 
+	* DeadTask.java (set(TaskState)): Delete.
+	
+	* LinuxTaskState.java: Delete.
+	* DeadTask.java: Update.
+	* LinuxExeTask.java: Update.
+	* LinuxTask.java: Update.
+
 	* DeadTask.java (requestUnblock, requestAddClonedObserver)
 	(requestAddForkedObserver, requestAddTerminatedObserver): Ignore
 	requests.
diff --git a/frysk-core/frysk/proc/dead/DeadTask.java b/frysk-core/frysk/proc/dead/DeadTask.java
index 051aac2..e1e0590 100644
--- a/frysk-core/frysk/proc/dead/DeadTask.java
+++ b/frysk-core/frysk/proc/dead/DeadTask.java
@@ -42,7 +42,6 @@ package frysk.proc.dead;
 import java.util.logging.Level;
 import frysk.proc.Task;
 import frysk.proc.Proc;
-import frysk.proc.TaskState;
 import frysk.proc.TaskId;
 import frysk.proc.TaskObserver;
 import frysk.proc.TaskObservation;
@@ -54,8 +53,8 @@ import frysk.proc.TaskObservation;
  */
 
 abstract class DeadTask extends Task {
-    DeadTask(Proc proc, TaskId taskId, TaskState initialState) {
-	super(proc, taskId, initialState);
+    DeadTask(Proc proc, TaskId taskId) {
+	super(proc, taskId);
     }
 
     protected String getStateFIXME() {
@@ -63,13 +62,6 @@ abstract class DeadTask extends Task {
     }
 
     /**
-     * Set the new state.
-     */
-    protected final void set(TaskState newState) {
-	// ignore
-    }
-
-    /**
      * (Internal) Add the specified observer to the observable.
      */
     protected void handleAddObservation(TaskObservation observation) {
diff --git a/frysk-core/frysk/proc/dead/LinuxExeProc.java b/frysk-core/frysk/proc/dead/LinuxExeProc.java
index 11ea9fa..55300bb 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeProc.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeProc.java
@@ -72,9 +72,8 @@ public class LinuxExeProc extends DeadProc {
     }
 
     public void sendRefresh() {
-	 LinuxExeTask newTask = new LinuxExeTask(this, new TaskId(0),
-		 LinuxExeTaskState.initial());
-	 newTask.getClass();
+	LinuxExeTask newTask = new LinuxExeTask(this, new TaskId(0));
+	newTask.getClass();
     }
 
     protected Auxv[] sendrecAuxv() {
diff --git a/frysk-core/frysk/proc/dead/LinuxExeTask.java b/frysk-core/frysk/proc/dead/LinuxExeTask.java
index 03842e9..8cfa420 100644
--- a/frysk-core/frysk/proc/dead/LinuxExeTask.java
+++ b/frysk-core/frysk/proc/dead/LinuxExeTask.java
@@ -44,7 +44,6 @@ import inua.eio.ByteBuffer;
 import frysk.bank.RegisterBanks;
 import frysk.proc.Isa;
 import frysk.proc.TaskId;
-import frysk.proc.TaskState;
 import frysk.isa.ISA;
 
 import lib.dwfl.*;
@@ -55,8 +54,8 @@ public class LinuxExeTask extends DeadTask
   LinuxExeProc proc = null;
   TaskId id = null;
 
-  protected LinuxExeTask(LinuxExeProc proc, TaskId id, TaskState state) {
-      super(proc, id, state);
+  protected LinuxExeTask(LinuxExeProc proc, TaskId id) {
+      super(proc, id);
       this.proc = proc;
       this.id = id;
 
diff --git a/frysk-core/frysk/proc/dead/LinuxTask.java b/frysk-core/frysk/proc/dead/LinuxTask.java
index 66660a6..c45bccb 100644
--- a/frysk-core/frysk/proc/dead/LinuxTask.java
+++ b/frysk-core/frysk/proc/dead/LinuxTask.java
@@ -125,19 +125,17 @@ public class LinuxTask extends DeadTask {
     }
 
     
-  /**
-   * Create a new unattached Task.
-   */
-  LinuxTask (LinuxProc proc, ElfPrstatus elfTask, ElfPrFPRegSet
-	     elfFPRegs, ElfPrXFPRegSet elfXFPRegs)
-  {
-    super(proc, new TaskId(elfTask.getPrPid()),LinuxTaskState.initial());
-    this.elfTask = elfTask;
-    this.elfFPRegs = elfFPRegs;
-    this.elfXFPRegs = elfXFPRegs;
-    this.parent = proc;
-
-  }
+    /**
+     * Create a new unattached Task.
+     */
+    LinuxTask(LinuxProc proc, ElfPrstatus elfTask, ElfPrFPRegSet
+	      elfFPRegs, ElfPrXFPRegSet elfXFPRegs) {
+	super(proc, new TaskId(elfTask.getPrPid()));
+	this.elfTask = elfTask;
+	this.elfFPRegs = elfFPRegs;
+	this.elfXFPRegs = elfXFPRegs;
+	this.parent = proc;
+    }
 
     protected ISA sendrecISA() {
     	return ((LinuxProc)getProc()).sendrecISA();
diff --git a/frysk-core/frysk/proc/dead/LinuxTaskState.java b/frysk-core/frysk/proc/dead/LinuxTaskState.java
deleted file mode 100644
index a7592c3..0000000
--- a/frysk-core/frysk/proc/dead/LinuxTaskState.java
+++ /dev/null
@@ -1,95 +0,0 @@
-// This file is part of the program FRYSK.
-//
-// Copyright 2007 Red Hat Inc.
-//
-// FRYSK is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// FRYSK is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-
-package frysk.proc.dead;
-
-import java.util.logging.Level;
-import frysk.proc.TaskState;
-import frysk.proc.Task;
-
-/**
- * The core file task state machine.
- */
-
-abstract class LinuxTaskState
-  extends TaskState
-{
-
-  /**
-   * Return the initial state of a detached task.
-   */
-  static TaskState detachedState ()
-  {
-    return detached;
-  }
-  
-  /**
-   * Return the initial state of the Main task.
-   */
-  static TaskState initial ()
-  {
-    return detached;
-  }
-
-  protected LinuxTaskState (String state)
-  {
-    super (state);
-  }
-  
-  /**
-   * The task isn't attached. Read in from a core file.
-   */
-  private static final TaskState detached = new TaskState ("detached")
-	{
-	  public TaskState handleRemoval (Task task)
-	  {
-	
-	    // XXX: Core file tasks are never removed.
-	    logger.log (Level.FINE, "{0} handleRemoval\n", task); 
-	    throw new RuntimeException("Cannot remove corefile tasks");
-	  }
-	  public TaskState handleAttach (Task task)
-	  {
-	    logger.log (Level.FINE, "{0} handleAttach\n", task); 
-	    // XXX: Cannot attach to core file tasks (For now). In the
-	    // future this may change if the concept of attach is meaningful.
-	    throw new RuntimeException("Cannot attach to corefile tasks");
-	  }
-    };
- }
diff --git a/frysk-core/frysk/proc/dummy/ChangeLog b/frysk-core/frysk/proc/dummy/ChangeLog
index 0cbdd84..0a94321 100644
--- a/frysk-core/frysk/proc/dummy/ChangeLog
+++ b/frysk-core/frysk/proc/dummy/ChangeLog
@@ -1,5 +1,7 @@
 2008-01-02  Andrew Cagney  <cagney@redhat.com>
 
+	* DummyTask.java (set(TaskState)): Delete.
+	
 	* DummyTask.java (oldState, newState): Delete; remove references.
 	(getState(), oldState()): Delete; remove references.
 	(getStateFIXME()): Simplify.
diff --git a/frysk-core/frysk/proc/dummy/DummyTask.java b/frysk-core/frysk/proc/dummy/DummyTask.java
index d8df7dc..25d77a6 100644
--- a/frysk-core/frysk/proc/dummy/DummyTask.java
+++ b/frysk-core/frysk/proc/dummy/DummyTask.java
@@ -42,7 +42,6 @@ package frysk.proc.dummy;
 import inua.eio.ByteBuffer;
 import frysk.proc.TaskObserver;
 import frysk.proc.Isa;
-import frysk.proc.TaskState;
 import frysk.proc.TaskObservation;
 import frysk.isa.ISA;
 import frysk.bank.RegisterBanks;
@@ -52,7 +51,7 @@ import frysk.proc.Proc;
 public class DummyTask extends Task {
 
     public DummyTask (Proc parent) {
-	super (parent, (TaskObserver.Attached) null, null);
+	super (parent, (TaskObserver.Attached) null);
     }
     public String getStateString() {
 	return "Attached";
@@ -74,13 +73,6 @@ public class DummyTask extends Task {
 	return "dummy";
     }
 
-    /**
-     * Set the new state.
-     */
-    protected final void set(TaskState newState) {
-	// ignore
-    }
-
     protected void handleAddObservation(TaskObservation observation) {
 	throw new RuntimeException("oops!");
     }
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 3e3b566..1fcb4bd 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,5 +1,8 @@
 2008-01-02  Andrew Cagney  <cagney@redhat.com>
 
+	* LiveTask.java: Set newState in constructor.
+	(set(TaskState)): Make package private.
+
 	* LinuxProcState.java (initial(boolean)): Replace
 	initial(Proc,boolean).
 	(Detaching()): New constructor.
diff --git a/frysk-core/frysk/proc/live/LiveTask.java b/frysk-core/frysk/proc/live/LiveTask.java
index 78a0a3d..3f69f0d 100644
--- a/frysk-core/frysk/proc/live/LiveTask.java
+++ b/frysk-core/frysk/proc/live/LiveTask.java
@@ -58,13 +58,16 @@ import frysk.proc.Manager;
 
 abstract class LiveTask extends Task {
     LiveTask(Proc proc, TaskId taskId, TaskState initialState) {
-	super(proc, taskId, initialState);
+	super(proc, taskId);
+	newState = initialState;
     }
     LiveTask(Task task, TaskId taskId, TaskState initialState) {
-	super(task, taskId, initialState);
+	super(task, taskId);
+	newState = initialState;
     }
     LiveTask(LiveProc proc, Attached attached, TaskState initialState) {
-	super(proc, attached, initialState);
+	super(proc, attached);
+	newState = initialState;
 	if (attached != null) {
 	    TaskObservation ob = new TaskObservation(this, attachedObservers,
 						     attached, true) {
@@ -99,7 +102,7 @@ abstract class LiveTask extends Task {
     /**
      * Set the new state.
      */
-    protected final void set(TaskState newState) {
+    void set(TaskState newState) {
 	this.newState = newState;
     }
 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]