public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: tthomas@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Add executeLive and executeDead to ProcEvent.
Date: Thu, 21 Feb 2008 20:07:00 -0000	[thread overview]
Message-ID: <20080221200740.17263.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  80b452ea9005301c922aa44b47c160496f9cd366 (commit)
      from  295806f7d921db258b359b6aab62c7e70018ccff (commit)

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

- Log -----------------------------------------------------------------
commit 80b452ea9005301c922aa44b47c160496f9cd366
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Thu Feb 21 15:03:45 2008 -0500

    Add executeLive and executeDead to ProcEvent.
    
    frysk-core/frysk/event/ChangeLog:
    2008-02-21  Teresa Thomas  <tthomas@redhat.com>
    
    	* ProcEvent.java (executeDead): New.
    	(executeLive): New.
    	(exeute): Delete.
    
    frysk-core/frysk/util/ChangeLog:
    2008-02-21  Teresa Thomas  <tthomas@redhat.com>
    
    	* ProcStopUtil.java (.parseCores): Update to match
    	changes to Event.ProcEvent.
    
    frysk-core/frysk/bindir/ChangeLog:
    2008-02-21  Teresa Thomas  <tthomas@redhat.com>
    
    	* fexe.java (PrintExeEvent): Update for changes
    	to event.ProcEvent.
    	* fdebuginfo.java (PrintDebuginfoEvent): Ditto.
    	* fmaps.java (PrintMapsEvent): Ditto.
    	* fauxv.java (PrintAuxvEvent): Ditto.

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

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog       |    8 +++++
 frysk-core/frysk/bindir/fauxv.java      |   13 ++++----
 frysk-core/frysk/bindir/fdebuginfo.java |   26 ++++++++++------
 frysk-core/frysk/bindir/fexe.java       |   47 ++++++++++++++-----------------
 frysk-core/frysk/bindir/fmaps.java      |   10 +++---
 frysk-core/frysk/event/ChangeLog        |    6 ++++
 frysk-core/frysk/event/ProcEvent.java   |   12 +------
 frysk-core/frysk/util/ChangeLog         |    5 +++
 frysk-core/frysk/util/ProcStopUtil.java |   12 ++++----
 9 files changed, 75 insertions(+), 64 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index 4c50ee9..44cc131 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-21  Teresa Thomas  <tthomas@redhat.com>
+
+	* fexe.java (PrintExeEvent): Update for changes 
+	to event.ProcEvent.
+	* fdebuginfo.java (PrintDebuginfoEvent): Ditto.
+	* fmaps.java (PrintMapsEvent): Ditto.
+	* fauxv.java (PrintAuxvEvent): Ditto.
+	
 2008-02-20  Andrew Cagney  <cagney@redhat.com>
 
 	* TestFexe.java: Prevent bash execing fexe.
diff --git a/frysk-core/frysk/bindir/fauxv.java b/frysk-core/frysk/bindir/fauxv.java
index 9dfdc37..8cbd8d3 100644
--- a/frysk-core/frysk/bindir/fauxv.java
+++ b/frysk-core/frysk/bindir/fauxv.java
@@ -39,12 +39,11 @@
 
 package frysk.bindir;
 
-import java.io.File;
-
 import frysk.event.ProcEvent;
 import frysk.proc.Proc;
 import frysk.util.AuxvStringBuilder;
 import frysk.util.ProcStopUtil;
+import java.io.File;
 
 public class fauxv {
 
@@ -60,9 +59,9 @@ public class fauxv {
 
     private static class PrintAuxvEvent implements ProcEvent
     {
-        public void execute(Proc proc) {
+        public void executeLive(Proc proc) {
+            
             class BuildAuxv extends AuxvStringBuilder {
-
         	public StringBuffer auxvData = new StringBuffer();
         	public void buildLine(String type, String desc, String value) {
         	    auxvData.append(type+" (" + desc+") : " + value+"\n");
@@ -78,8 +77,8 @@ public class fauxv {
             }
         }
         
-	public void setProcData (File coreFile) {
-	    // Implementation not required here.
-	}
+        public void executeDead(Proc proc, File file) {
+            executeLive (proc);
+        }
     }
 }
diff --git a/frysk-core/frysk/bindir/fdebuginfo.java b/frysk-core/frysk/bindir/fdebuginfo.java
index a57f666..4d0c565 100644
--- a/frysk-core/frysk/bindir/fdebuginfo.java
+++ b/frysk-core/frysk/bindir/fdebuginfo.java
@@ -65,18 +65,24 @@ public final class fdebuginfo
     
     private static class PrintDebuginfoEvent implements ProcEvent
     {
-	public void execute(Proc proc) {
-	    /* Get and print the debuginfo install paths.
-	     */
+	public void executeLive(Proc proc) {
+	    // Get and print the debuginfo install paths.	     
 	    Task task  = proc.getMainTask();
 	    DebuginfoPaths dbg = new DebuginfoPaths(task);
-	    String dInfo = dbg.getDebuginfo();          
-	    if (dInfo!=null)
-		System.out.print(dInfo); 
+	    String dInfo = dbg.getDebuginfo();    
+	    
+	    if (dInfo!=null) {
+		if (dInfo.length() == 0)
+		    System.out.println("No packages found.");
+		else
+		    System.out.print(dInfo); 
+	    }
+	    else 
+		System.out.println("No packages found.");
 	}	
-	
-	public void setProcData (File coreFile) {
-	    // Implementation not required here.
-	}
+        
+        public void executeDead(Proc proc, File file) {
+            executeLive (proc);
+        }
     }
 }
\ No newline at end of file
diff --git a/frysk-core/frysk/bindir/fexe.java b/frysk-core/frysk/bindir/fexe.java
index ec6b6ce..21cd424 100644
--- a/frysk-core/frysk/bindir/fexe.java
+++ b/frysk-core/frysk/bindir/fexe.java
@@ -68,35 +68,30 @@ public class fexe
     
     private static class PrintExeEvent implements ProcEvent
     {	
-	private File coreFile;
-	
-	public void setProcData (File coreFile) {
-	    this.coreFile = coreFile;
-	}
-	
-	public void execute(Proc proc) {
-
+	public void executeLive(Proc proc) {
 	    if (verbose) {
-		// Corefiles		
-		if (coreFile != null) 
-		    System.out.println(coreFile.getPath()
-			               + " "
-			               + proc.getExe());
-		// Processes
-		else if (proc.getPid() != 0) {
-		    ProcessIdentifier pid
-		     = ProcessIdentifierFactory.create(proc.getPid());
-		    System.out.println(proc.getPid()
-			               + " "
-			               + proc.getExe()
-			               + " "
-			               + Exe.get(pid));
-		}
-		// Executables
-		else 
-		    System.out.println(proc.getExe());
+		ProcessIdentifier pid
+		= ProcessIdentifierFactory.create(proc.getPid());
+		System.out.println(  proc.getPid()
+			           + " "
+			           + proc.getExe()
+			           + " "
+			           + Exe.get(pid));
 	    } else 
 		System.out.println(proc.getExe());
 	}
+	
+	public void executeDead(Proc proc, File coreFile) {
+	    if (coreFile == null) 
+		System.out.println(proc.getExe());
+	    
+	    else if (verbose) {
+		System.out.println(  coreFile
+			           + " "
+			           + proc.getExe());
+	    } 
+	    else 
+		System.out.println(proc.getExe());
+	}
     }
 }
diff --git a/frysk-core/frysk/bindir/fmaps.java b/frysk-core/frysk/bindir/fmaps.java
index 2cd08b3..a3e2a12 100644
--- a/frysk-core/frysk/bindir/fmaps.java
+++ b/frysk-core/frysk/bindir/fmaps.java
@@ -58,14 +58,14 @@ public class fmaps {
     
     private static class PrintMapsEvent implements ProcEvent
     {
-	public void execute(Proc proc) {
+	public void executeLive(Proc proc) {
 	    MemoryMap[] maps = proc.getMaps();
 	    for(int i=0; i<maps.length; i++)
 		System.out.println(maps[i].toString());
 	}
-	
-	public void setProcData (File coreFile) {
-	    // Implementation not required here.
-	}
+	        
+        public void executeDead(Proc proc, File file) {
+            executeLive (proc);
+        }
     }
 }
diff --git a/frysk-core/frysk/event/ChangeLog b/frysk-core/frysk/event/ChangeLog
index b42be74..555191a 100644
--- a/frysk-core/frysk/event/ChangeLog
+++ b/frysk-core/frysk/event/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-21  Teresa Thomas  <tthomas@redhat.com>
+
+	* ProcEvent.java (executeDead): New.
+	(executeLive): New.
+	(exeute): Delete.
+
 2008-02-20  Teresa Thomas  <tthomas@redhat.com>
 
 	* ProcEvent.java (setProcData): New.
diff --git a/frysk-core/frysk/event/ProcEvent.java b/frysk-core/frysk/event/ProcEvent.java
index 0e4c7c1..993f669 100644
--- a/frysk-core/frysk/event/ProcEvent.java
+++ b/frysk-core/frysk/event/ProcEvent.java
@@ -47,14 +47,6 @@ import java.io.File;
  */
 public interface ProcEvent
 {
-    void execute (Proc proc);
-    
-    /**
-     * Use to set proc specific information. 
-     * 
-     * XXX: Add parameters to this function for 
-     * access to more process specific information 
-     * by the utilities. 
-     */
-    void setProcData (File coreFile);
+    void executeLive(Proc proc);
+    void executeDead(Proc proc, File file);
 }
diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
index 4addd82..6917c27 100644
--- a/frysk-core/frysk/util/ChangeLog
+++ b/frysk-core/frysk/util/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-21  Teresa Thomas  <tthomas@redhat.com>
+
+	* ProcStopUtil.java (.parseCores): Update to match
+	changes to Event.ProcEvent.
+
 2008-02-20  Teresa Thomas  <tthomas@redhat.com>
 
 	* ProcStopUtil.java (.parseCores): Call setProcData.
diff --git a/frysk-core/frysk/util/ProcStopUtil.java b/frysk-core/frysk/util/ProcStopUtil.java
index c859fe0..5bd980f 100644
--- a/frysk-core/frysk/util/ProcStopUtil.java
+++ b/frysk-core/frysk/util/ProcStopUtil.java
@@ -66,7 +66,6 @@ public class ProcStopUtil
     private Proc proc;
     private String[] args;
     private CommandlineParser parser;
-    private File coreFile;
 	
     public ProcStopUtil (String utilName, String[] args, 
 	                  final ProcEvent procEvent) {
@@ -87,11 +86,9 @@ public class ProcStopUtil
 	    {
 		for (int i = 0; i < coreExePairs.length; i++)
 		{       
-		    coreFile = coreExePairs[i].coreFile;
-		    procEvent.setProcData  (coreFile);
 		    proc = Util.getProcFromCoreExePair(coreExePairs[i]);
 		    failIfProcNull(proc);
-		    procEvent.execute(proc);
+		    procEvent.executeDead(proc, coreExePairs[i].coreFile);
 		}  
 	    }
 	    
@@ -108,7 +105,7 @@ public class ProcStopUtil
 		    Host exeHost = new LinuxExeHost(Manager.eventLoop, exeFile);
 		    proc = Util.getProcFromExeFile(exeHost);
 		    failIfProcNull(proc);
-		    procEvent.execute(proc);
+		    procEvent.executeDead(proc, null);
 		}
 	    }
 	};
@@ -190,7 +187,10 @@ public class ProcStopUtil
 	}
 	
 	public void execute() {
-	    event.execute(proc);
+	    event.executeLive(proc);
+	    
+	    // FIXME: Should request eventloop to stop
+	    // instead of exit.
 	    System.exit(0);
 	}
     }


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


                 reply	other threads:[~2008-02-21 20:07 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=20080221200740.17263.qmail@sourceware.org \
    --to=tthomas@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).