You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by or...@apache.org on 2003/01/15 09:15:15 UTC

cvs commit: jakarta-bsf/src/bsf-2.3/bsf/src/org/apache/bsf/engines/javascript RhinoContextProxy.java

orlikowski    2003/01/15 00:15:14

  Modified:    src/bsf-2.3/bsf/src/org/apache/bsf/engines/javascript
                        RhinoContextProxy.java
  Log:
  Again, not a build fix. Hopefully coming soon.
  This, however, does cleanup some of the stack frame management code
  for Rhino debugging.
  
  Revision  Changes    Path
  1.3       +7 -15     jakarta-bsf/src/bsf-2.3/bsf/src/org/apache/bsf/engines/javascript/RhinoContextProxy.java
  
  Index: RhinoContextProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bsf/src/bsf-2.3/bsf/src/org/apache/bsf/engines/javascript/RhinoContextProxy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RhinoContextProxy.java	7 Nov 2002 01:49:12 -0000	1.2
  +++ RhinoContextProxy.java	15 Jan 2003 08:15:14 -0000	1.3
  @@ -213,13 +213,9 @@
                   // step if we are in the same frame (nothing to step in... :-)
                   // if we are in a called frame...
                   // but also if we stepped out of the current frame...
  -                if ((frameCount >= m_stepDepth) 
  -                    || (frameCount < m_stepDepth)) {
                       updateStack();
                       cancelStepping();
                       return m_frames[0];
  -                }
  -                break;
               case STEP_OVER :
                   // OG if (frameCount == m_stepDepth) {
                   // step if we are in the same frame or above...
  @@ -256,16 +252,12 @@
       }
   
       public void updateStack() throws RemoteException {
  -        JsContextStub frames[];
  -        JsContextStub stub;
  +        int nf, of, frameCount = m_engine.getFrameCount();
  +        JsContextStub frames[] = new JsContextStub[frameCount];
           DebugFrame frame;
  -        int nf, of, frameCount;
   
           m_atBreakpoint = true;
   
  -        frameCount = m_engine.getFrameCount();
  -        frames = new JsContextStub[frameCount];
  -
           // scan the stacks from the outer frame down
           // to the inner one of the shortest of the old
           // and the new known stack.
  @@ -277,9 +269,9 @@
           // stubs can be dropped and invalidated, new ones
           // must be created.
   
  -        for (nf = frameCount - 1, of = m_frameCount - 1;
  -             nf >= 0 && of >= 0;
  -             nf--, of--) {
  +        for (nf = 0, of = 0;
  +             nf < frameCount && of < m_frameCount;
  +             nf++, of++) {
               frame = m_engine.getFrame(nf);
               if (frame == m_frames[of].m_frame) {
                   frames[nf] = m_frames[of];
  @@ -289,11 +281,11 @@
           // now drop all old frames that diverged.
           // Also invalidate the frame stubs so to
           // tracked that they are no longer valid.
  -        for (; of >= 0; of--) {
  +        for (; of < m_frameCount; of++) {
               m_reDbg.dropStub(m_frames[of].m_frame);
               m_frames[of].invalidate();
           }
  -        for (; nf >= 0; nf--) {
  +        for (; nf < frameCount; nf++) {
               frame = m_engine.getFrame(nf);
               frames[nf] = new JsContextStub(this, frame, nf);
           }