This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: frysk.rt.SteppingEngine poking at a task's blocker list?


Tim Moore wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Cagney wrote:
Tim, Mike,

I noticed this in frysk.rt.SteppingEngine:

  /**
    * Unblock a task so that, from the point of view of the stepping
    * engine, execution can continue. For now this unblocks
    * instruction observers and code observers for breakpoints, but
    * ultimately I (timoore) think it should unblock all blockers.
    */
   public boolean continueForStepping(Task task, boolean unblockStepper) {
       if (unblockStepper) {
           task.requestUnblock(this.steppingObserver);
       }
       TaskObserver[] blockers = (TaskObserver
[])task.getBlockers().clone();
       for (int j = 0; j < blockers.length; j++) {
           // One of ours?
           if (blockers[j] instanceof Breakpoint) {
               task.requestUnblock(blockers[j]);
           } else {
               // Some blocker that we don't know about
               // System.out.println("Unknown blocker " +
blockers[j].toString());
               // return false;
           }
       }
       return true;
   }

I'm not sure what is happening here, but the underlying code should
operate as:
-> process hits a breakpoint instruction
-> all low-level CodeObservers fire
-> all corresponding high-level Breakpoint observers fire
-> Breakpoint observers each notify Stepping engine to stop (accompanied
by corresponding low-level CodeObserver doing the block)
This will leave the SteppingEngine with a full list of CodeObservers to
unblock without needing to poke around an assumed live task's internal
state.
I was going on the theory that it would be better to not have to
interact with the stepping engine when setting breakpoints. I see below
that you're after the same thing, which we talked about, so I'm
surprised that you want breakpoints to depend on the stepping engine at all.


I believe it would be best for the SteppingEngine to have some sort of Observer which is notified upon any breakpoint events relevent to the Task at hand, and deal appropriately with the situation then, instead of trying to run through that potential blockers list each time. So any time a breakpoint is set anywhere, or removed anywhere, it updates that Observer in the SteppingEngine.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]