public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Delete SyscallEventInfo.number().
Date: Thu, 27 Dec 2007 20:54:00 -0000	[thread overview]
Message-ID: <20071227205449.10172.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  90b3799ab0d02de462524c4d60a66a9b3e51fa0c (commit)
      from  313740045e4275ac1cef9e089e3042cff90d6d0e (commit)

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

- Log -----------------------------------------------------------------
commit 90b3799ab0d02de462524c4d60a66a9b3e51fa0c
Author: Andrew Cagney <cagney@redhat.com>
Date:   Thu Dec 27 15:31:52 2007 -0500

    Delete SyscallEventInfo.number().
    
    frysk-core/frysk/proc/ChangeLog
    2007-12-27  Andrew Cagney  <cagney@redhat.com>
    
    	* Syscall.java (INVALID): New.
    	* SyscallEventInfo.java (number(Task)): Delete.
    	(ENTER, EXIT, UNKNOWN): Delete.
    	* Task.java (notifySyscallExit()): Update.
    	(notifySyscallEnter()): Update.
    	* TestSyscallSignal.java: Update.
    	* TestTaskSyscallObserver.java: Update.
    	* LinuxIa32.java: Update.
    	* LinuxPPC32.java: Update.
    	* LinuxX8664.java: Update.
    	* LinuxPPC64.java: Update.

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

Summary of changes:
 frysk-core/frysk/proc/ChangeLog                    |   12 +++
 frysk-core/frysk/proc/LinuxIa32.java               |    2 +-
 frysk-core/frysk/proc/LinuxPPC32.java              |    2 +-
 frysk-core/frysk/proc/LinuxPPC64.java              |    2 +-
 frysk-core/frysk/proc/LinuxX8664.java              |    2 +-
 frysk-core/frysk/proc/Syscall.java                 |   11 +++-
 frysk-core/frysk/proc/SyscallEventInfo.java        |   36 +++-------
 frysk-core/frysk/proc/SyscallTable.java            |    1 +
 frysk-core/frysk/proc/Task.java                    |   76 ++++++++-----------
 frysk-core/frysk/proc/TestSyscallSignal.java       |    3 -
 frysk-core/frysk/proc/TestTaskSyscallObserver.java |   13 ----
 11 files changed, 69 insertions(+), 91 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index 5c8202c..c877298 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,17 @@
 2007-12-27  Andrew Cagney  <cagney@redhat.com>
 
+	* Syscall.java (INVALID): New.
+	* SyscallEventInfo.java (number(Task)): Delete.
+	(ENTER, EXIT, UNKNOWN): Delete.
+	* Task.java (notifySyscallExit()): Update.
+	(notifySyscallEnter()): Update.
+	* TestSyscallSignal.java: Update.
+	* TestTaskSyscallObserver.java: Update.
+	* LinuxIa32.java: Update.
+	* LinuxPPC32.java: Update.
+	* LinuxX8664.java: Update.
+	* LinuxPPC64.java: Update.
+
 	* Syscall.java (iterateSyscallByName(String,Syscall[])): Move to ...
 	* SyscallTable.java (iterateSyscallByName(String,Syscall[])): New.
 	* LinuxX8664Syscall.java: Update.
diff --git a/frysk-core/frysk/proc/LinuxIa32.java b/frysk-core/frysk/proc/LinuxIa32.java
index b488ff8..695b3db 100644
--- a/frysk-core/frysk/proc/LinuxIa32.java
+++ b/frysk-core/frysk/proc/LinuxIa32.java
@@ -170,7 +170,7 @@ class LinuxIa32 implements SyscallEventDecoder, Isa {
     public SyscallEventInfo getSyscallEventInfo() {
 	if (info == null)
 	    info = new SyscallEventInfo() {
-		    public int number (Task task) {
+		    private int number(Task task) {
 			return (int)task.getRegister(IA32Registers.ORIG_EAX);
 		    }
 		    public Syscall getSyscall(Task task) {
diff --git a/frysk-core/frysk/proc/LinuxPPC32.java b/frysk-core/frysk/proc/LinuxPPC32.java
index 149b0c0..83f6836 100644
--- a/frysk-core/frysk/proc/LinuxPPC32.java
+++ b/frysk-core/frysk/proc/LinuxPPC32.java
@@ -68,7 +68,7 @@ class LinuxPPC32 extends IsaPowerPC implements SyscallEventDecoder {
     public SyscallEventInfo getSyscallEventInfo () {
 	if (info == null)
 	    info = new SyscallEventInfo () {
-		    public int number (Task task) {
+		    private int number(Task task) {
 			logger.log (Level.FINE, "Get GPR0\n");
 			return (int)task.getRegister(PPC32Registers.GPR0);
 		    }
diff --git a/frysk-core/frysk/proc/LinuxPPC64.java b/frysk-core/frysk/proc/LinuxPPC64.java
index b6c2e83..e793660 100644
--- a/frysk-core/frysk/proc/LinuxPPC64.java
+++ b/frysk-core/frysk/proc/LinuxPPC64.java
@@ -68,7 +68,7 @@ class LinuxPPC64 extends IsaPowerPC implements SyscallEventDecoder
     public SyscallEventInfo getSyscallEventInfo () {
 	if (info == null)
 	    info = new SyscallEventInfo () {
-		    public int number (Task task) {
+		    private int number(Task task) {
 			logger.log (Level.FINE, "Get GPR0\n");
 			return (int)task.getRegister(PPC64Registers.GPR0);
 		    }
diff --git a/frysk-core/frysk/proc/LinuxX8664.java b/frysk-core/frysk/proc/LinuxX8664.java
index 2fa440f..7bd8ff8 100644
--- a/frysk-core/frysk/proc/LinuxX8664.java
+++ b/frysk-core/frysk/proc/LinuxX8664.java
@@ -174,7 +174,7 @@ class LinuxX8664 implements SyscallEventDecoder, Isa {
     public SyscallEventInfo getSyscallEventInfo () {
 	if (info == null)
 	    info = new SyscallEventInfo () {
-		    public int number (Task task) {
+		    private int number(Task task) {
 			return (int)task.getRegister(X8664Registers.ORIG_RAX);
 		    }
 		    public Syscall getSyscall(Task task) {
diff --git a/frysk-core/frysk/proc/Syscall.java b/frysk-core/frysk/proc/Syscall.java
index c6f26fd..ac012da 100644
--- a/frysk-core/frysk/proc/Syscall.java
+++ b/frysk-core/frysk/proc/Syscall.java
@@ -49,6 +49,15 @@ import java.util.HashMap;
  */
 
 public abstract class Syscall {
+    public static final Syscall INVALID = new Syscall("<invalid>", -1) {
+	    public long getArguments(Task task, int n) {
+		return 0;
+	    }
+	    public long getReturnCode(Task task) {
+		return 0;
+	    }
+	};
+
     private final int number;
     private final int numArgs;
     private final String name;
@@ -257,7 +266,7 @@ public abstract class Syscall {
 	unknownSyscalls = syscallTable.getUnknownSyscalls();
 
 	if (num < 0) {
-	    throw new RuntimeException ("Negative syscall number: " + num);
+	    return INVALID;
 	} else if (num >= syscallList.length) {
 	    synchronized (unknownSyscalls) {
 		Integer key = new Integer(num);
diff --git a/frysk-core/frysk/proc/SyscallEventInfo.java b/frysk-core/frysk/proc/SyscallEventInfo.java
index fa6e5fd..9873250 100644
--- a/frysk-core/frysk/proc/SyscallEventInfo.java
+++ b/frysk-core/frysk/proc/SyscallEventInfo.java
@@ -42,31 +42,15 @@ package frysk.proc;
  * An object that retrieves syscall info from a task. Used in combination
  * with Syscall and a Task object to retrieve information.
  */
-public abstract class SyscallEventInfo
-{
-  public final static int ENTER = 0;
-  public final static int EXIT = 1;
-  public final static int UNKNOWN = -1;
-  
-  /**
-   * Returns the syscall number of the system call the the
-   * given task just made.
-   * This function assumes that the given task is currently
-   * in the system call. This function should not be called
-   * otherwise.
-   * @param task the task which made the system call
-   * @return the number of the system call that was made
-   */
-  public abstract int number (Task task);
-  
-  /** 
-   * getSyscall does everything on the assumption that there is a 
-   * system, and programmer want to know the information about this
-   * system call.  A meaningless Syscall object is returned when
-   * getSyscall is called at the moment no system call occurs.
-   * @param task the task that system call occurred
-   * @return the Syscall object
-   */
-  public abstract Syscall getSyscall (Task task);
+public abstract class SyscallEventInfo {
+    /** 
+     * getSyscall does everything on the assumption that there is a 
+     * system, and programmer want to know the information about this
+     * system call.  A meaningless Syscall object is returned when
+     * getSyscall is called at the moment no system call occurs.
+     * @param task the task that system call occurred
+     * @return the Syscall object
+     */
+    public abstract Syscall getSyscall (Task task);
   
 }
diff --git a/frysk-core/frysk/proc/SyscallTable.java b/frysk-core/frysk/proc/SyscallTable.java
index cc582b6..245fb42 100644
--- a/frysk-core/frysk/proc/SyscallTable.java
+++ b/frysk-core/frysk/proc/SyscallTable.java
@@ -46,6 +46,7 @@ import java.util.HashMap;
  */
 
 public abstract class SyscallTable {
+
     /**
      * @return Syscall[] return system call list for this Linux<ISA>.
      */
diff --git a/frysk-core/frysk/proc/Task.java b/frysk-core/frysk/proc/Task.java
index f22b1b0..2d5f4b3 100644
--- a/frysk-core/frysk/proc/Task.java
+++ b/frysk-core/frysk/proc/Task.java
@@ -758,51 +758,39 @@ public abstract class Task
     logger.log(Level.FINE, "{0} requestDeleteSyscallObserver\n", this);
   }
 
-  /**
-   * Notify all Syscall observers of this Task's entry into a system call.
-   * Return the number of blocking observers.
-   *
-   * XXX: Should not be public.
-   */
-  public int notifySyscallEnter ()
-  {
-      logger.log(Level.FINE,
-		 "{0} notifySyscallEnter {1}\n",
-		 new Object[] 
-		 { this,
-		   new Integer(this.getSyscallEventInfo().number(this))
-		 });
-    for (Iterator i = syscallObservers.iterator(); i.hasNext();)
-      {
-        TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
-        if (observer.updateSyscallEnter(this) == Action.BLOCK)
-          blockers.add(observer);
-      }
-    return blockers.size();
-  }
+    /**
+     * Notify all Syscall observers of this Task's entry into a system
+     * call.  Return the number of blocking observers.
+     *
+     * XXX: Should not be public.
+     */
+    public int notifySyscallEnter () {
+	logger.log(Level.FINE,
+		   "{0} notifySyscallEnter\n", this);
+	for (Iterator i = syscallObservers.iterator(); i.hasNext();) {
+	    TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
+	    if (observer.updateSyscallEnter(this) == Action.BLOCK)
+		blockers.add(observer);
+	}
+	return blockers.size();
+    }
 
-  /**
-   * Notify all Syscall observers of this Task's exit from a system
-   * call. Return the number of blocking observers.
-   *
-   * XXX: Should not be public.
-   */
-  public int notifySyscallExit ()
-  {
-      logger.log(Level.FINE,
-		 "{0} notifySyscallExit {1}\n",
-		 new Object[] 
-		 { this,
-		   new Integer(this.getSyscallEventInfo().number(this))
-		 });
-    for (Iterator i = syscallObservers.iterator(); i.hasNext();)
-      {
-        TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
-        if (observer.updateSyscallExit(this) == Action.BLOCK)
-          blockers.add(observer);
-      }
-    return blockers.size();
-  }
+    /**
+     * Notify all Syscall observers of this Task's exit from a system
+     * call. Return the number of blocking observers.
+     *
+     * XXX: Should not be public.
+     */
+    public int notifySyscallExit () {
+	logger.log(Level.FINE,
+		   "{0} notifySyscallExit {1}\n", this);
+	for (Iterator i = syscallObservers.iterator(); i.hasNext();) {
+	    TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
+	    if (observer.updateSyscallExit(this) == Action.BLOCK)
+		blockers.add(observer);
+	}
+	return blockers.size();
+    }
 
   /**
    * Set of Signaled observers.
diff --git a/frysk-core/frysk/proc/TestSyscallSignal.java b/frysk-core/frysk/proc/TestSyscallSignal.java
index 44cfbaf..737b832 100644
--- a/frysk-core/frysk/proc/TestSyscallSignal.java
+++ b/frysk-core/frysk/proc/TestSyscallSignal.java
@@ -273,9 +273,6 @@ public class TestSyscallSignal
 
 	public Action updateSyscallExit(Task task) {
 	    SyscallEventInfo syscallEventInfo = getSyscallEventInfo(task);
-	    // XXX - workaround for broken syscall detection on exit
-	    if (syscallEventInfo.number(task) == -1)
-		return Action.CONTINUE;
 	    frysk.proc.Syscall syscall = syscallEventInfo.getSyscall(task);
 	    if (opensys.equals(syscall) || closesys.equals(syscall)) {
 		exited++;
diff --git a/frysk-core/frysk/proc/TestTaskSyscallObserver.java b/frysk-core/frysk/proc/TestTaskSyscallObserver.java
index d212969..05d008c 100644
--- a/frysk-core/frysk/proc/TestTaskSyscallObserver.java
+++ b/frysk-core/frysk/proc/TestTaskSyscallObserver.java
@@ -100,10 +100,6 @@ public class TestTaskSyscallObserver
 	    enter++;
 
 	    SyscallEventInfo syscallEventInfo = getSyscallEventInfo(task);
-	    // XXX - workaround for broken syscall detection on exit
-	    if (syscallEventInfo.number(task) == - 1)
-		return Action.CONTINUE;
-
 	    frysk.proc.Syscall syscall = syscallEventInfo.getSyscall(task);
 
 	    if (execvesys.equals(syscall)) {
@@ -420,12 +416,6 @@ public class TestTaskSyscallObserver
     public Action updateSyscallExit (Task task)
     {
       super.updateSyscallExit(task);
-      SyscallEventInfo syscallEventInfo = getSyscallEventInfo(task);
-      
-      // XXX - workaround for broken syscall detection on exit
-      if (syscallEventInfo.number(task) == - 1)
-        return Action.CONTINUE;
-      
       frysk.proc.Syscall syscall = (frysk.proc.Syscall) syscallCache.remove(task);
       
       if (opensys.equals(syscall) && openingTestFile)
@@ -535,9 +525,6 @@ public class TestTaskSyscallObserver
       {
         super.updateSyscallExit(task);
         SyscallEventInfo syscallEventInfo = getSyscallEventInfo(task);
-        // XXX - workaround for broken syscall detection on exit
-        if (syscallEventInfo.number(task) == - 1)
-          return Action.CONTINUE;
         frysk.proc.Syscall syscall = syscallEventInfo.getSyscall(task);
         if (readsys.equals(syscall))
           {


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


                 reply	other threads:[~2007-12-27 20:54 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=20071227205449.10172.qmail@sourceware.org \
    --to=cagney@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).