public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: tthomas@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Stop task before gathering debugging info.
Date: Tue, 29 Jan 2008 15:51:00 -0000	[thread overview]
Message-ID: <20080129155107.25956.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  f86b535baf401af5fb2ff146202109be5a964282 (commit)
      from  d13d270db639ffc6eb17e537380ef01496d49f91 (commit)

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

- Log -----------------------------------------------------------------
commit f86b535baf401af5fb2ff146202109be5a964282
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Tue Jan 29 10:49:53 2008 -0500

    Stop task before gathering debugging info.
    
    frysk-core/frysk/bindir/ChangeLog
    2008-01-28  Teresa Thomas  <tthomas@redhat.com>
    
    	* fdebuginfo.java (PrintDebuginfoEvent): New.
    	(PrintDebuginfoAction): New.
    	(.parseCores, .parseCommand): Use PrintDebuginfoEvent.
    	(.parsePids): Use PrintDebuginfoAction.
    	* TestFdebuginfo.java (testPathListing): Remove unresolved.

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

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog           |    8 +++
 frysk-core/frysk/bindir/TestFdebuginfo.java |    2 -
 frysk-core/frysk/bindir/fdebuginfo.java     |   67 ++++++++++++++++++++-------
 3 files changed, 58 insertions(+), 19 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index 5163684..e4741e9 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-28  Teresa Thomas  <tthomas@redhat.com>
+
+	* fdebuginfo.java (PrintDebuginfoEvent): New.
+	(PrintDebuginfoAction): New.
+	(.parseCores, .parseCommand): Use PrintDebuginfoEvent.	 
+	(.parsePids): Use PrintDebuginfoAction.
+	* TestFdebuginfo.java (testPathListing): Remove unresolved.
+
 2008-01-25  Teresa Thomas  <tthomas@redhat.com>
 
 	* TestFdebuginfo.java (testBadArguments): Update.
diff --git a/frysk-core/frysk/bindir/TestFdebuginfo.java b/frysk-core/frysk/bindir/TestFdebuginfo.java
index a68a209..1ca9caa 100644
--- a/frysk-core/frysk/bindir/TestFdebuginfo.java
+++ b/frysk-core/frysk/bindir/TestFdebuginfo.java
@@ -52,8 +52,6 @@ import frysk.testbed.SlaveOffspring;
 public class TestFdebuginfo extends TestLib {
 
     public void testPathListing() {
-	if (unresolved(5671))
-	    return;
 	// Create an unattached child process.
 	SlaveOffspring child = SlaveOffspring.createChild();
 	Task task = child.findTaskUsingRefresh(true);
diff --git a/frysk-core/frysk/bindir/fdebuginfo.java b/frysk-core/frysk/bindir/fdebuginfo.java
index ff5e5fd..40f3e8f 100644
--- a/frysk-core/frysk/bindir/fdebuginfo.java
+++ b/frysk-core/frysk/bindir/fdebuginfo.java
@@ -42,10 +42,13 @@ package frysk.bindir;
 
 import java.io.File;
 
+import frysk.event.Event;
 import frysk.proc.Host;
 import frysk.proc.Manager;
+import frysk.proc.ProcBlockAction;
 import frysk.proc.ProcId;
 import frysk.proc.Proc;
+import frysk.proc.ProcObserver;
 import frysk.proc.Task;
 import frysk.proc.dead.LinuxExeHost;
 
@@ -59,20 +62,6 @@ public final class fdebuginfo
     private static CommandlineParser parser;
 
     /**
-     * Function that gets and prints the debuginfo install paths
-     * 
-     * @param proc - pid
-     */
-    private static void printDebuginfo (Proc proc)
-    {
-	Task task  = proc.getMainTask();
-	DebuginfoPaths dbg = new DebuginfoPaths(task);
-	String dInfo = dbg.getDebuginfo();          
-	if (dInfo!=null)
-	    System.out.print(dInfo);      
-    }
-
-    /**
      * Entry function for fdebuginfo
      * 
      * @param args - pid of the process(es) or corefile
@@ -88,7 +77,7 @@ public final class fdebuginfo
 		for (int i = 0; i < coreExePairs.length; i++)
 		{       
 		    Proc proc = Util.getProcFromCoreExePair(coreExePairs[i]);
-		    printDebuginfo(proc);
+		    new PrintDebuginfoEvent (proc).execute();
 		}  
 		System.exit(0);  
 	    }
@@ -99,7 +88,8 @@ public final class fdebuginfo
 		for (int i= 0; i< pids.length; i++)
 		{       
 		    Proc proc = Util.getProcFromPid(pids[i]);
-		    printDebuginfo(proc);
+		    new ProcBlockAction(proc, new PrintDebuginfoAction(proc));
+		    Manager.eventLoop.run();
 		}  
 		System.exit(0);
 	    }
@@ -115,7 +105,7 @@ public final class fdebuginfo
 		    Manager.eventLoop.start();
 		    Host exeHost = new LinuxExeHost(Manager.eventLoop, exeFile);
 		    Proc exeProc = Util.getProcFromExeFile(exeHost);
-		    printDebuginfo(exeProc);
+		    new PrintDebuginfoEvent(exeProc).execute();
 		}
 		System.exit(0);
 	    }
@@ -130,5 +120,48 @@ public final class fdebuginfo
 	parser.printHelp();
 	System.exit(1);   
     }   
+    
+    private static class PrintDebuginfoEvent implements Event
+    {
+	private Proc proc = null;
+	
+	public PrintDebuginfoEvent(Proc proc) {
+	    this.proc = proc;
+	}
+
+	public void execute() {
+	    /* 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); 
+	    System.exit(0);
+	}	
+    }
+    
+    private static class PrintDebuginfoAction implements ProcObserver.ProcAction 
+    {
+	private Proc proc;
+
+	public PrintDebuginfoAction(Proc proc) {
+	    this.proc = proc;
+	}
+
+	public void allExistingTasksCompleted() {
+	    Manager.eventLoop.add(new PrintDebuginfoEvent(this.proc));
+	}
+	public void taskAddFailed(Object task, Throwable w) {
+	}
+	public void existingTask(Task task) {
+	}
+	public void addFailed(Object observable, Throwable w) {
+	}
+	public void addedTo(Object observable) {
+	}
+	public void deletedFrom(Object observable) {
+	}
+    }
 }
 


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


                 reply	other threads:[~2008-01-29 15:51 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=20080129155107.25956.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).