public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Delete Host.add(Proc).
@ 2008-02-26 22:17 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-02-26 22:17 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  a2762d9fc264df8287bfa9830b1148b4e4143970 (commit)
      from  829e29f60e0045374be7ccac042b2d31412df039 (commit)

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

- Log -----------------------------------------------------------------
commit a2762d9fc264df8287bfa9830b1148b4e4143970
Author: Andrew Cagney <cagney@redhat.com>
Date:   Tue Feb 26 17:17:16 2008 -0500

    Delete Host.add(Proc).
    
    frysk-core/frysk/proc/ChangeLog
    2008-02-26  Andrew Cagney  <cagney@redhat.com>
    
    	* Proc.java (Proc): Do not call Host.add(Proc).
    	* Host.java (procPool): Delete.
    	(add(Proc)): Delete.
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-02-26  Andrew Cagney  <cagney@redhat.com>
    
    	* LinuxPtraceHost.java (removeProc(ProcessIdentifier)): New.
    	(addProc(ProcessIdentifier,LinuxPtraceProc)): Rename putProc; call
    	observableProcAddedXXX.notify.
    	* LinuxPtraceProc.java: Update.

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

Summary of changes:
 frysk-core/frysk/proc/ChangeLog                 |    4 ++++
 frysk-core/frysk/proc/Host.java                 |   13 ++-----------
 frysk-core/frysk/proc/Proc.java                 |    2 --
 frysk-core/frysk/proc/live/ChangeLog            |    7 +++++++
 frysk-core/frysk/proc/live/LinuxPtraceHost.java |   11 +++++++++--
 frysk-core/frysk/proc/live/LinuxPtraceProc.java |    4 ++--
 6 files changed, 24 insertions(+), 17 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index e5b6333..5341302 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,9 @@
 2008-02-26  Andrew Cagney  <cagney@redhat.com>
 
+	* Proc.java (Proc): Do not call Host.add(Proc).
+	* Host.java (procPool): Delete.
+	(add(Proc)): Delete.
+
 	* Host.java (getProc(ProcId)): Delete.
 
 	* Host.java (getSoleProcFIXME()): Delete.
diff --git a/frysk-core/frysk/proc/Host.java b/frysk-core/frysk/proc/Host.java
index d5e3508..69f5891 100644
--- a/frysk-core/frysk/proc/Host.java
+++ b/frysk-core/frysk/proc/Host.java
@@ -89,20 +89,11 @@ public abstract class Host implements Comparable {
     }
 
 	
-    // Maintain a Collection of all known (live) PROCes.
-
-    protected Map procPool = new HashMap();
-    void add(Proc proc) {
-	logger.log(Level.FINEST, "{0} add Proc\n", this);
-	observableProcAddedXXX.notify(proc);
-	procPool.put(proc.id, proc);
-    }
     /**
      * XXX: Should not be public.
      */
     public void remove(Proc proc) {
 	logger.log(Level.FINEST, "{0} remove Proc\n", this);
-	procPool.remove(proc.id);
 	observableProcRemovedXXX.notify(proc);
     }
 
@@ -149,8 +140,8 @@ public abstract class Host implements Comparable {
      * XXX: Temporary until .observable's are converted to
      * .requestAddObserver.
      */
-    public class ObservableXXX extends Observable {
-	void notify(Object o) {
+    public static class ObservableXXX extends Observable {
+	public void notify(Object o) {
 	    setChanged();
 	    notifyObservers(o);
 	}
diff --git a/frysk-core/frysk/proc/Proc.java b/frysk-core/frysk/proc/Proc.java
index 65a0ba7..bfa2cfd 100644
--- a/frysk-core/frysk/proc/Proc.java
+++ b/frysk-core/frysk/proc/Proc.java
@@ -158,8 +158,6 @@ public abstract class Proc implements Comparable {
 	// Keep parent informed.
 	if (parent != null)
 	    parent.add(this);
-	// Keep host informed.
-	host.add(this);
     }
 
     /**
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 7e2001b..5ed2c18 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-26  Andrew Cagney  <cagney@redhat.com>
+
+	* LinuxPtraceHost.java (removeProc(ProcessIdentifier)): New.
+	(addProc(ProcessIdentifier,LinuxPtraceProc)): Rename putProc; call
+	observableProcAddedXXX.notify.
+	* LinuxPtraceProc.java: Update.
+
 2008-02-26  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* LinuxPtraceTask.java: Rename watchpoint variables.
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceHost.java b/frysk-core/frysk/proc/live/LinuxPtraceHost.java
index 84717b0..c5b6f84 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceHost.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceHost.java
@@ -96,8 +96,15 @@ public class LinuxPtraceHost extends LiveHost {
     LinuxPtraceProc getProc(ProcessIdentifier pid) {
 	return (LinuxPtraceProc) procs.get(pid);
     }
-    void putProc(ProcessIdentifier pid, LinuxPtraceProc proc) {
+    void addProc(ProcessIdentifier pid, LinuxPtraceProc proc) {
 	procs.put(pid, proc);
+	// FIXME: Code looking for procs shouldn't be parked on
+	// observer, rather the code should be using
+	// Host.requestRefresh.
+	observableProcAddedXXX.notify(proc);
+    }
+    void removeProc(ProcessIdentifier pid) {
+	procs.remove(pid);
     }
 
     /**
@@ -216,7 +223,7 @@ public class LinuxPtraceHost extends LiveHost {
 	ProcChanges procChanges = executeRefresh();
 	Collection exitedProcesses = procChanges.removed.values();
 	exitedProcesses.retainAll(knownProcesses);
-	Collection newProcesses = new HashSet(procPool.values());
+	Collection newProcesses = new HashSet(procs.values());
 	newProcesses.removeAll(knownProcesses);
 	builder.construct(newProcesses, exitedProcesses);
     }
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceProc.java b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
index 87c366a..4d2eae4 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceProc.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
@@ -79,7 +79,7 @@ public class LinuxPtraceProc extends LiveProc {
     public LinuxPtraceProc(Host host, Proc parent,
 			   ProcessIdentifier pid, Stat stat) {
 	super(host, parent, pid);
-	((LinuxPtraceHost)host).putProc(ProcessIdentifierFactory.create(pid.hashCode()), this);
+	((LinuxPtraceHost)host).addProc(ProcessIdentifierFactory.create(pid.hashCode()), this);
 	this.newState = LinuxPtraceProcState.initial(false);
 	this.stat = stat;
 	this.breakpoints = new BreakpointAddresses(this);
@@ -90,7 +90,7 @@ public class LinuxPtraceProc extends LiveProc {
      */
     public LinuxPtraceProc(Task task, ProcessIdentifier fork) {
 	super(task, fork);
-	((LinuxPtraceHost)getHost()).putProc(fork, this);
+	((LinuxPtraceHost)getHost()).addProc(fork, this);
 	this.newState = LinuxPtraceProcState.initial(true);
 	this.breakpoints = new BreakpointAddresses(this);
     }


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-26 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26 22:17 [SCM] master: Delete Host.add(Proc) cagney

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).