public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: mark@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Mark Task as justStarted when receiving an ExecedEvent.
Date: Wed, 09 Apr 2008 14:14:00 -0000	[thread overview]
Message-ID: <20080409141418.14389.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  a3efa3a7e09b2760484ce7e6b0d67e74b170e8bb (commit)
      from  d1a490efa853a1a7c0d4c8f9c19e104950ade138 (commit)

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

- Log -----------------------------------------------------------------
commit a3efa3a7e09b2760484ce7e6b0d67e74b170e8bb
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Wed Apr 9 16:06:46 2008 +0200

    Mark Task as justStarted when receiving an ExecedEvent.
    
    frysk-core/frysk/proc/ChangeLog
    2008-04-09  Mark Wielaard  <mwielaard@redhat.com>
    
           * TestTaskObserverInstruction (testFirstInstructionAtEntry):
           New test.
    
    frysk-core/frysk/proc/live/ChangeLog
    2008-04-09  Mark Wielaard  <mwielaard@redhat.com>
    
           * LinuxPtraceTaskState.java (Running.handleExecedEvent): Mark
           Task as justStarted.

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

Summary of changes:
 frysk-core/frysk/proc/ChangeLog                    |    5 +++
 .../frysk/proc/TestTaskObserverInstruction.java    |   27 ++++++++++++++++++++
 frysk-core/frysk/proc/live/ChangeLog               |    5 +++
 .../frysk/proc/live/LinuxPtraceTaskState.java      |    4 +++
 4 files changed, 41 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index ffcdbbf..eab7ef8 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-09  Mark Wielaard  <mwielaard@redhat.com>
+
+	* TestTaskObserverInstruction (testFirstInstructionAtEntry):
+	New test.
+
 2008-04-07  Stan Cox  <scox@redhat.com>
 
 	* Host.java (requestCreateAttachedProc): Add libs parameter.  Change 
diff --git a/frysk-core/frysk/proc/TestTaskObserverInstruction.java b/frysk-core/frysk/proc/TestTaskObserverInstruction.java
index d5e3d2a..546a763 100644
--- a/frysk-core/frysk/proc/TestTaskObserverInstruction.java
+++ b/frysk-core/frysk/proc/TestTaskObserverInstruction.java
@@ -43,6 +43,9 @@ import frysk.testbed.TestLib;
 import frysk.testbed.Offspring;
 import frysk.testbed.SlaveOffspring;
 
+import frysk.testbed.DaemonBlockedAtEntry;
+import frysk.config.Config;
+
 public class TestTaskObserverInstruction extends TestLib
 {
   public void testInstruction()
@@ -136,6 +139,30 @@ public class TestTaskObserverInstruction extends TestLib
     assertTrue("InstructionObserver hit", instr.hit == 2);
   }
 
+  /**
+   * Tests stepping the very first instruction (actualy the start of the
+   * dynamic loader which is going to load the actual program). This is
+   * a nasty corner case since this isn't a "real step" but actually the
+   * kernel adjusting the task so that it will start running.
+   */
+  public void testFirstInstructionAtEntry()
+  {
+    DaemonBlockedAtEntry daemon;
+    daemon = new DaemonBlockedAtEntry(Config.getPkgLibFile("funit-child"));
+    Task task = daemon.getMainTask();
+
+    InstructionObserver instr = new InstructionObserver();
+    task.requestAddInstructionObserver(instr);
+    assertRunUntilStop("add InstructionObserver");
+    assertTrue("InstructionObserver added", instr.added);
+    assertTrue("InstructionObserver hit", instr.hit == 1);
+
+    daemon.requestUnblock();
+    task.requestUnblock(instr);
+    assertRunUntilStop("step first instruction");
+    assertTrue("InstructionObserver hit again", instr.hit == 2);
+  }
+
   private class StepAttachedObserver implements TaskAttachedObserverXXX
   {
     private final InstructionObserver instr;
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 99e9c3a..1435679 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-09  Mark Wielaard  <mwielaard@redhat.com>
+
+	* LinuxPtraceTaskState.java (Running.handleExecedEvent): Mark
+	Task as justStarted.
+
 2008-04-08  Phil Muldoon  <pmuldoon@redhat.com>
 	    Mark Wielaard  <mwielaard@redhat.com>
 			
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
index 3e590c4..9a71530 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
@@ -891,6 +891,10 @@ abstract class LinuxPtraceTaskState extends State {
 		((TaskObservation) i.next()).delete();
 	    }
 
+	    // Mark this LinuxPtraceTask as just started.  See
+	    // Running.handleTrapped for more explanation.
+	    task.justStartedXXX = true;
+
 	    if (task.notifyExeced() > 0) {
 		return (task.syscallObservers.numberOfObservers() > 0
 			? syscallBlockedInSyscallContinue


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


                 reply	other threads:[~2008-04-09 14:14 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=20080409141418.14389.qmail@sourceware.org \
    --to=mark@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).