This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Patch to modify initial ProcState setting in Proc.java
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Frysk Hackers <frysk at sourceware dot org>
- Date: Fri, 02 Feb 2007 21:45:19 -0600
- Subject: Patch to modify initial ProcState setting in Proc.java
Hi
While working on core file work, I needed to make a quick change to Proc
and any of its sub-classes. Attached is a patch to move the setting of
initial ProcStates from Proc to sub-classes of Proc (eg
LinuxPtraceProc). Some constructors in Proc needed an initial state set.
Regards
Phil
Index: ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/ChangeLog,v
retrieving revision 1.615
diff -u -r1.615 ChangeLog
--- ChangeLog 2 Feb 2007 15:40:12 -0000 1.615
+++ ChangeLog 3 Feb 2007 03:37:48 -0000
@@ -1,3 +1,12 @@
+2007-02-02 Phil Muldoon <pmuldoon@redhat.com>
+
+ * Proc.java (Proc): Remove setting LinuxPtraceState states.
+ Use getInitialState() to find initial states from sub-classes of
+ Proc.
+ (getInitialState): New. Abstract.
+ * LinuxPtraceProc.java (getInitialState): New. Set initial state.
+ * DummyProc.java (getInitialState): Ditto.
+
2007-02-02 Mark Wielaard <mark@klomp.org>
* StressAttachDetachManyTasks.java (test): Remove #2468 blocker.
Index: Proc.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/Proc.java,v
retrieving revision 1.98
diff -u -r1.98 Proc.java
--- Proc.java 22 Jan 2007 18:56:16 -0000 1.98
+++ Proc.java 3 Feb 2007 03:37:48 -0000
@@ -168,6 +168,8 @@
final BreakpointAddresses breakpoints;
+ protected abstract ProcState getInitialState (boolean procStarting);
+
/**
* Create a new Proc skeleton. Since PARENT could be NULL, explicitly specify
* the HOST.
@@ -193,7 +195,7 @@
protected Proc (Host host, Proc parent, ProcId id)
{
this(id, parent, host, null);
- newState = LinuxPtraceProcState.initial(this, false);
+ newState = getInitialState(false);
logger.log(Level.FINEST, "{0} new - create unattached running proc\n", this);
}
@@ -208,7 +210,7 @@
protected Proc (Task task, ProcId forkId)
{
this(forkId, task.proc, task.proc.host, task);
- newState = LinuxPtraceProcState.initial(this, true);
+ newState = getInitialState(true);
logger.log(Level.FINE, "{0} new - create attached running proc\n", this);
}
Index: LinuxPtraceProc.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/LinuxPtraceProc.java,v
retrieving revision 1.4
diff -u -r1.4 LinuxPtraceProc.java
--- LinuxPtraceProc.java 23 Jan 2007 16:24:50 -0000 1.4
+++ LinuxPtraceProc.java 3 Feb 2007 03:37:49 -0000
@@ -76,6 +76,16 @@
}
/**
+ * Some constructors in Proc.java need a starting state.
+ * As Proc is abstract and cannot return a state specific
+ * to its subclass, return here in the subclass
+ */
+ protected ProcState getInitialState (boolean procStarting)
+ {
+ return LinuxPtraceProcState.initial(this, procStarting);
+ }
+
+ /**
* Create a new detached process. RUNNING makes no sense here.
* Since PARENT could be NULL, also explicitly pass in the host.
*/
Index: DummyProc.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/DummyProc.java,v
retrieving revision 1.5
diff -u -r1.5 DummyProc.java
--- DummyProc.java 19 Jan 2007 14:19:21 -0000 1.5
+++ DummyProc.java 3 Feb 2007 03:37:49 -0000
@@ -71,6 +71,10 @@
void sendRefresh() {
}
+
+ protected ProcState getInitialState (boolean procStarting) {
+ return null;
+ }
Auxv[] sendrecAuxv() {
return null;